Skip to content

CLI reference ​

Every foliwake command. Most are thin wrappers over one foliwake-core operation; preview and publish outside a linked project folder still call the engine directly until they move onto core (in a linked folder they are project preview and project publish, on core), and the server processes are listed in their own section. The command sections below are generated (pnpm cli:reference); do not edit them by hand.

How every command works ​

Configuration file. A command that acts on a site locally reads a project configuration, in this order: --config <file>, then FOLIWAKE_CONFIG, then foliwake.config.json in the current folder (not its parents). A file found in the folder that names credentials, storage or remote addresses is used only after you trust it on this computer with foliwake config trust; any change to the file makes it untrusted again. A minimal project file (code and local content only) needs no trust; it serves dev and page check, and work on a bucket refuses it with SITE_HAS_NO_STORAGE. Without a configuration the command stops with CONFIG_REQUIRED. To create one, run foliwake create, or foliwake admin --config foliwake.config.json --create, or follow the quickstart. See configuration and storage.

Server. Commands with a --server flag can run against a Foliwake server instead. They go to --server, else to the local configuration named by --config, else to the one named by FOLIWAKE_CONFIG, else to the server of the folder's .foliwake/connection.json, else to FOLIWAKE_SERVER, else to foliwake.config.json in the current folder, else to the server of your last foliwake login. From the next @foliwake/cli release (the engine pins 0.7.0 until it moves to it) an explicit FOLIWAKE_SERVER comes before FOLIWAKE_CONFIG, so a server named in CI or inside the Docker image (which sets FOLIWAKE_CONFIG for its own commands) is reached. In CI, set FOLIWAKE_SERVER and FOLIWAKE_TOKEN. See accounts, roles and sign-in.

--site <id>. The site, from the configuration. It can be left out when the file lists one site.

--json. Prints the operation's answer as JSON instead of text. An error is JSON too: {"error": {"code", "message", "category", "retryable"}}.

--input '<json>'. The whole input of the operation, for what flags cannot express; it replaces the other input flags. The operation's own schema checks it, and an unknown key is refused.

bash
foliwake site status --input '{"site":"mysite"}' --json

--debug. Prints on stderr what an answer leaves out: the underlying error with its paths, and why a plugin failed. This text can hold paths and secrets; do not paste it into a ticket unread.

Exit codes.

CodeMeaning
0Done
1The operation failed, page check found errors, or source plugins found problems
2The command line is wrong: an unknown flag, a missing argument, or a write without what it expects
3A write to live committed, but its cache refresh was still pending when the wait ended (release rollback, code release, code rollback, code prepare making release 1, page unpublish, migration commit, operation recover --wait); operation recover --wait finishes it
130Cancelled with Ctrl+C (create)

What a write expects. A command that changes what visitors or reviewers see names what it saw, and is refused when that changed meanwhile: the live release (--expect sr_…, or --latest-live to read it once now), the reviewed preview (migration commit --expect sr_…@cd_…), or a branch's selection (--expect sel_…, none for no preview, --latest-selection, or a deployment's --sequence). Writes that change neither take none: code prepare (a new immutable code release; on a site without a live release it is the exception that changes live, since it makes release 1), source sync, branch bootstrap (only creates the default branch), site adopt and source adopt-pages (bind or assign only what is unowned).

Long operations. Writes answer the operation (--json prints it: its kind, state, steps, delivery, result and error); the command follows it to its end. operation get|list|recover look at it later.

Commands ​

foliwake account bootstrap ​

Create the first account of this server (admin of the default organisation) and print its sign-in link

