# CLI naming convention

```
openprogram <noun> [<noun> ...] <verb> [<arg> ...]
```

| Part | Rule |
| --- | --- |
| Verb | Exactly one, last before positional arguments, never among the nouns. Simple present: `list`, `status`, `add`, `remove`, `login`, `logout`, `set`, `get`, `discover`, `adopt`, `doctor`, `setup`. |
| Nouns | First; more nouns narrow the namespace. Plural for a collection (`providers`, `profiles`, `models`, `channels`); singular only for something that can never have siblings. |
| Arguments | After the verb: in `openprogram providers login codex`, `codex` is the target of `login`. |
| Flags | Double-dash kebab-case: `--profile`, `--display-name`, `--max-poll-seconds` |

## Examples

| Command | State | Shape |
| --- | --- | --- |
| `openprogram providers login <prov>` | Current | One noun |
| `openprogram providers list` | Current | One noun |
| `openprogram providers status <prov>` | Current | One noun |
| `openprogram providers doctor` | Current | One noun |
| `openprogram providers setup` | Current | Interactive wizard |
| `openprogram providers keys <prov> list` | Current | Nouns stack |
| `openprogram providers keys <prov> add` | Current | Nouns stack |
| `openprogram providers models list` | Future | Same pattern |
| `openprogram providers aliases add <from> <to>` | Future | Nouns stack |
| `openprogram channels login discord` | Future | Another domain |
| `openprogram tools login github` | Future | Another domain |

## Do not write

| Command | Why |
| --- | --- |
| `openprogram login` | Verb at top level; clashes with the second login target |
| `openprogram providerAuth login` | camelCase; a noun stack is separate words |
| `openprogram list-providers` | Locks the verb into the noun. Use `providers list` |
| `openprogram providers listing` | Wrong verb form |

## Adding a middle noun

Only when the parent splits into several sibling subgroups. A middle noun with no siblings is dead weight. OpenClaw keeps `openclaw models auth login` because `models` also has `aliases` and `list`. OpenProgram keeps `providers login` flat because every direct verb on `providers` is about credentials.

## Adding a command

1. Pick the deepest noun namespace it belongs to. Reuse one if the command is a sibling of existing commands.
2. Pick the verb. Prefer one already in the CLI.
3. Wire it in: metadata and argparse in `openprogram/interfaces/cli/parser.py`, logic in a topic module under `openprogram/interfaces/cli/commands/`, top-level dispatch in `openprogram/interfaces/cli/application.py`.

**Why this rule**

- Discoverability: `openprogram providers <TAB>` lists every action on that namespace.
- Extensibility: new domains slot in as sibling nouns without colliding.
- Mature CLIs converged on it: `openclaw models auth login`, `openclaw models aliases add`, `gh auth login`, `gh repo create`, `docker container ls`, `docker image prune`, `kubectl get pods`, `kubectl delete service <name>`.
