CLI
One binary, xvii. pages' CLI is the model for how it looks and behaves.
- Commands are
xvii <service> <command> (xvii pages deploy, xvii apps logs), plus top-level
login, logout, status, context, update, completion, mcp, server, open.
- Each service repo exports its command group from
cli/; the cli repo registers them. Commands are
declared in one registry (name, group, args, flags, summary, help, examples, completion kind, auth),
which drives dispatch, help, completions and typo suggestions.
- Every command has help with examples;
--json wherever output is data; colored output only on a
terminal; progress for uploads; exit code 1 on errors with a one-line message and a hint.
- Contexts: one CLI talks to many instances (
xvii context add, --context, XVII_CONTEXT); each
context keeps its domain, URL overrides and tokens per service in contexts.json (0600) in the
user config dir (~/Library/Application Support/xvii on macOS, ~/.config/xvii on Linux). The OS
keychain comes later.
xvii login uses the device flow: shows a code, opens the browser at id, waits. --no-browser
prints a link and a QR code.
- Self-update from the instance (
/releases/cli/latest.json, checksum verified); other commands mention
a new version once a day.
- Env overrides:
XVII_DOMAIN + XVII_TOKEN (CI, no saved context needed), XVII_CONTEXT,
XVII_<SERVICE>_URL (local development), XVII_NO_UPDATE_CHECK, NO_COLOR.
- Command code: a service's namespace is
<service>/cli.Command() built on go.xvii.network/kit/cli
(Command{Name, Group, Args, Summary, Help, Examples, Flags, Complete, Run, Sub}); positional
completion kinds are served by the namespace's Completer.