Skip to content

majordomus serve

Serve the same capabilities over HTTP on the loopback interface, with the home page, /openapi.json, /swagger and the documentation under /docs/

majordomus serve

Usage

majordomus serve [OPTIONS] [COMMAND]

Commands

Arguments

argumentvaluedefaultdescription
--repo <PATH> — Start the search for the repository root here (default: the current directory) (accepted by every subcommand)
--discovery vcs | filesystem vcs How declarative files are enumerated (accepted by every subcommand)
  • vcs — Tracked files, through the version-control index (the layer's contract); a layer none of which is tracked is read from the work tree
  • filesystem — A walk of the work tree with the same glob semantics; untracked files included
--strict flag — Refuse to proceed when any file of the layer carries an error diagnostic (accepted by every subcommand)
--share <DIR> — The tool distribution's share directory (kinds.yaml, schemas/); default: $MAJORDOMUS_SHARE, then the repository's own share/, then the one beside the executable (accepted by every subcommand)
--host <HOST> — Interface to bind; without it, the one `MAJORDOMUS_HTTP_HOST` names on this machine, and loopback (`127.0.0.1`) when that is unset
--port <PORT> — Port to bind; without it, the port this checkout derives (8741 for the primary checkout); 0 picks a free one and the address is logged on stderr
--fallback flag — When the port is taken, bind a free one instead and log both; without this a taken port is an error
--idle <SECONDS> 0 Stop when no peer has been attached for this many seconds; 0 runs until stopped. What a server no client owns is started with
--deployment <ID> — Bind the address this deployment object declares (`.ai/repo/deployments/<ID>.yaml`) instead of the local default. What a hosted process is started with; the address is the object's, not this command line's
--node-seed-env <VAR> — The environment variable holding this node's mesh key, a 64-hex seed: a hosted hub keeps one key across restarts on a disk that does not survive them, and without the variable its mesh stays off rather than minting a key nobody trusts (ADR 0220). The value is read, never printed. What a deployment's generated start command passes
--advertise <URL> — The one endpoint this node advertises to the mesh, instead of the addresses of the interface it binds: the public URL a hosted hub answers on (ADR 0220). What a deployment's generated start command passes

Examples

  • Serve the same capabilities over HTTP on a free port

    Port 0 asks the operating system for a free port; the address is logged on stderr. `/` is the home page, generated from the surfaces this process resolved; the document at /openapi.json is the same one `majordomus generate` commits; /swagger is the Swagger UI over it; /docs/ is this repository's documentation when it has been built for that mount.

    $ majordomus serve --port 0

    What it asserts: binds a port, answers GET /openapi.json, exits 0 when stopped.

    Tested by apps/majordomus-cli/tests/cli_examples.rs, which runs the command against the built executable and asserts what the page states.

Where this comes from

Declared once in apps/majordomus-cli/src/cli.rs: clap for the structure, typed Rust metadata beside it for the examples. This page, majordomus serve --help, docs/generated/cli.md and docs/generated/cli.json are projections of that one declaration.

The whole command line on one page: the registry's command-line page. The task lifecycle (init, start, finish, doctor, ...) belongs to the shell tool, a different program: Commands and its specification.

Searches the titles and descriptions of every page this site publishes.