Overview
CLI reference
agent-commerce: generate, import, validate and diagnose a gateway configuration.
The agent-commerce binary ships with the package. It generates, imports, validates and diagnoses configuration — the same checks the gateway runs at startup, not a second copy of the rules.
npx @devlab.group/agent-commerce --helpCommands
| Command | What it does |
|---|---|
init | interactively generate config.yaml |
import openapi <source> | convert an OpenAPI 3.x document into resource drafts |
validate | validate config.yaml; exit non-zero if invalid |
doctor | diagnose config, gateway, backend, protocol and payment health |
demo | run the documented quickstart, checking each step |
version | print the CLI version and pinned protocol/SDK versions |
Global options
-v, --versionPrint the CLI version.
-h, --helpHelp for the program or any command.
Config resolution
Commands that read configuration take --config <path>. Without it they use AGENT_COMMERCE_CONFIG, then config.yaml in the working directory. When .deploy/local.json exists (written by npm run chain:deploy), validate and doctor fill the local X402_* and MERCHANT_WALLET placeholders from it and say so.
Exit codes
| Code | Meaning |
|---|---|
0 | success — warnings included, unless a command's --strict says otherwise |
1 | failure: invalid config, a FAIL check, a failed import, or a refused overwrite |
Output lines start with PASS, WARN, FAIL or INFO, so logs stay greppable in CI. Resolved secrets are never printed — errors name the variable, not its value.