feat(cli): repoint the CLI at agenta onboarding; drop the crypto-wallet surface - #38
Merged
Merged
Conversation
…et surface
The CLI shipped as a self-custody crypto wallet: send/sign/balance, x402, signer
management, and 17 MCP tools for moving tokens. That is not what the product is
any more, and "the CLI is for agents" makes the leftovers actively harmful —
`agenta audit` and `agenta sub audit` collided, and the subaccount surface was
legacy that no longer maps to anything.
REMOVED (6,258 lines)
commands admin · balance · deploy · info · init · link · network · proxy ·
receive · send · sign · switch · x402
lib authenticated-fetch · erc20-abi · errors · keychain ·
policy-conversions · signer-manager · transfer-crypto · x402-client
mcp all 17 tools — call-contract, execute, get-audit-log, get-balances,
get-status, list-networks, list-signers, read-contract,
resolve-address, send-eth, send-token, sign-message,
sign-typed-data, simulate, wallet-overview, x402-check,
x402-discover, x402-fetch
tests x402-client, x402-live integration + script, transfer-crypto
ADDED
onboarding.command.ts the go-live journey from the terminal
lib/go-live.ts the state machine behind it (19 tests)
lib/session-store.ts session persistence, split out of the old keychain
CHANGED
login.command · status.command · cli/index · cli/theme · lib/config ·
lib/ensure-session · mcp/index — narrowed to what remains.
NOT COMMITTED, deliberately — this repo is PUBLIC and these were sitting
untracked, one `git add -A` from being published. All three are now gitignored:
supabase/.temp/ Supabase CLI state. `project-ref` and
`pooler-url` name the production database project
and its connection host. No password is stored so
these are not credentials, but they tell a reader
exactly where the database lives.
implementation/ 941 lines of internal task notes describing the
PRIVATE platform repo: guard names, endpoint
behaviour, dashboard source line numbers.
API-V2-COMPAT-AND-SDK-PLAN internal audit of private branches, including
deliberation about breaking integrators.
packages/wallet/bin/ stray copies of dist/index.js, byte-identical.
`bin` in package.json points at ./dist/index.js
and `files` publishes only dist/ — nothing
references bin/.
None of them had ever been committed, so this prevents an exposure rather than
remediating one. No rotation needed.
typecheck clean · biome clean · 24 tests pass (19 covering go-live).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
The published skill tells agents "always pass --json" and makes `agenta status --json` step 3, but status, audit and verify rejected the flag with `unknown option '--json'`. They already print JSON, so nobody had declared it. One recursive `addJsonOption` walks the command tree from buildProgram, so the flag and its wording live next to `isJsonMode()`, the only thing that reads it. The per-command declarations go away with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
nextStep() told agents to run `agenta verify changes` and `agenta payouts add`. Neither exists: the change-request step is `agenta verify resubmit`, and payout accounts are added in the dashboard, so that step now carries command: null and says where to go in `why`. Agents run these hints verbatim; a made-up command is a wall. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
…terminal The onboarding prompt says "create a test product"; the CLI could only mint one-off checkout sessions, which the dashboard does not show as products and go-live does not count as the first product. A product is a payment link, and the API (POST /gateway/payment-links) and the SDK (paymentLinks.create) already had it — this is the thin command on top: one-time by default, or --subscription --interval month|year [--trial-days N]. Flag validation is a pure function with tests; the SDK gains the trialPeriodDays param the server already accepts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
04aaaa1 dropped ten dependencies from packages/wallet/package.json and left the lockfile behind, so CI's frozen-lockfile install failed before it could lint or test (run 33054211833). Removal-only regeneration: 344 deletions, no additions; `pnpm install --frozen-lockfile` passes again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
The 30-second integration is a Buy button that opens the product's link; without a success URL the buyer is stranded on our receipt page. The link's success_url already flows to every session created from it and the success page appends ?sessionId=, so this is one flag. https is enforced up front (the API rejects anything else) because plain-http localhost is the first thing every local integration tries. Proven end to end on a monthly plan: card paid in the hosted checkout, browser redirected to https://example.com/thanks?sessionId=<id>, `agenta pay get` completed, `agenta subscriptions list` active. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
The frontend-only integration is links plus return URLs; a buyer who backs out of the hosted checkout needs somewhere to land too. Same https rule and the same link→session inheritance as --success-url. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
…from the SDK and CLI
The API has had GET/POST /gateway/subscriptions/:id/plan-change(/preview) and
trialPeriodDays on payment links; neither the SDK nor the CLI exposed them, and
the docs never mentioned them.
SDK: subscriptions.previewPlanChange(id, targetLinkId) and
subscriptions.changePlan(id, { targetLinkId, prorationDate }) with typed
quote/result; PaymentLink.trialPeriodDays.
CLI: agenta subscriptions change-plan <id> --to <linkId> [--dry-run] — quote,
then apply with the quote's prorationDate so the charge equals what was shown.
Proven on the local platform: €29→€49 upgrade quoted 24.78 due today, applied,
unitAmountMinor 6076; downgrade back quoted 0 today, scheduled at period end.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
…ing_plan on subscription events A scheduled downgrade no longer rewrites the subscription: the API keeps the plan the buyer paid for and reports the switch as pendingPlanChange until the period end. Changing to the current plan while one is pending is a 'revert' (nothing charged). subscription.updated now carries linkId and pendingPlan. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
The CLI shipped as a self-custody crypto wallet —
send,sign,balance, x402, signer management, and 17 MCP tools for moving tokens. That is not the product any more, and under "the CLI is for agents" the leftovers were actively harmful:agenta auditandagenta sub auditcollided, and the subaccount surface no longer mapped to anything.6,258 deletions, 1,097 insertions. This is a repositioning, not a tidy-up.
Removed
adminbalancedeployinfoinitlinknetworkproxyreceivesendsignswitchx402authenticated-fetcherc20-abierrorskeychainpolicy-conversionssigner-managertransfer-cryptox402-clientAdded
onboarding.command.ts— the go-live journey from the terminallib/go-live.ts— the state machine behind it, 19 testslib/session-store.ts— session persistence, split out of the old keychainPublic-repo hygiene — the part worth reviewing
This repo is public, and four things were sitting untracked, one
git add -Afrom being published. All are now gitignored and none is in this commit:supabase/.temp/project-refandpooler-urlname the production database project and its connection host. No password is stored, so not credentials — but they tell any reader exactly where the database lives.implementation/API-V2-COMPAT-AND-SDK-PLAN.mdpackages/wallet/bin/dist/index.js, byte-identical.binin package.json points at./dist/index.jsandfilespublishes onlydist/— nothing referencesbin/.None had ever been committed — verified with
git log --all -- <path>. This prevents an exposure rather than remediating one, so no credential rotation is needed.Verification
tsc --noEmitcleanbiome checkcleango-live.ts)main, not just on the original baseBase
Rebased onto current
main. The work originally sat uncommitted onfeat/pay-subscription-invoices, whose two local commits are already merged via #35–#37; they touch onlypackages/payand have no overlap withpackages/wallet, so this is CLI-only.🤖 Generated with Claude Code
https://claude.ai/code/session_01KdSgWa5Lf9mnHxY3x76Fy1