Skip to content

dokime-cli

Responsibility: adapt command-line arguments to native Dokime operations. The desktop and Python interfaces do not depend on this crate.

The binary exposes serve, diagnostics doctor, diagnostics collect, skills, and version. commands/ mirrors that argv tree; each leaf owns its arguments and execution. Parsing happens before serve loads its environment or starts the runtime. Typed CLI errors have one mapping to process exit codes.

serve installs the process’s tracing subscriber, stands the application up through dokime_app::app::launch, and attaches dokime-server::grpc::Server to its handle. It defaults to loopback port 8765; --allow-remote explicitly enables remote binding with required TLS and bearer grants. It drains the server before flushing the runtime at exit. A failed startup must clean up an already-started runtime. The trusted builtin/plugin inventory belongs to the runtime crate.

The tracing subscriber writes two copies of the same stream: stderr, and a rolling file under <output-root>/logs/dokime-serve.<date>.log, in every build, debug and release alike. The desktop GUI spawns its bundled backend with stderr inherited, and a packaged installer gives the user no terminal to read that from, so the file is what makes a fresh install’s boot diagnostics reachable at all. RUST_LOG sets verbosity and DOKIME_LOG_FORMAT=json switches the wire shape for both copies together; the file rotates daily and keeps the newest two weeks. The desktop shell logs separately, under its own app log directory — see the dokime-gui reference.

serve owns loading its own environment variables, once, before any of it: with --env-file PATH, exactly that file via dotenv::from_path, refusing to start if it is missing; without it, the old walk-up — search upward from the working directory for .env via dotenv::dotenv, continuing silently when none exists up to the filesystem root. Either way a variable this process already had before serve ran always wins over one loaded from a file (dotenv never overrides an existing value), and this happens once at startup: a file edited afterward has no effect until serve restarts. No other command in this crate loads dotenv; secrets only ever reach a plugin through serve’s own resolution at admission.

diagnostics collect currently prints its collection design; it does not yet produce an archive. diagnostics doctor checks its configured local paths.

For external control of an already running instance, see the gRPC reference. Starting another embedded runtime against the active store is not a way to connect to that instance.

Dokime markDokime · Stokker Technologies