Reference

CLI

Everything the platform can do, from a terminal — strategies, backtests with their verdicts, agent activity and research.

It speaks MCP

The CLI is a Model Context Protocol client, driving the same tools Claude and Cursor connect to. That means one login, the same permissions as every other client, and any tool the platform gains is reachable from the terminal the day it ships — see alphonce tools.

Install

Requires Node.js 18 or later.

npm install -g @alphonce/cli

Signing in

Create a token under Settings → Connected accounts, then:

alphonce auth login
alphonce auth status
alphonce auth logout

The token is read from a prompt rather than a flag, because command arguments end up in shell history and in ps output. It is checked against the server before being saved, so a bad paste fails immediately, and is written to ~/.alphonce/config.json with mode 0600.

For CI, set ALPHONCE_TOKEN — the environment always wins over the file, so no config needs writing.

Portfolio

alphonce portfolio
alphonce holdings
alphonce holdings --json | jq '.[] | select(.unrealized_pnl < 0)'

Strategies

Strategies live on the platform and are referenced by id, not by a local directory. alphonce strategy list shows yours with their ids.

Create

alphonce strategy create \
  --name "spy-dca" \
  --type dca \
  --symbol SPY \
  --capital 5000
NameDefaultDescription
--nameStrategy name (required).
--typedca, grid, momentum, mean_reversion or custom (required).
--symbolInstrument to trade (required).
--capital1000Capital to allocate.
--configExtra parameters as JSON, e.g. '{"investment_amount":250}'. Varies by type.
--brokeralpaca or trading212.

Test

Runs a simulation and prints the result with its verdict — the checks on whether those numbers can be trusted. A strategy that beat buy-and-hold on too few trades will say so.

alphonce strategy test \
  --id 6cae6060-… \
  --from 2015-01-01 \
  --to 2024-12-31
NameDefaultDescription
--idStrategy id (required).
--fromStart date, YYYY-MM-DD (required).
--toEnd date, YYYY-MM-DD. Must be in the past (required).
--capitalStarting capital. Defaults to the strategy's allocation.
--quickfalseSkip the parameter sweep, walk-forward and cost sensitivity studies. They cost under a second, so this is rarely worth it.

Run

alphonce strategy deploy --id <id>
alphonce strategy pause  --id <id>
alphonce strategy resume --id <id>
alphonce strategy stop   --id <id>

Stopping leaves positions open

Stopping halts the strategy; it does not close what it holds. Close positions through your broker or the app. There is no --liquidate flag — one was documented before, and implementing an unattended mass-exit behind a single flag is not something to do casually.

Agent activity

alphonce bot status
alphonce bot logs --id <id> --tail 100
alphonce bot logs --id <id> --follow
alphonce bot trades --id <id>
alphonce bot alerts --id <id>
NameDefaultDescription
--idBot / strategy id (required).
--tail50Entries to show.
--followfalseKeep watching for new entries, polling every 5 seconds. Ctrl-C to stop.

bot logs merges alerts and executed trades into one chronological feed — the fills alongside the reasoning that led to them, rather than either half on its own.

Research

alphonce research NVDA

Runs the full pipeline on one instrument: market data, news, analyst coverage and a synthesised view with its sources.

A symbol, not a question

This takes a ticker. The research pipeline runs against one instrument, so a command that accepted free text would have to guess a symbol out of a sentence — and on “compare AAPL and MSFT” it would pick one and research the wrong company. Open-ended questions belong in the app's chat, which keeps the context a single command cannot.

Everything else

The commands above are conveniences. The full surface is whatever your plan can reach:

alphonce tools
alphonce call GET_STRATEGIES
alphonce call PLACE_ORDER '{"symbol":"SPY","side":"buy","quantity":1}'

Configuration

alphonce config get
alphonce config set apiUrl http://localhost:3000
alphonce config path
VariablePurpose
ALPHONCE_TOKENOverrides the stored token. Use this in CI.
ALPHONCE_API_URLPoint at a different environment.
NO_COLORDisable colour output.

Every command accepts --json for machine-readable output, and failures exit non-zero with the reason on stderr, so set -e scripts stop where they should.