uwazi-pages-cli
v1.0.2
Published
CLI to sync and edit Uwazi pages
Downloads
24
Readme
uwazi-pages-cli
CLI to sync Uwazi pages, detect remote changes by hash, and push local edits in near real time.
Project layout (v2)
Each logical page (same sharedId in Uwazi) lives under pages/<slug>/. Inside there is one subfolder per language (dynamic, from your instance):
pages/
<slug>/
<lang>/
content.html
javascript.js
meta.json
global.css
config.json<slug> comes from the title in the instance default language (/api/settings → languages), sanitized, with a short suffix if two different sharedIds would collide.
Hashes in config.json use keys sharedId:language (e.g. abc123:en).
Breaking change: if you used the older layout pages/<title_language>/ without per-language subfolders, run uwazi-pages sync on a clean tree or remove the old pages/ folder and sync again.
Local install
npm install
npm run buildCommands
uwazi-pages init: creates a project directory withconfig.jsonand base folders.uwazi-pages sync: downloads all language variants andglobal.css, updates hashes.uwazi-pages watch/uwazi-pages serve: same flow—optional pull, pick a page, local preview per language (http://localhost:<port>/<lang>), watch and push for all languages of that page plusglobal.css.
Authentication
- Session cookie stored inside
config.json(session). - If the session is invalid, the CLI prompts for password again.
- Optional 2FA token at login.
npm publish (maintainers)
npm testnpm run release:patch/release:minor/release:major
prepublishOnly runs clean + build + test before publish.
