@economico/cli
v1.0.0
Published
Economico CLI — discover and call the shared business registry over REST
Readme
Economico CLI
@economico/cli connects your terminal or agent to an Economico business over REST.
Login approves businesses and scopes for one connection. Each data command selects
its business explicitly; the server publishes the tools permitted for that target.
Version 1 replaces the old REST command tree with generic tool/verb dispatch.
Requires Node 24 or newer. Install with npm install -g @economico/cli.
economico login --server https://economi.co --local
economico businesses list
economico businesses list --audience public
economico --business example-co tools
economico --business example-co catalog list
economico --business example-co catalog describe --name parties.create
economico --business example-co commands execute --args @command.json
economico --business example-co reports list
economico --business example-co reports run --kind balance_sheet --currency USD --humaneconomico --business example-co <tool> <verb> --help reads that operation's current server description
and input schema from /v1/openapi.json and lists its flags. A body with one variant per
command or report is folded to the fields they share, and help names the operation that
describes one variant (catalog describe --name <name> for a command's input).
--help --json prints the complete schema. Tool/verb pairs come from its operationId
(for example, reports.run becomes reports run). Field flags use
the exact schema names (--effective_at); strings stay strings, including money.
Objects and arrays take JSON. --args accepts a JSON object, @file, or - for stdin.
The server validates inputs and enforces membership and command visibility.
JSON is the default output. --human renders supported financial statements and
summarizes other results. Errors go to stderr and exit nonzero. Command calls are
never automatically retried after network failures; supply a stable
idempotency_key when deliberately retrying a command.
Login retains the original CLI's OAuth discovery, DCR/CIMD, PKCE, and loopback flow.
Use --no-browser to print the authorization URL, or --port to select the callback
port. logout removes stored tokens from the selected config file.
A person with no business yet creates one in the browser during login. To prefill that
signup form, pass --country (US, SG, CA or GB; US means Delaware and GB
England and Wales), or --jurisdiction for an exact register (US-CA, CA for a federal
corporation, CA-ON, GB-SCT), --legal-form (c_corp, llc, private_limited_company,
corporation, …), --currency (default: the country's) and --fiscal-year-end (MM-DD,
default 12-31):
economico login --server https://economi.co --country SG --fiscal-year-end 03-31They travel as signup_* parameters on the authorization request. The server validates
them and only prefills the form; the person reviews and submits it. They are ignored when
the account already has a business.
Configuration resolves in this order: ECONOMICO_CONFIG_FILE, the nearest trusted ancestor's
.economico/config.json, then $XDG_CONFIG_HOME/economico/config.json (normally
~/.config/economico/config.json). login --local creates a project config and
adds .economico/ to the current directory's .gitignore. Config files have mode
0600. ECONOMICO_API_URL overrides the stored server URL. Credentials belong to the
server that issued them; log in again when switching servers.
Automatic ancestor discovery never walks above $HOME and, on Unix, ignores files not owned
by the current user. Use ECONOMICO_CONFIG_FILE when selecting a deliberate path outside those
boundaries.
The default host is https://economi.co. Legacy domain commands such as
invoices create are replaced by catalog discovery and commands execute.
Develop from the workspace with pnpm --filter @economico/cli test and
pnpm --filter @economico/cli build; the executable is dist/bin.js.
The config, login, and formatting code was ported from the Go repo (economico),
typescript/packages/cli. Publishing is a separate release action:
pnpm --filter @economico/cli publish --access public (prepack builds and tests).
