Expand description
The semora CLI: publish Markdown and HTML to a Semora server and
wait for feedback from the page.
The library exists for the binary and its tests; it is not a stable API.
Modules§
- args
- Command-line arguments.
- bundle
- Packing a folder into a tar for a bundle push.
- cachefile
- Small files in the config folder that several commands may write at once.
- checkout
- What this checkout last pulled or pushed for each document of its project, so
pullcan tell a file changed here from one changed on the server, and a keyed push can name the revision it started from. - client
- The HTTP API client.
- commands
- One module per command group.
- config
- Where the CLI gets its server, key and defaults.
- credentials
- Stored logins: the OS keyring (Windows, macOS) or
credentials.toml(mode 600). - docref
- Document references: a bare id, a page URL, a websocket URL, or a project path link.
- exit
- Exit codes.
waitdefines them in the spec; every command uses the same ones. - local_
links - Records on this machine that a
.semoranaming another server is used with this CLI’s server (semora project link). They live inproject-links.tomlin the config folder, never in the checkout, so nobody else’s copy of the project changes. - output
- Printing helpers: short text by default, JSON with
--json. - project_
link .semora: marks a folder as a Semora project, and where a push came from.- remember
- Remembers which document each pushed path became, so the next push of that
path replaces it.
document.cachein the config folder has one line per path:<resolved path>\t<server>\t<id>. - server_
id - The id each server gives itself, which
.semoranames the server by. The CLI learns it fromwhoamiand keeps it inserver-ids.cachein the config folder, one<origin>\t<id>line per server, so most commands don’t ask again.
Structs§
- Ctx
- Everything a command needs.
Functions§
- main_
entry - Parses arguments, runs the command and returns the process exit code.