text
foliwake account bootstrap [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--email <value>e-mail address of the owner
--jsonFormat output as json.
--public-origin <value>where browsers reach this server (default: $FOLIWAKE_PUBLIC_ORIGIN)
bash
foliwake account bootstrap --email owner@example.com --public-origin https://foliwake.example

foliwake account invite ​

Invite an e-mail address into an organisation with a role (accepted when it signs in, within 7 days)

text
foliwake account invite [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--email <value>e-mail address to invite
--jsonFormat output as json.
--livea developer may also release to live
--org <value>organisation
--public-origin <value>where browsers reach this server (default: $FOLIWAKE_PUBLIC_ORIGIN)
--role <value>role in the organisation
--site <value>only this site of the organisation (repeat for several; default: all of them)
bash
foliwake account invite --email author@example.com --role author
foliwake account invite --email dev@example.com --role developer --live --org acme --site acme-docs

foliwake account keys create ​

Make a CI key: it may only deploy code and update branch previews of the named sites (role ci); shown once, kept as a hash (core account.keys.create)

text
foliwake account keys create [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--label <value>what the key is for, e.g. the pipeline (shown in account keys list)
--org <value>the organisation of the sites (default: the only one you administer)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>a site the key may release code of (repeat for several)
bash
foliwake account keys create --site my-site --label "GitHub Actions" --server https://admin.example.com

foliwake account keys list ​

Your signed-in computers and the CI keys of the organisations you administer; never a key itself (core account.keys.list and account.keys.ci)

text
foliwake account keys list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake account keys list
foliwake account keys list --json

foliwake account keys revoke ​

Revoke a key at once: a CI key of an organisation you administer (ci_…), or one of your signed-in computers (key_…) (core account.keys.revoke)

text
foliwake account keys revoke [KEY] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake account keys revoke ci_0123456789abcdef

Print a one-time sign-in link for an existing account (a server without mail)

text
foliwake account link [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--email <value>e-mail address of the account
--jsonFormat output as json.
--public-origin <value>where browsers reach this server (default: $FOLIWAKE_PUBLIC_ORIGIN)
--return-to <value>path to open after signing in
bash
foliwake account link --email author@example.com

foliwake art pull ​

Copy the Drive art folder of a git-markdown source into a local folder (only changed files)

For a git-markdown source with "driveImages" (lesson text in Git, images in a Google Drive folder): copies the pictures a sync would read into your working copy, so foliwake dev, page check and Markdown editors show them. Run it in the source's pages folder of your Git working copy (or name it with --root): - art keys (![alt](art:<key>)): every variant of every key of the art manifests (the shared library in the Drive art folder and the repository's own manifest in --root) goes to "<root>/_art/<variant>/<key>.<ext>", where the engine resolves a key by the page's country, else "default"; --country limits it to the default pictures and those countries; - relative paths below the prefix: the whole Drive art folder goes to "<root>/<prefix>" (e.g. ./art), or --to. Both folders belong in .gitignore. It uses the source's settings and credentials from the project configuration (the credential variables must be set in this environment) with the read-only Drive scope, and checks every download against Drive's checksum or the manifest's. A second run downloads only files whose Drive ID or checksum changed; the record of what it wrote is ".foliwake-art.json" in each folder. A file that is no longer in Drive is removed only when this command wrote it and it is unchanged on disk; nothing outside the two folders is touched, and a file changed locally is kept and reported. Shortcuts, Google files, other file types, hidden or unsafe names, duplicate names and keys that cannot be resolved are skipped and listed, as a sync would refuse them. Exit status 1 when a file could not be downloaded.

text
foliwake art pull [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--country <value>art keys: only the default pictures and this country's overrides (repeatable; default: all)
--debugprint the underlying error, paths included, on stderr
--jsonFormat output as json.
--root <value>the source's pages folder in your working copy (default: this folder)
--site <value>site id from the project configuration (required when it lists several sites)
--source <value>the git-markdown source with "driveImages"
--to <value>the folder of the path mirror (default: <root>/<prefix>, e.g. ./art)
bash
foliwake art pull --source lessons
foliwake art pull --source lessons --root ../site-lessons --country ge

foliwake blocks new ​

Create a block: components/<name>/ with its definition, stylesheet and optionally JavaScript and examples

Writes components/<name>/<name>.json (a title and text, with labels and $schema), <name>.css (in @layer blocks, scoped to [data-component="<name>"], using the site's CSS variables) and, with --js or --react, <name>.js using block-kit (import { defineBlock, html } from '@foliwake/block-kit', served by the engine; --js also adds its labels ui and its events to the definition, --react adds scripts/react-view.js when the project has none). --example adds <name>.example.md with two examples. Existing files are never replaced. The new files are checked with the same rules as page check and code prepare before they are written. Also writes the JSON Schema for editors to .foliwake/schemas/ and the blocks' types to .foliwake/types/.

text
foliwake blocks new [NAME] [flags]
FlagDescription
--code <value>the code folder with components/ (default: the current folder)
--exampleadd <name>.example.md (block examples)
--helpShow CLI help.
--jsadd <name>.js using block-kit
--reactadd <name>.js that renders with React (block-kit ctx.mount and scripts/react-view.js): the shell's host.react, else the vendored scripts/vendor/react.js when the project has it (create --react)
bash
foliwake blocks new callout
foliwake blocks new quiz --js --example
foliwake blocks new rating --react --code ../site

foliwake blocks render ​

Render the block examples into HTML fragments and story files (for Storybook)

Every example of components/<name>/<name>.example.md goes through the page pipeline, as on /_dev/blocks. Written to --out: <block>/<example>.html (the engine's HTML), <block>/<example>.json (block, example, the stylesheets and scripts it needs), <block>.stories.js (a story module for @storybook/html-vite that mounts the fragments and calls each block's init(root, host, meta)), _foliwake/block-kit.js and _foliwake/lit-html.js (a copy of block-kit, the module @foliwake/block-kit that blocks import: alias @foliwake/block-kit to it, as the configuration of create --storybook does) and manifest.json (the index). Paths are relative to the code folder; image URLs are /components/…. Foliwake owns the output folder: every run builds it afresh and swaps it in, so do not put your own files in it. A non-empty folder that this command did not write (no .foliwake-blocks-render marker), a malformed manifest.json or a linked folder is refused, and nothing is changed. Exit status 1 when an example has errors (it is left out).

text
foliwake blocks render [flags]
FlagDescription
--code <value>the code folder with components/ and styles/ (default: the current folder)
--helpShow CLI help.
--lang <value>language of the block labels used as story titles (default: en)
--out <value>output folder, relative to the code folder (default: .foliwake/stories)
--watchrender again after every change of components/, scripts/ or styles/ (Ctrl+C to stop)
bash
foliwake blocks render
foliwake blocks render --watch
foliwake blocks render --out build/stories --code ../site

foliwake blocks schema ​

Write the JSON Schema of block definitions for editors, or print it

Writes the schema of components/<name>/<name>.json to .foliwake/schemas/block-1.schema.json in the code folder, the file the $schema of each definition names (git-ignored; run again after updating the engine). With --print it goes to standard output instead. foliwake dev serves it at /_foliwake/block-1.schema.json.

text
foliwake blocks schema [flags]
FlagDescription
--code <value>the code folder (default: the current folder)
--helpShow CLI help.
--printprint the schema instead of writing it
bash
foliwake blocks schema
foliwake blocks schema --print > block.schema.json

foliwake branch bootstrap ​

Once: seed the default branch preview from live code; a no-op when it exists (core branches.bootstrap)

text
foliwake branch bootstrap [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake branch bootstrap
foliwake branch bootstrap --site a --json

foliwake branch delete ​

Stop serving a branch preview (its hosts answer 404); its code and selection history stay (core branches.remove)

text
foliwake branch delete [BRANCH] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
`--expect <sel_…none>`
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-selectionexpect the branch's selection as it is now (read once, before the request)
--sequence <value>deployment ordering (a positive integer such as the CI run id), instead of --expect: refused as superseded when a request with a higher sequence already updated or deleted this branch
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake branch delete feature/hero --expect sel_…
foliwake branch delete feature/hero --latest-selection
foliwake branch delete feature/hero --sequence <ci run id> --json

foliwake branch history ​

Selection history of one branch (core branches.history)

text
foliwake branch history [BRANCH] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake branch history main
foliwake branch history feature/hero --site a --json

foliwake branch list ​

Branches, their code and preview URLs (core branches.list)

text
foliwake branch list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake branch list
foliwake branch list --site a --json

foliwake branch update ​

Prepare code from a commit (or use --code) and show it in that branch preview; live is unchanged (core branches.update)

text
foliwake branch update [BRANCH] [flags]
FlagDescription
--code <value>an already prepared code release (cd_…) instead of preparing one
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
`--expect <sel_…none>`
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-selectionexpect the branch's selection as it is now (read once, before the request)
--rev <value>the commit to prepare the code from, a branch, tag or full SHA (default HEAD)
--sequence <value>deployment ordering (a positive integer such as the CI run id), instead of --expect: refused as superseded when a request with a higher sequence already updated or deleted this branch
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake branch update feature/hero --rev feature/hero --latest-selection
foliwake branch update feature/hero --code cd_… --expect sel_…
foliwake branch update feature/hero --rev <sha> --sequence <ci run id> --json

foliwake code deploy ​

Deploy a commit of the site's frontend: prepare it, rebuild every page against it in preview and, with codeRelease auto, release exactly that pair when its checks pass (core code.deploy). Its progress goes to stderr while it runs (one JSON event per line with --json); operation list shows it too

text
foliwake code deploy [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--rev <value>the full commit SHA to deploy
--sequence <value>deployment ordering, e.g. a CI run id; an older one than live code is not released
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake code deploy --rev <40-hex sha> --sequence <ci run id> --json

foliwake code prepare ​

Copy JS/CSS from a clean commit into an immutable code release; on a site with a live release, live and preview are unchanged. On a site without one it changes live: it makes release 1, this code and no pages, and waits for its cache refresh (core code.prepare)

text
foliwake code prepare [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--rev <value>the Git revision to copy, a branch, tag or full SHA (default HEAD); the checkout must be clean
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake code prepare
foliwake code prepare --rev feature/hero
foliwake code prepare --rev <sha> --json

foliwake code release ​

Make a prepared code release live code; pages stay as they are; refused when live is not the release you expected (core code.release)

text
foliwake code release [CODE] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the live site release you saw (sr_…, as site status shows it); refused when live is another one
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-liveexpect the live release as it is now (read once, before the request)
--rev <value>the commit the code was prepared from (full SHA), when it was prepared from several
--sequence <value>deployment ordering, e.g. a CI run id: refused as superseded when live code was released with a higher one
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake branch list   # code ids per branch
foliwake code release cd_… --expect sr_…
foliwake code release cd_… --latest-live --rev <sha> --sequence <ci run id> --json

foliwake code rollback ​

Make earlier live code live again; pages stay as they are; refused when live is not the release you expected (core code.rollback)

text
foliwake code rollback [TO] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the live site release you saw (sr_…, as site status shows it); refused when live is another one
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-liveexpect the live release as it is now (read once, before the request)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake site status --json   # earlier code ids are listed under history
foliwake code rollback cd_… --expect sr_…
foliwake code rollback cd_… --latest-live

foliwake config trust ​

Trust a project configuration on this computer, so commands run in its folder may use it without --config

text
foliwake config trust [FILE] [flags]
bash
foliwake config trust
foliwake config trust ../my-site/foliwake.config.json

foliwake connect ​

Link this project folder to a site on your Foliwake server: a new one or an existing one

In a terminal: asks which server (signing in first when needed), then whether to create a new site (as foliwake site create, the folder name as its id) or link one you may develop (as foliwake site link). Without a terminal, or with --no-interactive: --create <id> or --link <id>. A folder linked already is refused; --force replaces its link, foliwake site unlink removes it.

text
foliwake connect [flags]
FlagDescription
--create <value>create this new site and link the folder to it
--forcereplace the link of a folder that is linked already
--interactiveask for what the flags leave open (default: only when stdin and stdout are a terminal)
--jsonFormat output as json.
--link <value>link the folder to this existing site
--server <value>the Foliwake server (origin or host; default: $FOLIWAKE_SERVER, else asked or the only one)
bash
foliwake connect
foliwake connect --create mysite --server https://foliwake.example
foliwake connect --link docs-en --json

foliwake create ​

Create a new site frontend: blocks, styles, local pages, checks and workflows

Runs create-foliwake (npm create foliwake): asks in a terminal only for what the flags leave open; without a terminal (or with --no-interactive) it uses the defaults: folder foliwake-site, template minimal, no site id, no React, no Storybook, Git repository with a first commit. The project is checked with @foliwake/site-check before anything is written. A non-empty folder is refused unless you choose --overwrite or --keep-existing; .git is never touched. At the end it can create or link the site on your Foliwake server (--create-site, --link-site, or a question).

text
foliwake create [FOLDER] [flags]
FlagDescription
--connect--no-connect: never ask «Connect to a Foliwake server?» (default: asked at the end in a terminal)
--create-siteat the end, create the site (id: --site, else the folder name) on your server, as site create
--gitcreate a Git repository (branch main) and commit the project with your Git identity (default: yes); skipped inside an existing repository
--helpShow CLI help.
--installinstall Storybook's npm packages; default: asked in a terminal after Storybook, else no
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--keep-existingthe folder is not empty: add the project next to its files (refused if one would be replaced)
--link-site <value>at the end, link the project to this existing site on your Foliwake server, as site link
--overwritethe folder is not empty: remove its files first (.git is kept)
--reactadd React support: React and ReactDOM vendored in scripts/vendor/ and the React example block poll; default: asked in a terminal, else no
--relinkwith --create-site or --link-site in a folder already linked elsewhere: replace that link
--server <value>the Foliwake server to connect to (origin, host, or cloud; default: $FOLIWAKE_SERVER, else asked in a terminal; without one, the only server you are signed in to — several are refused)
--site <value>the site id on your Foliwake server, if you know it (the README uses it); empty: none
--storybookadd Storybook for the blocks: .storybook/ and npm scripts; default: asked in a terminal, else no
--template <value>minimal: one page and one block (default); examples: two pages and three blocks, one with JavaScript
bash
foliwake create
foliwake create my-site
foliwake create my-site --template examples --site my-site --no-interactive
foliwake create my-site --react --storybook
foliwake create . --overwrite --no-git
foliwake create mytest --no-interactive --server http://localhost:8080 --create-site

foliwake credential list ​

Credentials the content sources use: set or not, from the environment or stored; never the value (core credentials.list)

text
foliwake credential list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>only the credentials this site's sources use (default: every site you administer)
bash
foliwake credential list
foliwake credential list --site my-site --json

foliwake credential rm ​

Removes a stored credential (the installation's owner); refused while a source uses it (core credentials.remove)

text
foliwake credential rm [NAME] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake credential rm OLD_DRIVE_KEY

foliwake credential set ​

Stores a credential value on the server (the installation's owner): a source names it in credentials; the next sync uses it without a restart. The value is read from a file or stdin, never from the command line (core credentials.set)

text
foliwake credential set [NAME] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--from-file <value>read the value from this file (a Google service-account JSON key is checked)
--from-stdinread the value from standard input
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake credential set FOLIWAKE_GOOGLE_SA_KEY --from-file key.json
printf %s "$TOKEN" | foliwake credential set FOLIWAKE_GIT_TOKEN_DOCS --from-stdin

foliwake data backup ​

Back up the data folder of foliwake server into one .tar.gz: consistent copies of its databases, its other files, no caches. It holds the server's secrets: keep it private (foliwake docker backup runs this)

text
foliwake data backup [flags]
FlagDescription
--data <value>the data folder (default: $FOLIWAKE_DATA_DIR, else /data)
--jsonFormat output as json.
--out <value>the archive to write (.tar.gz)
bash
foliwake data backup --data /data --out /backup/foliwake.tar.gz

foliwake data refresh-caches ​

Drop all cached HTML of every site of this server from its caches (Varnish, Cloudflare), as after an engine update; publishes nothing (foliwake docker update runs this)

text
foliwake data refresh-caches [flags]
FlagDescription
--data <value>the data folder (default: $FOLIWAKE_DATA_DIR, else /data)
--jsonFormat output as json.
bash
foliwake data refresh-caches --data /data

foliwake data restore ​

Restore a data backup archive into an empty data folder (or replace its data), the server stopped (foliwake docker restore runs this)

text
foliwake data restore [flags]
FlagDescription
--data <value>the data folder, empty (default: $FOLIWAKE_DATA_DIR, else /data)
--from <value>the archive data backup wrote
--jsonFormat output as json.
--replacedelete what the data folder holds first (cannot be undone)
bash
foliwake data restore --data /data --from /backup/foliwake.tar.gz

foliwake docker backup ​

Back up an instance's data volume to one .tar.gz on this computer: consistent copies of its databases, its other files, no caches. The server may keep running. The archive holds the server's secrets (0600).

text
foliwake docker backup [NAME] [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--out <value>the archive to write (default: ~/.config/foliwake/docker/<name>/backups/<name>-<time>.tar.gz)
bash
foliwake docker backup
foliwake docker backup staging --out ./staging.tar.gz

foliwake docker configure ​

Change settings of an instance, then recreate it (the data volume stays). Only the given flags change; other lines of its .env are kept. It has no storage flags yet: the storage of new sites follows FOLIWAKE_STORAGE_* of the instance at each start (the Docker guide says how).

text
foliwake docker configure [NAME] [flags]
FlagDescription
--bind <value>address the port is published on (127.0.0.1 or 0.0.0.0)
--cache <value>a Varnish in front of the live sites, on a port of its own (none: remove it)
--cache-port <value>with --cache varnish: its port (default: the first free one from 8090)
--domain <value>sites at <site>.live.<domain> and <site>.preview.<domain>
--image <value>the image (tag or digest)
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--jaeger-port <value>with --traces jaeger: the UI port on 127.0.0.1
--jaeger-store <value>with --traces jaeger: in memory (default) or on disk for a week
--otlp-endpoint <value>with --traces external: the OTLP/HTTP endpoint (headers from $OTEL_EXPORTER_OTLP_HEADERS or asked hidden)
--port <value>port on this computer (the public address follows when it was the default http://localhost:<port>)
--public-origin <value>where browsers and foliwake login reach the server
--trace-url-template <value>with traces to your own collector: its trace page with {traceId} (FOLIWAKE_TRACE_URL_TEMPLATE; "" removes it). With Jaeger the CLI sets it
--traces <value>traces: none, Jaeger beside the server, or your own OTLP collector
bash
foliwake docker configure --traces jaeger
foliwake docker configure --cache varnish --cache-port 8090
foliwake docker configure staging --port 8082
foliwake docker configure --traces external --otlp-endpoint https://otlp.example.com

foliwake docker exec ​

Run the foliwake CLI inside an instance's server container (it reads the container's settings): docker exec [name] -- <args>

text
foliwake docker exec [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
bash
foliwake docker exec -- account invite --email author@example.com
foliwake docker exec staging -- source plugins list

foliwake docker install ​

Install a Foliwake instance in Docker: questions, then pull, start, and the owner's sign-in link

An instance is a Compose project on the current Docker engine (docker context / DOCKER_HOST), found again by its dev.foliwake.* labels; no command looks at the current folder. In a terminal it asks for what the flags leave open; without one it uses the defaults and refuses where there is none (the owner e-mail at a first start). Its settings go to ~/.config/foliwake/docker/<name>/ (compose.yaml, and .env with mode 0600). Secrets are never flags: the S3 key is asked hidden, or read from FOLIWAKE_STORAGE_ACCESS_KEY_ID and FOLIWAKE_STORAGE_SECRET_ACCESS_KEY in this command's environment; OTLP headers likewise from OTEL_EXPORTER_OTLP_HEADERS. Needs Docker Compose 2.24 or later. A private image needs docker login ghcr.io first.

text
foliwake docker install [NAME] [flags]
FlagDescription
--bind <value>address the port is published on: 127.0.0.1 (this computer only, default) or 0.0.0.0 (everywhere; put HTTPS in front; FOLIWAKE_TRUST_PROXY is then not set)
--cache <value>a Varnish in front of the live sites, on a port of its own (default: none)
--cache-port <value>with --cache varnish: its port (default: the first free one from 8090)
--domain <value>sites at <site>.live.<domain> and <site>.preview.<domain> (default: the public origin's host)
--image <value>the image (default ghcr.io/foliwake/foliwake:main)
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--jaeger-port <value>with --traces jaeger: the UI port on 127.0.0.1 (default: the first free one from 16686)
--jaeger-store <value>with --traces jaeger: keep traces in memory (default) or on disk for a week
--openopen the owner's sign-in link in the browser (default: asked in a terminal, else no)
--otlp-endpoint <value>with --traces external: the OTLP/HTTP endpoint (headers from $OTEL_EXPORTER_OTLP_HEADERS or asked hidden)
--owner-email <value>the owner account made at the first start (no mail is sent); not needed when the data volume is reused
--port <value>port on this computer (default: the first free one from 8080; a taken port is refused, never swapped silently)
--public-origin <value>where browsers and foliwake login reach the server (default: http://localhost:<port>)
--pull <value>always (default): pull the image, a failed pull stops the install; missing: use the image if it is on this engine already (a local build), pull only otherwise
--storage <value>where sites are kept: the data volume (default) or S3-compatible storage; fixed at the first start
--storage-bucket <value>with --storage s3: the bucket name of each site (default foliwake-{org}-{site})
--storage-create-bucketswith --storage s3: the key may create buckets (default yes)
--storage-endpoint <value>with --storage s3: the S3 endpoint (https://…)
--storage-region <value>with --storage s3: the region (default us-east-1; auto on R2)
--trace-url-template <value>with --traces external: your collector's trace page with {traceId} (FOLIWAKE_TRACE_URL_TEMPLATE), for links from the dashboard and operation get
--traces <value>traces: none (default), Jaeger beside the server (UI on 127.0.0.1), or your own OTLP collector
--yesdo not ask «Install?» at the end of the questions
bash
foliwake docker install
foliwake docker install staging --port 8081 --owner-email you@example.com --no-interactive
foliwake docker install --traces jaeger --jaeger-store badger
foliwake docker install --cache varnish
FOLIWAKE_STORAGE_ACCESS_KEY_ID=… FOLIWAKE_STORAGE_SECRET_ACCESS_KEY=… foliwake docker install prod --public-origin https://foliwake.example.com --domain example.com --owner-email you@example.com --storage s3 --storage-endpoint https://s3.example.com --no-interactive

A new one-time sign-in link (15 minutes) for the owner or another account of an instance

text
foliwake docker link [NAME] [flags]
FlagDescription
--email <value>the account's e-mail address (default: the owner of the instance)
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
bash
foliwake docker link
foliwake docker link staging --email author@example.com

foliwake docker list ​

Foliwake instances on this Docker engine, found by their labels (removed ones whose data was kept: "data only")

text
foliwake docker list [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--jsonFormat output as json.
bash
foliwake docker list
foliwake docker list --json

foliwake docker logs ​

The log of an instance's server (or its Jaeger); it holds one-time sign-in links, so keep it private

text
foliwake docker logs [NAME] [flags]
FlagDescription
--followkeep printing new lines
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--service <value>which service (default foliwake)
--since <value>only lines since a time or duration (e.g. 10m, 2026-11-13T10:00:00)
--tail <value>only the last N lines
bash
foliwake docker logs
foliwake docker logs staging -f --since 10m
foliwake docker logs --service jaeger

foliwake docker remove ​

Stop and remove an instance's containers and network, and its settings on this computer. The data volume is kept unless --delete-data (then the name is typed to confirm, or --yes without a terminal). A kept volume shows in docker list as "data only"; docker install <name> offers to reuse it.

text
foliwake docker remove [NAME] [flags]
FlagDescription
--delete-dataalso delete its volumes: sites, accounts, storage (cannot be undone)
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--yesdo not ask; required without a terminal
bash
foliwake docker remove staging
foliwake docker remove staging --yes
foliwake docker remove staging --delete-data --yes

foliwake docker restart ​

Restart the containers of an instance

text
foliwake docker restart [NAME] [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
bash
foliwake docker restart
foliwake docker restart staging

foliwake docker restore ​

Restore a docker backup archive into an instance's data volume. The instance must be stopped. An empty volume takes it as it is; one with data needs --replace (its data is deleted first: the name is typed to confirm, or --yes without a terminal).

text
foliwake docker restore [NAME] [flags]
FlagDescription
--from <value>the archive docker backup wrote
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--replacedelete the data the volume holds first (cannot be undone)
--yesdo not ask before --replace; required without a terminal
bash
foliwake docker restore staging --from ./staging.tar.gz
foliwake docker restore staging --from ./staging.tar.gz --replace --yes

foliwake docker start ​

Start the containers of a stopped instance

text
foliwake docker start [NAME] [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
bash
foliwake docker start
foliwake docker start staging

foliwake docker status ​

State, health, image, ports, address, traces and data of an instance; secrets only as "set"

text
foliwake docker status [NAME] [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--jsonFormat output as json.
bash
foliwake docker status
foliwake docker status staging --json

foliwake docker stop ​

Stop the containers of an instance (data and settings stay)

text
foliwake docker stop [NAME] [flags]
FlagDescription
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
bash
foliwake docker stop
foliwake docker stop staging

foliwake docker update ​

Pull the instance's image; when it changed, back up the data volume (docker backup), recreate the server and drop every site's cached HTML. The data volume stays. Prints the command that rolls back. Needs the instance's settings on this computer (~/.config/foliwake/docker/<name>/).

text
foliwake docker update [NAME] [flags]
FlagDescription
--backupback up the data volume before the switch (default; --no-backup skips it)
--image <value>pin another image (tag, digest, or the id of a local build), kept in the settings
--interactiveask for missing values (default: only when stdin and stdout are a terminal)
--pull <value>always (default): pull, a failed pull stops the update; missing: use the image if it is on this engine already (e.g. the id of a local build to roll back to)
bash
foliwake docker update
foliwake docker update staging --image ghcr.io/foliwake/foliwake:sha-1a2b3c4
foliwake docker update --image sha256:3f1a… --pull missing

foliwake drive check ​

Check one Google Docs lesson as a sync would; with a saved snapshot, show what changed

Reads one Google Docs document (--doc, with your OAuth client as the other drive commands; or --input, a documents.get JSON saved elsewhere) and checks it the way a sync's Google Drive reader does: the same reader code (@foliwake/google-drive-markdown), the site's blocks from --code, then the page pipeline, the Markdown compiled unchanged through the mapping a sync gives it. Every diagnostic is printed as a sync names it, code and message; any error rejects the whole sync, and the exit status is then 1. What it cannot check is printed as "not checked": the source's credentials (a sync refuses a page whose text holds one) and, without --images, the images (each gets stand-in bytes; --images downloads them as a sync does, with its host, type and size checks). With --mappings and --source-path the page gets the source's rule values (path, fields), and an ignore rule skips it; without them it gets a stand-in path and no fields, so a rule's values and a page's required fields are not checked. The page is compiled alone: links to other pages, path conflicts and ownership are not checked. As in a sync's listing, a document with a hidden name on its path (one that starts with ".") is skipped, and the Drive path, with the source's subfolder (--subfolder, else "settings.subfolder" of a source in --mappings) before it, may be at most 1000 characters. --save <file> writes the document as a snapshot (every temporary image URL removed): the «before» of an edit. --diff-against <file> checks that snapshot too and prints a unified line diff of the lesson Markdown, before → now, each hunk headed by its slide and block (images named by their Docs object ID), and what changed in the compiled page (title, description, fields, body), when both versions compile without errors. --doc uses FOLIWAKE_GOOGLE_OAUTH_CLIENT_ID and FOLIWAKE_GOOGLE_OAUTH_CLIENT_SECRET (scope drive.file: only documents your OAuth client created, such as those drive to-docs uploaded), after a consent in the browser. Exit status 1 when an error was found, 2 for a wrong command line.

text
foliwake drive check [flags]
FlagDescription
--code <value>the site's code folder (the one with components/)
--diff-against <value>a snapshot (--save) to compare with: prints the line diff
--doc <value>the document to read now (its Drive file ID)
--helpShow CLI help.
--imagesdownload the document's images now and check them as a sync does
--input <value>check a documents.get JSON (or a --save snapshot) from this file instead of reading Drive
--jsonprint the result as JSON
--mappings <value>a JSON file with the source's mappings rules (a list, or the source)
--save <value>write the document read as a snapshot to this file (the «before»)
--site-url <value>the site's address: a link to it is kept as a root path, as in sync
--source-id <value>the source's ID in messages (default: the "id" of a source object in --mappings)
--source-path <value>the document's path in the source folder, as a sync shows it ("Georgia/topic/lesson/ru")
--subfolder <value>the source's subfolder (default: "settings.subfolder" of a source object in --mappings)
bash
foliwake drive check --doc <document ID> --code ../site/build
foliwake drive check --doc <document ID> --code ../site/build --save before.json
foliwake drive check --doc <document ID> --code ../site/build --diff-against before.json
foliwake drive check --input now.json --code ../site/build --diff-against before.json --json

foliwake drive stamp-ids ​

Make the {#id} of Google Docs lessons invisible (named ranges), checked to keep each page the same

For each Google Docs lesson that drive to-docs uploaded before the IDs became invisible (2026-11-20): every {#id} it shows — at the end of a slide heading, in the ID cell of an answer row — becomes a named range on that heading or answer (the reader takes the ID from it), the visible text is deleted, and the emptied ID column of each block form is deleted (--keep-id-column: left empty). Each document is first changed on a copy and compiled with the site's blocks from --code: when its page would change, nothing is written and the run stops. Without --apply nothing is written at all (a dry run): each document's counts are printed. With --apply each document is changed by one batchUpdate at the revision just read (a document someone edited meanwhile is refused and left as it is; run again), then read back and compiled again. The documents: those a to-docs manifest records as done (--manifest), every document under a Drive folder (--folder), or one (--doc). Your OAuth client must be the one the documents were uploaded with (FOLIWAKE_GOOGLE_OAUTH_CLIENT_ID, FOLIWAKE_GOOGLE_OAUTH_CLIENT_SECRET; scope drive.file: the tool reaches only the files it created). A rerun is safe: a document without visible IDs has nothing to do. Run --apply only once the server reads invisible IDs (the engine with the Google Docs reader of 2026-11-20): an older reader gives such slides Google's heading IDs. Exit status 1 when a page would change or changed, or a document could not be read or changed.

text
foliwake drive stamp-ids [flags]
FlagDescription
--applywrite the changes (without it: a dry run)
--code <value>the site's code folder (the one with components/)
--doc <value>one document (its Drive file ID)
--folder <value>every Google Docs document under this Drive folder ID (subfolders too)
--helpShow CLI help.
--keep-id-columnempty the ID cells of answer rows but keep the column
--manifest <value>the manifest of a drive to-docs --tree … --upload run: its done documents
bash
foliwake drive stamp-ids --doc <document ID> --code ../site/build
foliwake drive stamp-ids --manifest ./to-docs/manifest.json --code ../site/build
foliwake drive stamp-ids --manifest ./to-docs/manifest.json --code ../site/build --apply

foliwake drive strip-ids ​

Remove the visible {#id} of Google Docs lessons; slides get the slug of their heading, checked

For each Google Docs lesson that drive to-docs uploaded before 2026-11-20: the {#id} at the end of every slide heading and the ID column of every block form are deleted (a form that holds a picture keeps the column, emptied and narrowed: deleting it would make Google re-create the picture). A slide then gets the slug of its heading text as its ID (like Adobe EDS: «Рука поднята» → ruka-podnyata), so links to its old ID stop working; each change is listed old → new. An answer whose text or place would not give it the same ID (answer IDs carry meaning) keeps it, typed at the end of its text: Налево {#left}. Each document is first changed on a copy and compiled with the site's blocks from --code: when its page would change in anything but those slide IDs, nothing is written and the run stops. Without --apply nothing is written at all (a dry run). With --apply the same requests first run on a Drive copy of the document (in a folder "Foliwake strip-ids checks (safe to delete)" in My Drive; the copy is deleted afterwards), which is read back and checked: when Google changed the copy's page otherwise than expected, the document is not written and the run stops, naming the first line that changed and a diagnostic file (strip-ids-diagnostics/<document ID>-<time>.json beside the ledger: the requests sent and the element that differs, as Google and as the local check have it; document content only). Then each document is changed by one batchUpdate at the revision just read (a document someone edited meanwhile is refused and left as it is; run again), then read back and compiled again, and recorded in the ledger (--ledger), so a rerun skips it and never deletes an {#id} an author types later. The documents: those a to-docs manifest records as done (--manifest), every document under a Drive folder (--folder), or one (--doc). Your OAuth client must be the one the documents were uploaded with (FOLIWAKE_GOOGLE_OAUTH_CLIENT_ID, FOLIWAKE_GOOGLE_OAUTH_CLIENT_SECRET; scope drive.file). Run --apply only once the server reads slugs (the Google Docs reader of 2026-11-21): an older one gives such slides Google's heading IDs. Exit status 1 when a page would change or changed, or a document could not be read or changed.

text
foliwake drive strip-ids [flags]
FlagDescription
--applywrite the changes (without it: a dry run)
--code <value>the site's code folder (the one with components/)
--doc <value>one document (its Drive file ID)
--folder <value>every Google Docs document under this Drive folder ID (subfolders too)
--helpShow CLI help.
--ledger <value>the file that records the stripped documents (default: strip-ids.json beside --manifest, else in the current folder)
--manifest <value>the manifest of a drive to-docs --tree … --upload run: its done documents
bash
foliwake drive strip-ids --doc <document ID> --code ../site/build
foliwake drive strip-ids --manifest ./to-docs/manifest.json --code ../site/build
foliwake drive strip-ids --manifest ./to-docs/manifest.json --code ../site/build --apply

foliwake drive to-docs ​

Move a Markdown lesson of a Drive folder to a Google Docs document (same page), checked first

Writes the lesson in the block-table convention of Google Docs lessons and checks that the document compiles to the same page (body, title, description) as the Markdown file, with the site's blocks from --code. Without --upload nothing leaves this computer: the Word file is written to --out for inspection (a dry run). --upload --folder <ID> uploads it into the lesson's Drive folder as a Google Docs document named like the file ("ru"), with your OAuth client (FOLIWAKE_GOOGLE_OAUTH_CLIENT_ID, FOLIWAKE_GOOGLE_OAUTH_CLIENT_SECRET; a "Desktop app" client; scope drive.file: the tool sees only the files it creates), reads it back and checks it again. --tree <dir> moves every page of a folder in one language (--lang) into a NEW Drive folder tree: the files the source's rules (--mappings) publish in that language are written as Word files under --out, mirroring the folders, and checked; with --upload --to <ID of the new root> the folders are mirrored there (a folder named like --tree, then the same folder names) and each document is uploaded, read back and checked again. A manifest (--manifest, default <out>/manifest.json) records each lesson, so a rerun skips what is done and retries the rest. The source tree is never changed; there is no --commit in this mode. --path-prefix /v2 makes the new tree a second source beside the old one: its rules put every page under /v2, and <out>/<source-id>.source.json and .mappings.json are written with the commands that add it (the old source and its pages stay as they are). --commit --archive <dir> then moves the Markdown file out of the source folder, so the next sync lets the document take over the page (SOURCE_PAGE_REPLACED: same page ID, address and history). A slide's ID is the slug of its heading text in the document (a heading whose ID changes is only noted); an answer whose text or place would not give it its ID gets it typed at the end of its text ({#left}); --stamp-ids writes no ID and keeps the lesson's IDs as invisible named ranges instead, as before 2026-11-21. Every difference is listed; pictures Google re-encoded are compared by their pixels (the same picture is a note, not a difference; --save-images <dir> writes the document's pictures to look at). A difference stops the run unless --accept-diff. Exit status 1 when the lesson cannot move or the pages differ.

text
foliwake drive to-docs [flags]
FlagDescription
--accept-diffgo on although the pages differ (the differences are listed)
--archive <value>with --commit: a folder outside the source folder for the Markdown file
--code <value>the site's code folder (the one with components/)
--commitafter a passed check, move the Markdown file to --archive
--doc <value>check a document this tool uploaded before (its Drive file ID) instead of uploading again
--file <value>the Markdown lesson in the local Drive folder (…/lesson/ru.md)
--folder <value>with --upload: the Drive folder ID of the lesson's lesson/ folder
--helpShow CLI help.
--include <value>with --tree: the kinds that move, comma-separated (the rules' "kind"; a page without one is "lesson"); default: all
--lang <value>with --tree: the language whose pages move (the rules' "lang" value)
--manifest <value>with --tree --upload: the manifest file (default: <out>/manifest.json)
--mappings <value>with --tree: a JSON file with the source's mappings rules (a list, or the source object)
--out <value>where the Word file is written (default: ./<name>.docx); with --tree, the folder for the Word files (default: ./to-docs)
--path-prefix <value>with --tree: the new tree is a second source with every page path under this prefix (e.g. /v2); its source and rules are written to --out
--save-images <value>with --upload or --doc: write the document's pictures, as Google serves them, to this folder
--site-url <value>the site's address (e.g. https://lessons.example.org): a link to a page of the site (/lessons/x) is written under it and read back as /lessons/x
--source-id <value>with --path-prefix: the second source's ID (default: lessons-docs)
--stamp-idskeep the lesson's slide and answer IDs as invisible named ranges (default: slides get the slug of their heading, answers that need it a typed {#id})
--subfolder <value>with --tree --upload: the folder created under --to that mirrors --tree (default: the name of --tree; "" for --to itself)
--to <value>with --tree --upload: the Drive folder ID of the new root
--tree <value>every page of this local Drive folder (the source's folder, e.g. …/Lessons/Georgia) in --lang
--uploadupload the Word file as a Google Docs document and check the real document
bash
foliwake drive to-docs --file "<Drive>/Lessons/<topic>/<lesson>/lesson/ru.md" --code ../site/build
foliwake drive to-docs --file …/lesson/ru.md --code ../site/build --upload --folder <lesson/ folder ID>
foliwake drive to-docs --file …/lesson/ru.md --code ../site/build --doc <document ID> --commit --archive "<Drive>/Lessons/archive/<lesson>/lesson"
foliwake drive to-docs --tree "<Drive>/Lessons/Georgia" --mappings rules.json --code ../site/build --lang ru --out ./to-docs --path-prefix /v2 --site-url https://lessons.example.org
foliwake drive to-docs --tree "<Drive>/Lessons/Georgia" --mappings rules.json --code ../site/build --lang ru --out ./to-docs --path-prefix /v2 --site-url https://lessons.example.org --upload --to <new root folder ID>

foliwake login ​

Sign this computer in to a Foliwake server through the browser (device code)

text
foliwake login [SERVER] [flags]
FlagDescription
--browseropen the approval page in the browser (--no-browser only prints its address)
--defaultmake this server the default of other commands (the first sign-in always is)
--insecure-storagekeep the token in a 0600 file when there is no system keychain
--jsonFormat output as json.
bash
foliwake login https://foliwake.example
foliwake login http://localhost:8080 --default
foliwake login 127.0.0.1:8098 --no-browser

foliwake logout ​

Revoke this computer’s sign-in to a Foliwake server and forget its token

text
foliwake logout [SERVER] [flags]
FlagDescription
--forget-onlyforget the token here even when the server cannot revoke it (it then stays valid there until it expires)
--jsonFormat output as json.
bash
foliwake logout
foliwake logout https://foliwake.example
foliwake logout cloud

foliwake migration commit ​

Release the reviewed preview of new code: code and pages go live as one site release (core migration.commit)

text
foliwake migration commit [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the reviewed preview and its code, sr_…@cd_… (site status prints them)
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--sequence <value>deployment ordering, e.g. a CI run id; an older one than live code is refused
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake migration commit --expect sr_…@cd_…
foliwake migration commit --expect sr_…@cd_… --sequence <ci run id> --json

foliwake migration prepare ​

Rebuild every live page against prepared code as the preview; live is unchanged (core migration.prepare)

text
foliwake migration prepare [CODE] [flags]
FlagDescription
--add <value>pages that are not live and join the site with it (comma-separated IDs)
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--remove <value>live pages that leave the site with it (comma-separated IDs)
--rev <value>the commit the code was prepared from, recorded with the preview
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake migration prepare cd_…
foliwake migration prepare cd_… --rev <sha> --json
foliwake migration prepare cd_… --remove old-page --add new-page

foliwake operation cancel ​

Ask a long operation to stop: a queued one stops at once, a running one when it can (core operations.cancel)

text
foliwake operation cancel [ID] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake operation cancel co_…

foliwake operation get ​

One long operation: its state, stage, delivery and result (core operations.get)

text
foliwake operation get [ID] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake operation get co_… --json

foliwake operation list ​

The latest long operations of a site, newest first (core operations.list)

text
foliwake operation list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--limit <value>how many (default 50)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake operation list
foliwake operation list --limit 5 --json

foliwake operation recover ​

Find out what happened to interrupted operations, finish the engine’s interrupted work and pending cache refreshes; never runs an operation again (core operations.recover)

text
foliwake operation recover [flags]
FlagDescription
--break-lockfirst remove a state lock left by a process that is gone (for example on another host name)
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--timingsreport phase timings, request counts and transferred bytes on stderr (one JSON line with --json); also FOLIWAKE_TIMINGS=1 or FOLIWAKE_TIMINGS_FILE=<file>
--waitalso wait (bounded) for pending cache refreshes; those still pending then stay recorded and the exit status is 3
--wait-timeout <value>limit of --wait in seconds (default: settle delay + 90 s)
bash
foliwake operation recover --wait
foliwake operation recover --break-lock --wait   # only when the process named by STATE_LOCKED is gone

foliwake page changes ​

Compare working pages (text and images) with the live site (core content.changes)

text
foliwake page changes [flags]
FlagDescription
--changedlist only pages that differ from the live site
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake page changes
foliwake page changes --changed --json

foliwake page check ​

Validate all pages and components/components.json (core content.validate)

text
foliwake page check [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake page check
foliwake page check --site a --content ./sample-content

foliwake page replace ​

Let another item of its source feed a published page (e.g. a Drive file deleted and uploaded again): the page keeps its ID, address, live version and history. Shows the plan and asks first; preview and live are unchanged until the next sync and preview/publish (core sources.replacePage)

text
foliwake page replace [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--path <value>the path of the page that is live or in preview
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--with <value>the native ID of the source item that should feed it (a Drive file ID; source sync --json lists the items' native_id)
--yesapply the plan without asking (required when not in a terminal)
bash
foliwake page replace --path /lessons/signs/ru --with 1AbCdEfGhIjK
foliwake page replace --site my-site --path /lessons/signs/ru --with 1AbCdEfGhIjK --yes

foliwake page unpreview ​

Remove a page from the preview, live untouched: a page that is not live leaves the preview, a live page shows its live version there again. Refused when the preview is not the one you expected (core channels.unpreview)

text
foliwake page unpreview [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the preview site release you saw (sr_…, as site status shows it); refused when the preview is another one
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-previewexpect the preview as it is now (read once, before the request)
--path <value>the path of the page in the preview
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake page unpreview --path /lessons/signs/ru --expect sr_…   # the preview release `site status` shows
foliwake page unpreview --path /old-draft --latest-preview

foliwake page unpublish ​

Remove pages from the live site; refused when live is not the release you expected (core channels.unpublish)

text
foliwake page unpublish [PAGES] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the live site release you saw (sr_…, as site status shows it); refused when live is another one
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-liveexpect the live release as it is now (read once, before the request)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake page unpublish help --expect sr_…   # the live release `site status` shows
foliwake page unpublish old-page other --latest-live

foliwake preview ​

Save drafts to the protected preview (default: all valid pages)

Not on core yet: it calls the engine directly until it moves onto core (channels.preview).

text
foliwake preview [flags]
FlagDescription
--code <value>an already prepared code release to compile against instead of live code
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--debugprint the underlying error, paths included, on stderr
--jsonmachine-readable output
--site <value>site id from the project configuration (required when it lists several sites)
--syncfirst sync the named pages from their sources (only their files are read again; other changed files are read too, unchanged ones kept), then preview only them
--timingsreport phase timings, request counts and transferred bytes on stderr (one JSON line with --json; never URLs, keys or content); also FOLIWAKE_TIMINGS=1 or FOLIWAKE_TIMINGS_FILE=<file>
--use-selected <source-id,…>publish/preview the previously accepted snapshot of these sources although their latest sync was not accepted
--verbosealso print codes and the engine's technical text of each problem (for support)
bash
foliwake preview
foliwake preview help
foliwake preview --code cd_…   # compile against prepared code
foliwake preview lesson-1 --sync   # sync and preview this page only

foliwake project preview ​

Preview this project's pages on its site's server (a folder linked with site create / site link)

Sends the pages and images of content/ (committed or not) and the code of the last commit (components/, scripts/ and styles/ must be committed) to the site this folder is linked to, rebuilds the site's preview there and prints its address. In a linked folder, foliwake preview runs this command. Remembers the preview in .foliwake/last-preview.json.

text
foliwake project preview [flags]
FlagDescription
--jsonFormat output as json.
bash
foliwake preview
foliwake project preview --json

foliwake project publish ​

Publish the pages your last preview changed (or the pages of the given files and folders) to live

In a folder linked to a site: with no paths, the pages the last foliwake preview of this folder changed, refused when the preview changed since; with paths (files or folders under content/), their pages. Lists them and asks in a terminal; --yes for scripts. --expect sr_… publishes a preview you reviewed elsewhere. In a linked folder, foliwake publish runs this command.

text
foliwake project publish [PATHS] [flags]
FlagDescription
--expect <value>the preview release you reviewed (sr_…); default: the one the last foliwake preview here made
--jsonFormat output as json.
--yesdo not ask (scripts)
bash
foliwake publish
foliwake publish content/index.md
foliwake publish content/lessons/ --yes

foliwake project unpublish ​

Take the pages of the given files and folders off live

In a folder linked to a site: the pages of the given files or folders under content/ go off live, if live is still the release read just before (or --expect). Lists them and asks in a terminal; --yes for scripts.

text
foliwake project unpublish [PATHS] [flags]
FlagDescription
--expect <value>the live release you saw (sr_…); default: live as it is now
--jsonFormat output as json.
--yesdo not ask (scripts)
bash
foliwake project unpublish content/old.md

foliwake publish ​

Publish selected pages to the live site

Not on core yet: it calls the engine directly until it moves onto core (channels.publish).

text
foliwake publish [PAGES] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--debugprint the underlying error, paths included, on stderr
--expect <preview-release>publish only if the reviewed preview (its sr_… release ID, printed by preview and site status; on a branch host, the X-Publish-Expect value sr_…@cd_…), its source snapshots and the live code are unchanged and are the pair you saw; required on sites with snapshot sources
--jsonmachine-readable output
--site <value>site id from the project configuration (required when it lists several sites)
--timingsreport phase timings, request counts and transferred bytes on stderr (one JSON line with --json; never URLs, keys or content); also FOLIWAKE_TIMINGS=1 or FOLIWAKE_TIMINGS_FILE=<file>
--use-selected <source-id,…>publish/preview the previously accepted snapshot of these sources although their latest sync was not accepted
--verbosealso print codes and the engine's technical text of each problem (for support)
--waitwait (bounded, see --wait-timeout) for the cache refresh; if it is still pending then, that is reported: exit 0 once the change is committed (only this operation's refresh is awaited); the pending refreshes stay recorded for operation recover
--wait-timeout <seconds>limit of --wait in seconds (default: settle delay + 30 s)
bash
foliwake publish help
foliwake publish home questions --wait
foliwake publish help --expect sr_0123456789abcdef0123456789abcdef

foliwake release rollback ​

Make an earlier site release live again, code and pages as they were, as a new release; refused when live is not the release you expected (core channels.rollback)

text
foliwake release rollback [TO] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the live site release you saw (sr_…, as site status shows it); refused when live is another one
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--latest-liveexpect the live release as it is now (read once, before the request)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--wait-timeout <value>limit of the wait for this write's cache refresh, in seconds (default: settle delay + 30 s); still pending then: exit 3, operation recover finishes it
bash
foliwake release rollback sr_… --expect sr_…
foliwake site status --json   # codeRollout.rollbackTo is one step back
foliwake release rollback sr_… --latest-live

foliwake servers ​

List the Foliwake servers this computer is signed in to; * marks the default

text
foliwake servers [flags]
FlagDescription
--jsonFormat output as json.
bash
foliwake servers
foliwake servers --json

foliwake servers use ​

Make a signed-in server the default of commands that name no server

text
foliwake servers use [SERVER] [flags]
FlagDescription
--jsonFormat output as json.
bash
foliwake servers use https://foliwake.example

foliwake site adopt ​

Bind an existing bucket and its state to a configured site; publishes nothing (core sites.adopt)

text
foliwake site adopt [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site adopt --config foliwake.config.json --site my-site

foliwake site create ​

Create this project's site on your Foliwake server (core sites.create; admin)

In a project folder (as foliwake create makes it), signed in with foliwake login to any Foliwake server: creates the site in your organisation (you must be its admin), with release 1 from the folder's last commit (its code and pages, sent as a Git bundle), links the folder to it and prints what to set up next (GitHub, workflows, content sources). Nothing on GitHub is changed. To use a site that exists already: foliwake site link <id>.

text
foliwake site create [ID] [flags]
FlagDescription
--codesend the last commit for release 1 (--no-code: release 1 waits for the first code prepare)
--jsonFormat output as json.
--org <value>the organisation (default: your only one where you are admin)
--relinkreplace the link of this folder (.foliwake/connection.json) to another server or site without asking
--repository <value>where the code will live, e.g. https://github.com/acme/mytest (the server checkout's origin)
--server <value>the Foliwake server (origin, host, or cloud for Foliwake Cloud; default: $FOLIWAKE_SERVER, else the only server you are signed in to; several: asked in a terminal, refused without one)
bash
foliwake site create mytest
foliwake site create mytest --repository https://github.com/acme/mytest
foliwake site create mytest --server foliwake.example --no-code

foliwake site edit ​

Edit a stored site's settings in $VISUAL or $EDITOR; saved only if nobody changed the site meanwhile (core sites.update)

text
foliwake site edit [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the revision you saw (site show); default: the one opened in the editor
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site edit --site my-site

foliwake site history ​

Who changed a stored site's settings, when, and which settings (core sites.history)

text
foliwake site history [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--limit <value>how many changes, newest first (default 20)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site history --site my-site
foliwake site history --site my-site --limit 50 --json

Link this project folder to an existing site on your Foliwake server (developer or admin)

Signed in with foliwake login to any Foliwake server: checks that the site exists and that you are a developer or admin of its organisation, and writes .foliwake/connection.json in this folder. Nothing changes on the server. A second developer who cloned the repository only links.

text
foliwake site link [ID] [flags]
FlagDescription
--jsonFormat output as json.
--relinkreplace the link of this folder (.foliwake/connection.json) to another server or site without asking
--server <value>the Foliwake server (origin, host, or cloud for Foliwake Cloud; default: $FOLIWAKE_SERVER, else the only server you are signed in to; several: asked in a terminal, refused without one)
bash
foliwake site link mytest
foliwake site link mytest --server foliwake.example

foliwake site list ​

Configured sites with hosts, repositories and bindings (core sites.list)

text
foliwake site list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake site list --config foliwake.config.json
foliwake site list --json

foliwake site reset-storage ​

Recreate a site's storage in one action: archive its state, delete its objects in its own bucket, bind both again, prepare its code (release 1) and sync its sources. Publishes nothing: live is EMPTY (no pages) until you publish again. Prints the plan first and asks for the site id (the installation's owner only; core sites.resetStorage)

text
foliwake site reset-storage [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--confirm <value>the site id, typed again: confirms the reset without a question (needed without a terminal)
--debugprint the underlying error on stderr
--dry-runprint the plan (what is lost, what is done) and change nothing
--jsonFormat output as json.
--rev <value>the commit to prepare again (default: the commit live code came from, else HEAD)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site reset-storage --site my-site --dry-run
foliwake site reset-storage --site my-site
foliwake site reset-storage --site my-site --confirm my-site --json

foliwake site set ​

Change one setting of a stored site, only if nobody changed the site since it was read (core sites.update)

text
foliwake site set [PATH] [VALUE] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--expect <value>the revision you saw (site show); default: the one read just before the change
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--unsetremove the setting instead of setting it
bash
foliwake site set --site my-site media.resize engine
foliwake site set --site my-site branchHostDomain preview.foliwake.example --expect 3
foliwake site set --site my-site liveAliases --unset

foliwake site show ​

A site's stored settings and their revision, on a server that keeps its sites in a database (core sites.get)

text
foliwake site show [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site show --site my-site
foliwake site show --site my-site --json

foliwake site status ​

Live, preview, code and pending work at a glance (core sites.status)

text
foliwake site status [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake site status
foliwake site status --site my-site --json

Remove this project folder's link to its site (.foliwake/connection.json); the server is not changed

Removes .foliwake/connection.json from this folder, so foliwake preview and publish no longer go to that site. Nothing is sent to the server: the site, its releases and its pages stay there. Prints the server and site it unlinked. A folder that is not linked is not an error: it says so and exits 0. A connection file this version cannot read is left as it is unless --force. To move a project to another server: foliwake site unlink, then foliwake site create <id> --server <server> (or site link <id> --server <server>).

text
foliwake site unlink [flags]
FlagDescription
--forcealso remove a .foliwake/connection.json this version cannot read
--jsonFormat output as json.
bash
foliwake site unlink
foliwake site unlink --json
foliwake site unlink --force

foliwake source add ​

Adds a content source to a site: checks it first (settings, credentials, connection, files and their addresses), then saves it after a confirmation; nothing is fetched (core sources.probe, sources.add)

text
foliwake source add [flags]
FlagDescription
--base-url <value>Drupal: the site address
--basic-password <value>Drupal: the credential name of its password
--basic-user <value>Drupal: the credential name of a read-only user name (HTTP Basic)
--branch <value>Git: the branch (default main)
--check-onlycheck and print, save nothing
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--display-name <value>the name the dashboard shows
--folder <value>Google Drive: the folder link or ID
--id <value>the new source id (lower case, digits, "-")
--identity <value>Google Drive: file-id (default; renames keep the page) or front-matter
--jsonFormat output as json.
--key <value>Google Drive: the credential name of the service-account key (default FOLIWAKE_GOOGLE_SA_KEY)
--language <value>Drupal: a language code, the default first (repeatable)
--mappings <value>a JSON file with path mapping rules (default: each file names its address)
--owns <value>a path the source owns, such as /lessons or "=/" (repeatable)
--plugin <value>the connector
--repository <value>Git: the https address of the repository
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--subfolder <value>Google Drive or Git: the folder inside that holds the pages
--token <value>Git: the credential name of a read-only token (private repository)
--yessave without asking (scripts)
bash
foliwake source add --site my-site --id lessons --owns /lessons --folder https://drive.google.com/drive/folders/1AbC…
foliwake source add --site docs --plugin git-markdown --id docs --owns /docs --repository https://github.com/acme/docs
foliwake source add --site news --plugin drupal --id news --owns /articles --base-url https://cms.example.org --language en

foliwake source adopt-pages ​

Let a source take over published pages that no source owns yet (published by an earlier configuration: one folder), at paths it owns; preview and live are unchanged (core sources.adoptPages)

text
foliwake source adopt-pages [SOURCE] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake source adopt-pages git
foliwake source adopt-pages git --site a --json

foliwake source check ​

Checks content sources without changing anything: settings, credentials, the connection and, with --listing, the files and the page addresses they would get (core sources.probe)

text
foliwake source check [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--listingalso list the files and their page addresses (slower: reads the whole source)
--max <value>at most this many files in the listing (default 500)
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--source <value>one source of the site (default: every enabled source)
bash
foliwake source check --site my-site
foliwake source check --site my-site --source lessons --listing
foliwake source check --site my-site --input '{"site":"my-site","candidate":{…}}'

foliwake source gc ​

Remove local source snapshots nothing needs any more, and the bytes only they held (a dry run unless --apply)

Keeps, per source: the selected snapshot, every snapshot a preview or publication (or its history) names, the last 3 used ones and those used in the last 7 days. The same runs after every accepted sync. Never touches the store.

text
foliwake source gc [flags]
FlagDescription
--applyremove them (default: only list what would be removed)
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error, paths included, on stderr
--jsonFormat output as json.
--site <value>site id from the project configuration (required when it lists several sites)
bash
foliwake source gc
foliwake source gc --apply

foliwake source list ​

The site's content sources: plugin, owned paths and selected snapshot (core sources.list)

text
foliwake source list [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
bash
foliwake source list
foliwake source list --site a --json

foliwake source mappings check ​

Dry run of a source's path mappings over the documents it already has (the selected snapshot, or a working folder's files): each document's page path now and with the rules, unmatched files and problems; reads no upstream and changes nothing (core sources.mappingsCheck)

text
foliwake source mappings check [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--file <value>check the rules in this JSON file (a list of rules) instead of the configured ones; needs --source
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--source <value>only this source (default: every source with path mappings)
bash
foliwake source mappings check
foliwake source mappings check --site my-site --source docs-en
foliwake source mappings check --source docs-en --file mappings.json

foliwake source pending ​

Edits waiting in the content sources that the selected snapshots do not have: a read-only check, nothing is fetched into a snapshot or stored (core sources.pending)

text
foliwake source pending [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--source <value>content source id of the site (see source list; default: every source)
bash
foliwake source pending
foliwake source pending --source lessons --json

foliwake source plugins ​

Registered content-source plugins, their versions and the planned catalog (core sources.plugins)

text
foliwake source plugins [flags]
FlagDescription
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake source plugins
foliwake source plugins --debug   # why a plugin failed, on stderr

foliwake source sync ​

Read content sources into private snapshots and select them; preview and live are unchanged (core sources.sync)

text
foliwake source sync [flags]
FlagDescription
--code <value>the prepared code of a migration: read and check the sources against it instead of live code
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error on stderr
--fullread every item of the source again (no incremental sync: unchanged items are not kept from the selected snapshot)
--input <value>raw JSON for the full operation input; overrides the other input flags
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
--site <value>site id (default: the site this folder is linked to, else the only site of the configuration or server)
--source <value>content source id of the site (see source list; default: every enabled source)
--timingsreport phase timings, request counts and transferred bytes on stderr (one JSON line with --json); also FOLIWAKE_TIMINGS=1 or FOLIWAKE_TIMINGS_FILE=<file>
--verbosealso print codes, snapshots, attempts and the engine's technical text (for support)
bash
foliwake source sync
foliwake source sync --source content --json
foliwake source sync --source lessons --full
foliwake source sync --code cd_…   # before `migration prepare cd_…`

foliwake whoami ​

Show the server, who this command acts as and what it may do (core whoami)

text
foliwake whoami [flags]
FlagDescription
--debugprint the underlying error on stderr
--jsonFormat output as json.
--server <value>call this Foliwake server (origin or host) instead of the local configuration (default: the folder's .foliwake/connection.json, then $FOLIWAKE_SERVER, then the last login)
bash
foliwake whoami
foliwake whoami --server cloud
foliwake whoami --json

Server processes ​

These start a server and keep running until Ctrl+C (or SIGTERM). They are not core operations: they take no --json, --input or --server, and the servers they start call core themselves where they change a site.

foliwake admin ​

Local configuration dashboard on 127.0.0.1 (default port 8099)

A server process, not a core operation: the dashboard for one configuration file, on loopback only, with sign-in by account, until Ctrl+C. The dashboard itself calls core.

text
foliwake admin [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--createallow a configuration file that does not exist yet (the first saved site creates it)
--debugprint the underlying error, paths included, on stderr
--drafts-dir <value>where unfinished "Add site" setups are kept (default $FOLIWAKE_ADMIN_DRAFTS_DIR, else .<config file name>.admin-drafts next to the configuration; created 0700)
--history-domain <value>local override of the history host domain (default addresses.historyDomain, else history.localhost)
--history-port <value>loopback port of the read-only website history listener (default 8097; 0 picks a free one)
--port <value>port to listen on (default 8099; 0 picks a free one)
bash
foliwake admin --config foliwake.config.json
foliwake admin --config new.config.json --create --port 0

foliwake api serve ​

Serve core over HTTP with account sign-in and CLI login (device code), on 127.0.0.1

text
foliwake api serve [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder); sign-in state is kept beside it
--debugprint failures with their paths on stderr
--port <value>loopback port (default 8098; 0 picks a free one)
--public-origin <value>where browsers and the CLI reach this listener, e.g. https://foliwake.example behind a gateway (default: $FOLIWAKE_PUBLIC_ORIGIN, else http://127.0.0.1:<port>)
--trust-proxybehind a gateway: rate limits use the last X-Forwarded-For entry as the client address
bash
foliwake api serve --config foliwake.config.json
foliwake api serve --config /site/foliwake.config.json --public-origin https://foliwake.example --trust-proxy

foliwake dev ​

Serve working files with live diagnostics (http://127.0.0.1:3000)

A server process, not a core operation: serves the working files (or the selected snapshot of the site's source) with diagnostics, until Ctrl+C. With --remote: content from the deployed preview (default) or live site, code from this checkout.

text
foliwake dev [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--content <value>this folder instead of the site's content sources; refused when they need the page ledger
--port <value>port to listen on (default 3000)
`--remote <[previewlive]>`
--remote-auth-env <NAME>with --remote-url: NAME of the environment variable holding the HTTP Basic password (never the password itself)
--remote-auth-user <value>with --remote-auth-env: the HTTP Basic user name
--remote-config <value>with --remote: another endpoints file than ./foliwake.remote.json (same format, secret-free)
--remote-url <value>remote mode with this site origin instead of foliwake.remote.json (https; http only for loopback)
--site <value>site id from the project configuration (required when it lists several sites)
--watchwatch local components/, scripts/, styles/ and Markdown content and reload open browser pages after changes (one reload per burst of saves; problems are shown in the page until fixed). Without it, refresh by hand
--watch-pollingwith --watch: detect code changes by polling file stats (default on macOS); --no-watch-polling: native file-system events (default elsewhere). Precedence: this flag, then FOLIWAKE_WATCH_POLLING=1|0, then CHOKIDAR_USEPOLLING, then the platform default
bash
foliwake dev
foliwake dev --watch
foliwake dev --port 3001
foliwake dev --config foliwake.config.json --site a
foliwake dev --remote --watch            # in the frontend checkout: preview content, local code
foliwake dev --remote live --port 3001
foliwake dev --remote-url https://preview.foliwake.example --remote-auth-user owner --remote-auth-env PREVIEW_PASSWORD

foliwake integration serve ​

Editor integration API and review route (Drupal editor; 127.0.0.1:8095 by default)

A server process, not a core operation: the editor integration API and its review route, until Ctrl+C. It calls core as the integration service.

text
foliwake integration serve [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--connections <value>editor integration connections file (environment variable NAMES only)
--debugprint the underlying error, paths included, on stderr
--port <value>port to listen on (default 8095; 0 picks a free one)
bash
foliwake integration serve --config foliwake.config.json --connections integration.json
foliwake integration serve --config foliwake.config.json --connections integration.json --port 0

foliwake serve ​

Serve published content: live (8080), preview (8081) or all

A server process, not a core operation: every configured site on the shared live and preview listeners, read from their stores, until Ctrl+C. Preview needs the preview token; beyond loopback it needs TLS.

text
foliwake serve [TARGET] [flags]
FlagDescription
--config <value>project configuration (default: $FOLIWAKE_CONFIG, else ./foliwake.config.json in this folder)
--debugprint the underlying error, paths included, on stderr
--live-port <value>live port for serve all (default 8080)
--port <value>port to listen on (serve live or serve preview)
--preview-host <value>bind preview beyond loopback (requires --tls-cert, --tls-key and a preview token)
--preview-port <value>preview port for serve all (default 8081)
--tls-cert <value>PEM certificate for HTTPS preview
--tls-key <value>PEM private key for HTTPS preview
bash
foliwake serve live
foliwake serve preview
foliwake serve all
foliwake serve all --live-port 9080 --preview-port 9081

foliwake server ​

Run the whole server on one port: dashboard, API and CLI login, live and preview sites (the Docker image runs this)

text
foliwake server [flags]
FlagDescription
--data <value>data folder: configuration, accounts, secrets, storage (default: $FOLIWAKE_DATA_DIR, else /data)
--debugprint failures with their paths on stderr
--port <value>the one port (default: $FOLIWAKE_PORT, else 8080)
bash
foliwake server                       # data in /data, http://localhost:8080/
foliwake server --data ./data --port 8090