mirror of
https://github.com/hanzoai/account-sdk.git
synced 2026-09-24 16:55:42 +00:00
* Add @base-org/account-cli package scaffolding Establish the account-cli workspace package with build tooling, entry point, type system, and output formatting — ready for commands to be added incrementally. Made-with: Cursor * Add account-cli unit tests to fix CI Vitest exits with code 1 when no test files are found, which caused the Tests job to fail. Add tests for CLIError and the output formatting helpers. Made-with: Cursor * Fix shebang injection and license mismatch in account-cli Add postbuild script to prepend #!/usr/bin/env node to dist/index.js since tsc strips shebangs. Align license to MIT to match root package and remove non-existent LICENSE from files array. Made-with: Cursor
1.4 KiB
1.4 KiB
@base-org/account-cli
Agent-first CLI for interacting with a user's Base Account.
Development
Prerequisites
# Build the SDK dependency (account-cli depends on @base-org/account)
yarn workspace @base-org/account build
Build & Run
# Build the CLI
yarn workspace @base-org/account-cli build
# Run it
node packages/account-cli/dist/index.js --help
Watch Mode
yarn workspace @base-org/account-cli dev
This runs tsc --watch — every save recompiles to dist/. Then run node packages/account-cli/dist/index.js to test.
Tests
yarn workspace @base-org/account-cli test --run
Typecheck & Lint
yarn workspace @base-org/account-cli typecheck
npx biome lint packages/account-cli/
Architecture
Two layers with a hard boundary:
commands/— CLI adapter. Parses flags with Commander, calls intocore/, formats output. Only layer that touchesprocess, stdin/stdout, or TTY.core/— Business logic. Zero CLI dependencies. Typed inputs → typed outputs. Reusable by a future MCP server.
Adding a command
- Create
src/core/<name>.ts— pure function, typed inputs/outputs, noprocessor CLI deps - Create
src/commands/<name>.ts— parse flags with Commander, call core, callformatOutput - Register in
src/index.ts
output/index.ts provides formatOutput and formatError. types/errors.ts provides CLIError for structured error codes.