| Command | Purpose |
|---|---|
modfig init [--config FILE] |
Create an owner-only starter registry. |
modfig validate [--config FILE] |
Validate only the portable registry. |
modfig validate --adapters [--config FILE] |
Validate configured routes and adapter state. |
modfig diff [--config FILE] [--target TARGET] |
Run target preflight without writing. |
modfig apply [--config FILE] [--target TARGET] [--yes] |
Apply one recoverable transaction. |
modfig adapter enable ... |
Explicitly enable a verified third-party adapter route. |
TARGET is factory, vscode, chatgpt, or all; it defaults to all.
The registry path is resolved in this order:
--config FILEMODFIG_CONFIG$XDG_CONFIG_HOME/modfig/config.yamlwhen the XDG path is absolute~/.config/modfig/config.yaml~/.modfig.yaml, only when the new default is absent
An explicit path or MODFIG_CONFIG never falls back. The registry must be an
owner-only regular file.
Factory applies may run without --yes when there are no existing managed
model updates/removals. If such changes exist, the CLI prints the affected
model IDs and accepts only y or yes. --yes prints the same warning and
continues without prompting.
Explicit non-Factory applies require --yes.
validate is offline and does not read routes, client state, or environment
secrets.
validate --adapters loads selected routes and may resolve configured secrets.
It also probes every enabled Factory-targeted model whose effective provider is
openai at /responses. Missing credentials, transport errors, timeouts,
non-200 responses, and unusable output fail validation.
| Code | Meaning |
|---|---|
0 |
Command completed successfully. |
1 |
Registry, route, proof, preflight, or other expected failure. |
3 |
A required environment secret is missing or empty. |
# Validate only the registry.
modfig validate --config ~/.config/modfig/config.yaml
# Check one target without writing.
modfig diff --target factory --config ~/.config/modfig/config.yaml
# Apply one target.
modfig apply --target factory --yes --config ~/.config/modfig/config.yaml
# Apply every selected target in one transaction.
modfig apply --target all --yes --config ~/.config/modfig/config.yamlFor target-specific commands, see the Codex, Factory, and VS Code guides.