Documentation
wallbit-cli is built workflow-first: define flows in YAML, validate before execution, and run repeatable financial automations from your terminal.
Prerequisites
- Go toolchain (to install with
go install) - A Wallbit API key
- Network access to your Wallbit API host (default base URL is production unless you override with
--base-url)
Installation
Install the wallbit binary from the repository module path:
go install github.com/jeremyjsx/wallbit-cli/cmd/wallbit@latestPut the Go bin directory on your PATH so your shell can run wallbit. With a default go install, that directory is usually $(go env GOPATH)/bin (or wherever you install binaries).
Authentication
The CLI resolves an API key in this order: --api-key flag, then WALLBIT_API_KEY, then the local credentials file written by wallbit auth login.
| Command | Description |
|---|---|
wallbit auth login | Prompts for an API key (unless --api-key is set) and saves it to the local store. |
wallbit auth status | Shows whether env/file/flag is configured. Never prints the key. |
wallbit auth logout | Removes the locally stored API key. |
Global flags
These flags are available on the root command and inherited by subcommands.
| Flag | Description |
|---|---|
--api-key | Wallbit API key (overrides env and stored credentials). |
--base-url | Wallbit API base URL (default https://api.wallbit.io). |
--timeout | HTTP client timeout (default 30s). |
CLI reference
All successful commands write JSON to stdout unless noted. Errors are printed to stderr and exit non-zero.
auth
See Authentication above. Subcommands: login, status, logout.
Command overview
Most commands are thin wrappers over one API domain. Use this table as a fast map, then jump to workflows when you need multi-step execution.
| Group | What it covers | Typical command |
|---|---|---|
| balance | Checking and stock balances | wallbit balance checking |
| rates | Currency exchange quotes | wallbit rates get --source USD --dest EUR |
| wallets | Wallet discovery/filtering | wallbit wallets get --currency USDC |
| assets | Asset listing and details | wallbit assets list --limit 5 |
| transactions | Transaction feeds and filters | wallbit transactions list --limit 10 |
| cards | List, block, unblock card operations | wallbit cards block <card-uuid> |
| roboadvisor | Portfolio balance, deposit, withdraw | wallbit roboadvisor balance |
| fees | Fee settings by type | wallbit fees get --type TRADE |
| apikey | Revoke the active API key | wallbit apikey revoke |
trades
wallbit trades create — Required: --symbol, --direction (BUY or SELL), --order-type (MARKET, LIMIT, STOP, STOP_LIMIT). Exactly one of --amount or --shares. Optional: --currency (default USD), --stop-price, --limit-price, --time-in-force (DAY or GTC for LIMIT).
LIMIT requires --limit-price and --time-in-force. STOP requires --stop-price. STOP_LIMIT requires both stop and limit prices.
For the remaining groups (roboadvisor, fees, apikey), prefer workflow handlers when available and use direct commands for operational one-offs.
Environment
| Variable | Description |
|---|---|
WALLBIT_API_KEY | API key used when no --api-key flag and no saved credentials (or as configured by the credentials package). |
First workflow in 5 minutes
Your fastest path is: create a YAML file, validate it, then run it. Use this as a copy-paste baseline:
version: 1
name: quickstart-fx
steps:
- id: fx
run: rates.get
with:
source: USD
dest: EUR
- id: wallets
run: wallets.get
with:
currency: USDC
network: polygonwallbit workflow validate ./quickstart.yaml
wallbit workflow run ./quickstart.yamlWorkflow language
Workflows are plain YAML with ordered steps. Each step has an id, a run key, and optional with inputs. Use step references to build multi-step logic: ${steps.<step_id>.<dot.path>} .
| Field | Required | Meaning |
|---|---|---|
version | yes | Workflow schema version (currently 1). |
name | optional | Human-readable run name. |
on_error | optional | fail_fast (default) or continue. |
steps | yes | Non-empty list of executable steps. |
Patterns cookbook
Pattern 1 - FX check plus reverse confirmation
version: 1
name: fx-roundtrip
steps:
- id: base_fx
run: rates.get
with:
source: USD
dest: EUR
- id: reverse_fx
run: rates.get
with:
source: ${steps.base_fx.data.Data.DestCurrency}
dest: ${steps.base_fx.data.Data.SourceCurrency}Pattern 2 - Portfolio context plus transaction scan
version: 1
name: portfolio-scan
steps:
- id: wallets
run: wallets.get
with:
currency: USDC
network: polygon
- id: tx
run: transactions.list
with:
page: 1
limit: 10
currency: USDPattern 3 - Multi-domain snapshot
version: 1
name: morning-snapshot
steps:
- id: assets
run: assets.list
with:
page: 1
limit: 5
category: TECHNOLOGY
- id: cards
run: cards.listAI prompt templates
Give your copilot strict prompts so it emits runnable YAML instead of vague prose.
Generate a wallbit-cli workflow YAML (version 1) with:
- 3 steps
- one rates.get step (USD -> EUR)
- one wallets.get step (USDC on polygon)
- one transactions.list step (limit 10)
Return only valid YAML, no markdown, no explanations.Refactor this workflow to use step references where possible.
Keep run keys valid for wallbit-cli.
Return only YAML.
<paste-workflow-here>YAML workflow specification
Top-level fields:
| Field | Required | Description |
|---|---|---|
version | yes | Must be 1. |
name | optional | Workflow display name (included in validate JSON). |
on_error | optional | fail_fast (default) stops after the first failed step; continue runs subsequent steps. |
steps | yes | Non-empty array of steps. |
Each step:
| Field | Required | Description |
|---|---|---|
id | yes | Unique identifier within the workflow. Used for output references. |
run | yes | Handler key (see Step catalog). |
with | optional | Map of inputs for the handler (snake_case keys as documented per step). |
version: 1
name: example
on_error: fail_fast
steps:
- id: usd_eur
run: rates.get
with:
source: USD
dest: EUR
- id: list_tx
run: transactions.list
with:
limit: 20Validate, Run & Output
Both commands parse YAML, run structural validation (version, unique id, non-empty run, valid on_error), then ValidateSupportedRuns and ValidateStepInputs. run additionally executes each step in order.
workflow
YAML workflow runner.
wallbit workflow validate <file.yaml>— Parse YAML, ensureversionand structure, check everyrunis supported, validatewithfor steps that have validators. Prints a small JSON summary on success.wallbit workflow run <file.yaml>— Same validation as above, then executes steps in order and prints JSONRunResult(see Output format).
Output format
Commands that call the API print indented JSON. workflow run prints a RunResult: workflow, ok, started_at, finished_at, optional failed_step_id, and steps. Each step has id, run, ok, optional data (API payload), optional error with message, and duration_ms.
Step output references
In with values you can interpolate prior step results using ${steps.<step_id>.<dot.path>}. The path walks struct fields (case-insensitive) or map keys. If the entire with value is a single reference, the resolved type is preserved; otherwise references are stringified into the template.
Only steps that completed successfully before the current step are visible; references must match a prior id.
Workflow step catalog
Each row is a run key. Fields listed under with use workflow YAML naming (snake_case).
| run | with | Notes |
|---|---|---|
rates.get | source, dest (required) | Both strings (currency codes). |
balance.get_checking | — | No inputs. |
balance.get_stocks | — | No inputs. |
wallets.get | optional currency, network | Workflow runner lowercases network for the API request. |
assets.list | optional category, search, page, limit | Use category values accepted by your Wallbit environment. |
assets.get | symbol | Required. |
account_details.get | optional country, currency | — |
transactions.list | optional status, type, currency, page, limit | API may restrict allowed limit values. |
cards.list | — | No inputs. |
cards.block | card_uuid | Required. |
cards.unblock | card_uuid | Required. |
trades.create | symbol, direction, currency, order_type; exactly one of amount or shares; optional stop_price, limit_price, time_in_force | Same rules as the CLI trade validator. |
roboadvisor.deposit | robo_advisor_id, amount, from (DEFAULT or INVESTMENT) | Mutation. |
roboadvisor.withdraw | robo_advisor_id, amount, to (DEFAULT or INVESTMENT) | Mutation. |
fees.get | optional type (defaults to TRADE) | The fee type you pass in YAML is uppercased before it is sent to the Wallbit API. |
operations.deposit_investment | currency, amount (positive) | Moves funds into the investment account. Mutation. |
operations.withdraw_investment | currency, amount (positive) | Withdraws from the investment account. Mutation. |
apikey.revoke | — | Revokes the current API key. Dangerous in automation. |
Want more workflow recipes, integrations, or step patterns? Open an issue and share your use case so we can prioritize it in the docs and examples. You can also explore the repository and create a request directly in issues.