Skip to content

Latest commit

 

History

History
88 lines (56 loc) · 1.48 KB

README.md

File metadata and controls

88 lines (56 loc) · 1.48 KB

wikijs-cli

A Wiki.js updater

Install

yarn install
npm link

Usage

enviroment

Create a new .env file:

cp .env-example .env

and fill out our Wiki.js instance address and access token.

wikijs-cli.js

list-page-field

List all editable properties of a Page object.

./bin/wikijs-cli.js list-page-fields

list-page

List all pages available on the Wiki.js host.

./bin/wikijs-cli.js list-pages

get-page

Retrieve properties of a Page object using its id field.

./bin/wikijs-cli.js get-page 1

Retrieve only the text content:

./bin/wikijs-cli.js get-page --text 1

update-page

Update a Page object based on its id field.

./bin/wikijs-cli.js update-page 2 data.json

Update only the text content of a page.

./bin/wikijs-cli.js update-page 2 --text content.txt

updater-cli.js

Insert new content into a downloaded Wiki.js page. By default the update will be appended to the content marked by {tagname}...{/tagname} where tagname can be set on the command line or read from the CONTENT_TAG environment variable.

./bin/updater-cli.js old_content.txt update.txt > new_content.txt

Optionally provide a minimum similarity score before new data is appended to the text

./bin/updater-cli.js --similarity 0.9 old_content.txt update.txt > new_content.txt

Optionally overwrite existing tag sections

./bin/updater-cli.js --overwrite old_content.txt update.txt > new_content.txt