Command-line interface for JECP — Joint Execution & Commerce Protocol. Register agents, invoke capabilities, manage Providers from your terminal.
npm install -g @jecpdev/cli
# or one-shot
npx @jecpdev/cli --help$ jecp register --name MyBot --type demo
✓ Agent registered.
AGENT_ID: jdb_ag_a1b2c3...
API_KEY: jdb_ak_xxxxxxxxxxxx
Free calls: 100
✓ Credentials saved to ~/.jecp/config.json (mode 0600)
$ jecp invoke jobdonebot/content-factory translate \
--input '{"text":"Hello","target_lang":"JA"}'
✓ Invocation complete.
Output: {"translated":"こんにちは"}
Provider: jobdonebot/content-factory@1.0.0
Charged: $0.005 USDC
Balance: $0.995 USDC$ jecp init-provider --example hello-world # scaffold runnable starter
✓ Scaffolded hello-world Provider in .
→ jecp.yaml, handler.mjs, package.json, README.md
$ npm install
$ jecp provider register \
--namespace myco --display-name "MyCo" \
--email ops@myco.example --endpoint https://myco.example/jecp \
--country JP --wait # auto-polls DNS until verified
✓ Provider registered. Credentials saved to ~/.jecp/config.json
→ Add this DNS TXT record:
_jecp.myco.example TXT "jecp-verify=tok_xyz"
Polling /v1/providers/verify-dns until propagation…
✓ DNS verified after 3 attempts.
$ JECP_HMAC_SECRET=$(jq -r .provider_hmac_secret ~/.jecp/config.json) \
node handler.mjs & # local Provider running
$ jecp provider connect-stripe # open the URL in browser
$ jecp provider publish jecp.yaml # active once DNS+Stripe verified
✓ Published myco/echo@1.0.0For a fully interactive scaffold (without the hello-world starter),
omit --example. The bare YAML stub is available with --example.
| Command | Description |
|---|---|
jecp register |
Register a new agent (interactive or via flags) |
jecp login |
Save existing agent credentials |
jecp logout |
Clear stored credentials |
jecp invoke <cap> <action> |
Invoke a capability action (--pay wallet|x402|auto) |
jecp catalog |
List capabilities (paginated) |
jecp topup <amount> |
Top up wallet (5/20/100 USDC) |
jecp status |
Show health, balance, agent info |
jecp doctor |
Diagnose connectivity, config, SDK version, x402 readiness |
jecp wallet:link-usdc <addr> |
v0.7.0 — Link Base USDC wallet for x402 payments |
jecp init-provider |
Interactive jecp.yaml scaffold (now with x402 prompts) |
jecp provider register |
v0.8.0 — Register as Provider; saves creds, prints DNS TXT |
jecp provider verify-dns |
v0.8.0 — Auto-poll until DNS TXT propagates (--once for CI) |
jecp provider validate [file] |
v0.8.2 — Validate jecp.yaml locally against the manifest schema (exits 1 on invalid) |
jecp provider publish [file] |
v0.8.0 — Publish jecp.yaml to /v1/manifests |
jecp provider me |
v0.8.0 — Show Provider DNS/Stripe/endpoint status |
jecp provider rotate-key |
v0.8.0 — Rotate Provider api_key (7-day grace) |
jecp provider connect-stripe |
v0.8.0 — Get Stripe Connect onboarding URL |
jecp rotate-key |
Rotate this agent's API key (7-day grace) |
jecp refund … / webhook … |
Refund + webhook subscription management |
Run jecp <command> --help for full options.
--json— machine-readable JSON output (for CI/scripting)--base-url <url>— override Hub URL (defaulthttps://jecp.dev)
JECP_AGENT_ID+JECP_API_KEYenv vars (CI mode)~/.jecp/config.json(saved byregisterorlogin)
| Variable | Status | Notes |
|---|---|---|
JECP_AGENT_ID |
active | Agent ID (e.g. jdb_ag_…). |
JECP_API_KEY |
active | Preferred name for the agent's API key. Matches the Hub's X-API-Key header convention. |
JECP_AGENT_KEY |
deprecated | Legacy alias for JECP_API_KEY. Still honored, but emits a deprecation warning on stderr and will be removed in v0.10. |
JECP_BASE_URL |
active | Override Hub URL (default https://jecp.dev). |
JECP_PROVIDER_ID / JECP_PROVIDER_KEY |
active | Provider credentials, independent of agent credentials. |
If both JECP_API_KEY and JECP_AGENT_KEY are set, JECP_API_KEY wins and
no deprecation warning is emitted.
Stored at ~/.jecp/config.json with mode 0600. Contains agent_id, api_key, base_url. Treat like a Stripe secret key.
jecp invoke deepl/translate translate \
--input '{"text":"Hello","target_lang":"JA"}' \
--budget 1.00 \
--timeout 60000jecp catalog --page-size 100 --namespace jobdonebotJECP_AGENT_ID=jdb_ag_... JECP_API_KEY=jdb_ak_... \
jecp invoke a/b c --json | jq '.output'
JECP_AGENT_KEYis the legacy name and still works for one more release; switch toJECP_API_KEYto avoid the deprecation warning. The variable will be removed in v0.10.
JECP supports x402 (USDC on Base) as a parallel payment rail alongside the default Stripe-funded wallet. Per-call settlement, lower fees, no balance required.
jecp wallet:link-usdc 0xAb11Cd22Ef33aaBBCcDDeeFF0011223344556677
# → stored in ~/.jecp/config.json (CLI never holds the private key)The CLI accepts three signer kinds via --signer:
env(default) — SDK readsBASE_PRIVATE_KEYfrom env at invoke timefile— SDK reads~/.jecp/base-key.txt(chmod 600)kms— bring your own KMS adapter via SDK directly
jecp doctor
# … existing 9 checks …
# ── x402 ──
# ✓ x402 signer configured: 0xAb11... (env)
# ✓ x402 facilitator reachable: https://x402.org/facilitator (122ms)
# ✓ Base RPC reachable: https://mainnet.base.org chain=base (88ms)
# ✓ Splitter check: catalog advertises payment_methods: [..., x402]export BASE_PRIVATE_KEY=0x...
jecp invoke jobdonebot/bg-remover-pro remove \
--pay x402 \
--input '{"image_url":"https://example.com/photo.jpg"}'
# … receipt block printed:
# Payment receipt (x402):
# method: x402
# txHash: 0xdead…
# network: base
# amount: $0.005 (5000 USDC micros)
# Basescan: https://basescan.org/tx/0xdead…--pay auto (default) tries x402 when both the agent and capability
support it, and falls back to wallet otherwise. --pay wallet forces the
classic balance-funded path.
jecp init-provider now asks "Accept x402 (USDC on Base) payments? (Y/n)"
and emits payment_methods: ["stripe", "x402"] in the manifest by default.
Locked design §6.2 — hybrid mode is the recommended default.
Note:
ethersis an optional peer dep. Install it (npm i -g ethers) if you use--pay x402; otherwise the CLI falls back to wallet mode with a clear hint.
Default npm test runs hermetic unit tests only. An opt-in suite under
test/integration/ spawns the built dist/cli.js against a live
JECP Hub to catch CLI/Hub contract drift:
# Always build first — integration tests run the compiled artifact.
npm run build
# Against the default staging Hub (https://setsuna-jobdonebot.fly.dev)
npm run test:integration
# Against a local Hub
JECP_TEST_BASE_URL=http://localhost:8080 npm run test:integration
# Against jecp.dev (production — coordinate first)
JECP_TEST_BASE_URL=https://jecp.dev npm run test:integrationSee test/integration/README.md for what
each test asserts and how HOME is sandboxed in spawned children.
Apache 2.0 — Tufe Company Inc.