Overview
This section covers three ways to work with Chartnaut from outside the app: the CLI, the MCP server and the API. Each one runs your indicators, definitions and studies on Chartnaut's servers and saves them to your account, where they open in the app like anything you built there.
Use it to | Start with | |
|---|---|---|
CLI | Keep scripts as files in your own folder, and run them from a terminal or a coding agent such as Claude Code or Codex | |
MCP server | Ask Claude, ChatGPT, Cursor or Codex to write, run and explain your scripts in their own chat, with nothing to install | |
API | Call Chartnaut from your own code with HTTP and JSON |
To put Chartnaut's terminal inside your own app instead, see the Terminal SDK.
All three work on every plan, Free included, and share your plan's API limits. Free keeps 10 definitions, 50 studies and 5 Forward Insights, with 1 Forward Insight active on your charts: past a cap, a command stops with plan_limit and exit code 3, and the same MCP or API call is refused with 403 plan_limit. Plans
The rest of this page is about the CLI. It is open source: the code, the install scripts and a guide for coding agents are on GitHub at chartnaut/cli. Read it, build it yourself, or open an issue there.
What a run gives you
Nothing runs on your computer and you never download market data. The CLI sends the script, Chartnaut runs it on the instrument, timeframe and window you name, and returns what the script produced:
Script | A run returns |
|---|---|
Its output series: a time and a value per bar for each output | |
Its events: one row each time the setup happened | |
Its result blocks: metrics, tables, distributions and charts |
You never receive raw candles. The scripts are the same ones the builders in the app write, in the same language. The Scripting section is their reference, and chartnaut docs prints any page of it in the terminal.
Runs from the CLI take from the same pool of runs at once as the app and its agents.
What you can do with it
Write an indicator in your editor and run it on 30 days of BTC before you save anything.
Run one definition on BTC and ETH in one command and compare the event counts.
Save a new version, or pull down a script you built in the app and keep editing it locally.
Run a definition over a year of history so a study can read its events.
Let Claude Code or Codex write a script, test it and fix it until the numbers make sense.
To use Chartnaut from Claude, ChatGPT or Cursor without the CLI, connect them to Chartnaut's MCP server: Connect Chartnaut to an AI app. MCP, the Agent or the CLI helps you choose.
The commands
$ chartnaut --help
Usage: chartnaut [options] [command]
Author and run Chartnaut indicators, definitions and studies. Scripts run on
Chartnaut servers.
Options:
-v, --version output the version number
--json print the raw API JSON
-h, --help display help for command
Commands:
init [options] set up a Chartnaut project here:
chartnaut.json, script folders and the agent
guide in CLAUDE.md + AGENTS.md. Additive:
never removes or overwrites what you wrote
new [options] <kind> <slug> write a starter script folder:
<kind-plural>/<slug>/
validate [options] [path] lint and resolve a script without saving or
running it (free)
push [options] [path] save the local folder as a new version
(create on first push)
pull [options] <ref> write a saved version to local files
diff <slug> unified diff of local files vs the latest
remote version
ls [options] your scripts
versions [options] <slug> version history of a script, newest first
open [options] <target> print the app link for a script or run
(--browser opens it)
run [options] <target> run a local script folder/file (inline) or a
saved ref on Chartnaut servers
runs [options] list recent runs; see also runs
get|results|cancel
events [options] <definition> a definition's stored events from running
over history, or --summary for counts per
instrument and timeframe
collect [options] <definition> run a definition over history on a window so
its events are stored for studies; only the
missing part runs
login [options] sign in through your browser (--token for CI)
logout sign out
whoami user, plan and token scopes
usage compute used this period and every plan cap
library search every script you can use: yours,
Chartnaut's and the community's (never their
source)
instruments [options] [q] instruments you can run on, with coverage
docs [topic] scripting reference: topic list, or one topic
as markdown
mcp connect Claude, Cursor or Codex to
Chartnaut's MCP server
upgrade [options] update chartnaut to the latest version
help [command] display help for commandchartnaut collect runs a definition over history, the same as running it over history in the app. chartnaut library searches the scripts you can run, including Chartnaut's built-ins and other people's public ones, and chartnaut library add puts another author's script in your library so you can run it. Every command and flag is in the Command reference.
Pages in this section
To | Read |
|---|---|
Put the CLI on your computer | |
Connect it to your account | |
Write and run a first indicator | |
Have a coding agent do the work | |
Save versions and edit scripts from the app | |
Read full results, and study runs made in the app | |
Read and filter a definition's events | |
Use Chartnaut from Claude, ChatGPT or Cursor | |
Fix an AI app's connection or a failing tool call | |
Call Chartnaut from your own code | |
Know how much you can run | |
Understand a failure | |
Read the code, build it from source or report a bug |
