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 --help

Commands

CommandWhat it does
initinteractively generate config.yaml
import openapi <source>convert an OpenAPI 3.x document into resource drafts
validatevalidate config.yaml; exit non-zero if invalid
doctordiagnose config, gateway, backend, protocol and payment health
demorun the documented quickstart, checking each step
versionprint the CLI version and pinned protocol/SDK versions

Global options

-v, --version
Print the CLI version.
-h, --help
Help 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

CodeMeaning
0success — warnings included, unless a command's --strict says otherwise
1failure: 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.