swarmctl: add CLI reference docs, same pattern as hivectl
Adds swarmctl markdown-docs (a hidden Verb, same clap-markdown + hide=true shape as hivectl markdown-docs) and generates docs/tools/swarmctl-cli.md from it. Wires a swarmctl-docs freshness check into nix/checks.nix, same shape as hivectl-docs, diffing against packages.swarmctl. One real gotcha: PathArgs::resolve() reads required SWARMCTL_AUTHELIA_* deployment env vars and errors if unset - swarmctl markdown-docs must not go through that path (it needs none of those vars, and the docs build runs it outside any real deployment). Restructured main() so resolve() only runs for the User arm, not unconditionally before the match. Also links the new doc from docs/tools/README.md (new 'for the swarm operator' section), CLAUDE.md's swarmctl bullet, and docs/conventions.md's flake-check list. Verified: cargo check/clippy -D warnings/test/fmt -p swarmctl all clean; swarmctl markdown-docs diffs clean against the committed doc (checked against both a plain cargo build and the actual nix build. #swarmctl output); scripts/check-issue-refs.sh clean.
This commit is contained in:
parent
b10cce8045
commit
7fc426b4dd
8 changed files with 121 additions and 3 deletions
|
|
@ -506,6 +506,11 @@ check derivations they don't:
|
|||
flake check catches the drift, and `ci-log` often can't show you
|
||||
why (it 500s on a fast failure), so you're left guessing "builder
|
||||
flake" when it's a stale doc.
|
||||
- **`swarmctl-docs`** is the same check for `swarmctl` /
|
||||
`docs/tools/swarmctl-cli.md`:
|
||||
```sh
|
||||
nix develop -c cargo run --bin swarmctl -- markdown-docs > docs/tools/swarmctl-cli.md
|
||||
```
|
||||
- there's also a flake `cargo-test` check and NixOS module
|
||||
evaluation in the set.
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,15 @@ debug agent behavior.
|
|||
- **[hivectl-cli](hivectl-cli.md)** — the exhaustive, auto-generated
|
||||
flag-by-flag reference, kept in lockstep with the binary by CI.
|
||||
|
||||
## For the swarm operator
|
||||
|
||||
- **[swarmctl-cli](swarmctl-cli.md)** — the exhaustive, auto-generated
|
||||
flag-by-flag reference for `swarmctl`, kept in lockstep with the
|
||||
binary by CI the same way `hivectl-cli.md` is. `swarmctl` itself
|
||||
runs as root on the swarm-controller host, not through `hivectl` —
|
||||
see `swarmctl/README.md` for why. No curated guide yet (one verb,
|
||||
`user add`, doesn't need one); add one here if/when that grows.
|
||||
|
||||
## What your agents can do
|
||||
|
||||
- **[bash](bash.md)** — background shell execution (`mcp__bash__*`),
|
||||
|
|
|
|||
66
docs/tools/swarmctl-cli.md
Normal file
66
docs/tools/swarmctl-cli.md
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# Command-Line Help for `swarmctl`
|
||||
|
||||
This document contains the help content for the `swarmctl` command-line program.
|
||||
|
||||
**Command Overview:**
|
||||
|
||||
* [`swarmctl`↴](#swarmctl)
|
||||
* [`swarmctl user`↴](#swarmctl-user)
|
||||
* [`swarmctl user add`↴](#swarmctl-user-add)
|
||||
|
||||
## `swarmctl`
|
||||
|
||||
swarm-level operator CLI
|
||||
|
||||
**Usage:** `swarmctl [OPTIONS] <COMMAND>`
|
||||
|
||||
###### **Subcommands:**
|
||||
|
||||
* `user` — Manage subjects in the swarm's SSO provider
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--authelia-bin <PATH>` — authelia binary used to hash passwords. The argon2 parameters must match the verifier's, so this has to be the *configured* package rather than whatever is on `PATH`
|
||||
* `--users-file <PATH>` — Host-side path of authelia's users database — i.e. the path inside the container, prefixed with the container's root
|
||||
* `--machine <NAME>` — Machine name of the authelia container, for `systemctl -M`
|
||||
* `--unit <UNIT>` — authelia's systemd unit inside that container
|
||||
* `--store <PATH>` — Canonical user store
|
||||
|
||||
|
||||
|
||||
## `swarmctl user`
|
||||
|
||||
Manage subjects in the swarm's SSO provider
|
||||
|
||||
**Usage:** `swarmctl user <COMMAND>`
|
||||
|
||||
###### **Subcommands:**
|
||||
|
||||
* `add` — Add a user, generating a password for them
|
||||
|
||||
|
||||
|
||||
## `swarmctl user add`
|
||||
|
||||
Add a user, generating a password for them
|
||||
|
||||
**Usage:** `swarmctl user add [OPTIONS] <USERNAME>`
|
||||
|
||||
###### **Arguments:**
|
||||
|
||||
* `<USERNAME>` — Login name. Conservative ASCII only — it is a YAML map key and reaches access-control rules and logs
|
||||
|
||||
###### **Options:**
|
||||
|
||||
* `--display-name <TEXT>` — Name shown in the SSO UI. Defaults to the username
|
||||
* `--email <ADDRESS>`
|
||||
* `--group <GROUP>` — Repeatable
|
||||
|
||||
|
||||
|
||||
<hr/>
|
||||
|
||||
<small><i>
|
||||
This document was generated automatically by
|
||||
<a href="https://crates.io/crates/clap-markdown"><code>clap-markdown</code></a>.
|
||||
</i></small>
|
||||
Loading…
Reference in a new issue