CLI
Unaudited此内容尚不支持你的语言。
capsule is the command line for a Capsule library. It is the only client that performs the whole
data plane end to end: it scans and imports files, seals them locally, opens upload sessions,
drains the sync feed and rebuilds an index from what is on disk. That is why the examples in this
documentation are commands rather than HTTP requests. The server never sees a key, so a request
transcript would show ciphertext going in and coming out; a transcript of capsule shows the
operation.
Commands lists every command, argument and option, generated from the clap
definitions the binary parses with and verified in CI.
Install
Section titled “Install”No release has been published yet. From a checkout, cargo run -p capsule-cli -- runs the binary
against the working tree and cargo install --path capsule-cli installs it.
The two things it holds
Section titled “The two things it holds”A capsule invocation reads at most two pieces of durable state.
- A library: a directory named by
--library, holding the encrypted assets, their sidecar metadata, and a SQLite index migrated forward in place.capsule library rebuildrepairs it from the sidecars, which restores the asset facts but not index-only state such as cache bookkeeping or importer-formed stack placement. Every offline command operates on one. - A session: the token pair
capsule auth loginpersists, owner-readable, under the user’s configuration directory. Every networked command reads it, andcapsule resetremoves it.
Eleven commands unseal a library, and all eleven take its passphrase: capsule import,
capsule push, capsule restore, capsule cull, capsule show, capsule library list,
capsule repair capture-time, capsule label, capsule region, capsule edit and
capsule sync reannounce. capsule sync --library runs the last itself when the server has
rebuilt the library’s index. Each accepts --passphrase-stdin as well as prompting, so each runs
unattended. The other capsule library subcommands, info and rebuild, read only the version
file, the sidecars and the index, none of which is sealed, so they need no passphrase and offer no
flag for one.
Bare capsule
Section titled “Bare capsule”- Terminal or not. With no command while stdin and stdout are both terminals,
capsuleopens a full-screen TUI;qor Ctrl-C leaves it and?lists its keys. Anywhere else (a pipe, a redirect, a CI runner) barecapsuleprints the help on stderr and exits 2, as a missing command always has, so a script never blocks on a screen. - Logging. While the TUI holds the terminal, log output goes to
tui.login the CLI’s cache directory instead of stderr, replaced each time the TUI opens. A password, passphrase or authenticator code typed into the TUI is masked on screen, and neither it nor an issued share URL is written to that log. - Confirmation. Signing out and revoking a share link ask
yornfirst in the TUI. The subcommands do not ask, so scripts keep working. - Subcommand twins. Every flow the TUI offers stays reachable as a subcommand, with
--jsonwhere it reports. The library browser’s twins arecapsule library list --library PATH [--view timeline|albums|stacks], which lists the same timeline, albums and stacks from the same snapshot, andcapsule show ASSET --library PATH, whose--jsondocument carries the asset’s provenance history record by record. - Previews. The library browser asks the terminal once, at start-up, whether it draws Kitty, Sixel or iTerm2 graphics. Where it draws none, the preview pane says so in text and no original is decoded for it. Regions are drawn over the preview in half blocks, which every colour terminal shows.
- Editing. From the browser, the label editor (
e) and the time-and-place screen (m) write to the open library with the passphrase it was opened with, kept in memory only while it stays open. Each edit unlocks the library, writes and closes it again, through the same code ascapsule label,capsule regionandcapsule edit.
Where the contract lives
Section titled “Where the contract lives”- The import pipeline’s behaviour is Import Pipeline.
capsule pushspeaks Upload andcapsule syncdrains Sync. capsule restorefetches originals over Download and opens them with the library’s album keys. It writes an original only once its ciphertext matches the signed manifest and its plaintext matches the signed metadata’s digest. An interrupted run resumes from the part files it left inOUT/.capsule-restore/.- The server endpoints behind the networked commands are the REST API reference.
- The CLI and TUI are English-only. The shared
error.*codes render through the English catalog described in Internationalization, and the remaining locale negotiation is to be dropped. The command tree this reference is generated from is English, so the artifact cannot vary with the machine that emits it.