Command reference
Every chartnaut command and flag, as the CLI defines them. chartnaut <command> --help prints the same list in your terminal, and the source for each command is in chartnaut/cli on GitHub.
$ chartnaut run --help
Usage: chartnaut run [options] <target>
run a local script folder/file (inline) or a saved ref on Chartnaut servers
Arguments:
target path to a script folder or file, or a ref (slug, slug@3,
author/slug, chartnaut/rsi)
Options:
--on <instruments> instrument, or comma list (one run each, max 3 at once)
--tf <timeframe> timeframe (1m 5m 15m 30m 1h 2h 4h 1d 1w 1mo; 1mo = calendar month)
--from <date> window start (ISO date/time)
--to <date> window end (ISO date/time, default now)
--last <span> window as a span back from now, e.g. 30d, 12w, 6m, 1y
--bars <n> window as a bar count
--set <key=value> setting override (repeatable) (default: [])
--kind <kind> kind for a lone file outside a script folder
--label <text> free-text label shown in the app
--wait wait for the run to finish (default) (default: true)
--no-wait print the run id and exit
--out <file> write full results to file.csv or file.json
-h, --help display help for commandOptions on every command
Option | What it does |
|---|---|
| Prints the raw API response instead of the tables. Goes before or after the command name. |
| Prints the CLI's version. |
| Prints the command's usage. |
Every command exits with a fixed code from 0 to 5, so a script or a coding agent can branch on it. The codes are on Errors and exit codes.
Instruments, timeframes and windows
The commands that run something (run and collect) share these rules.
Flag | Takes |
|---|---|
| An instrument symbol, such as |
| One of |
| A span back from now: |
| A number of bars back from now. |
| A date ( |
Pass exactly one of --last, --bars or --from. When you leave a flag out, the CLI takes it from defaults in the nearest chartnaut.json, which chartnaut init writes. A window ends on the last closed bar. A run window also starts no earlier than your plan's historical data reaches, and holds at most 50,000 bars.
A saved script is named by a ref: orb-break for your latest version, orb-break@3 for version 3, author/slug for someone else's script, and chartnaut/rsi for a built-in. chartnaut library search finds them.
Project folders and scripts
chartnaut init
Sets up the current folder as a project folder: chartnaut.json, the indicators/, definitions/ and studies/ folders, and the agent guide in CLAUDE.md and AGENTS.md. It never removes or overwrites what you wrote. Running it again refreshes only the marked Chartnaut section of the guide. What it writes is on Working with Claude Code and Codex.
Flag | Default | What it sets |
|---|---|---|
|
| The default instrument |
|
| The default timeframe |
|
| The default window: a span, or a bar count such as |
A default already in chartnaut.json is kept unless you pass its flag.
chartnaut new <kind> <slug>
Writes a starter folder, <kind-plural>/<slug>/, with script.json and main.ts. <kind> is indicator, definition or study. The slug is 2 to 63 characters of lowercase letters, digits and dashes, starting with a letter or digit.
Flag | What it does |
|---|---|
| The display name. Defaults to the slug. |
chartnaut validate [path]
Lints and resolves a script without saving or running it. Free. path is a script folder or file and defaults to .. Prints ok: <slug> (<kind>) and the script's settings, outputs, events and dependencies, or one path:line: severity: message line per problem and exit code 1.
Flag | What it does |
|---|---|
| The kind of a lone file that is not in a script folder |
chartnaut push [path]
Saves a script folder as a new version, creating the script on its first push. path defaults to .. See Saving and versions.
Flag | What it does |
|---|---|
| The change summary shown in the version history |
| On a version conflict, save on top of the latest version |
|
|
chartnaut pull <ref>
Writes a saved version of your own script to local files. <ref> is slug or slug@N.
Flag | What it does |
|---|---|
| The folder to write to. Defaults to the script's existing folder, or |
chartnaut diff <slug>
Prints a unified diff of your local files against the latest saved version. Takes a slug or a path to a script folder. Tells you when your folder is based on an older version than the latest.
chartnaut ls
Lists your scripts: slug, id, kind, version, visibility, last update and name. The id (ind_… for an indicator, flw_… for a definition) is what the Terminal SDK takes; studies have none.
Flag | What it does |
|---|---|
| Only |
| Only scripts whose slug, name or description contains the text |
| Page size. 50 by default, 500 at most. |
| The next page, from the |
chartnaut versions <slug>
Lists a script's versions, newest first, with when each was saved, who saved it and its change summary. Takes --limit and --cursor like ls.
chartnaut open <target>
Prints the app link for a script slug or a study run id. Indicator and definition runs have no page in the app.
Flag | What it does |
|---|---|
| Opens the link in your browser as well |
Running
chartnaut run <target>
Runs a script on Chartnaut's servers and prints the summary. A path to a folder or file runs your local files and saves nothing. Anything else is a ref and runs the saved version. A study runs by ref only, so push it first. Another author's script runs only once it is in your library; until then run stops with Add it first: chartnaut library add <ref>. See Runs and results.
Flag | What it does |
|---|---|
| The instrument. A comma list such as |
| The timeframe and window, as above |
| Overrides a setting. Repeat it for more than one. |
| The kind of a lone file that is not in a script folder |
| A free-text label kept on the run |
| Waits for the run to finish. This is the default. |
| Prints the run id and status, and exits |
| Writes the full results to a |
chartnaut runs
Lists your recent runs, newest first.
Flag | What it does |
|---|---|
| Only runs of this script. |
|
|
|
|
| Page size. 50 by default, 200 at most. |
| The next page |
chartnaut runs get <id>
Prints a run's status, progress, failure, summary and console lines.
Flag | What it does |
|---|---|
| Polls until the run finishes, printing its progress as it goes |
chartnaut runs results <id>
Prints what a finished run produced: series, events or study blocks.
Flag | What it does |
|---|---|
| Study: a comma list of result keys to return in full |
| Study: every block in full |
| Indicator: a comma list of output ids |
| Definition: only this event id |
| Indicator and definition: only results in this range. Give full timestamps, such as |
|
|
| Page size. 5,000 by default, 50,000 at most. |
| The next page |
| Follows every page and joins them: one JSON document, or one CSV with a single header row |
chartnaut runs cancel <id>
Cancels a queued or running run and prints its new status.
A definition's events
See Definition events. Both commands work on your own definitions only.
chartnaut events <definition>
Lists the events your definition has from running over history, on every instrument and timeframe, from the app or the CLI.
Flag | What it does |
|---|---|
| Totals, one row per instrument and timeframe, and any runs still going or failed |
| Only this instrument |
| Only this timeframe |
| Only this event id |
| Only events starting at or after, or ending at or before, this time. Give an RFC 3339 timestamp, such as |
| Only events found by this version |
| Payload filters, such as |
| Page size. 100 by default, 1,000 at most. |
| The next page |
| Follows every page |
|
|
| Writes to a |
chartnaut collect <definition>
Runs your definition over history on one instrument, timeframe and window, and keeps its events. Only the part of the window it has not covered yet runs.
Flag | What it does |
|---|---|
| The instrument |
| The timeframe and window, as above |
| Run this version. Defaults to the latest. |
| Waits until it finishes, then prints the total |
--version <n> on events keeps the events that version found; on collect it runs that version. The same filter is version in the API.
Forward Insights
A Forward Insight is a study saved to your library. Make it active and it shows on the latest setup of its definition on your charts of its market and timeframe. The study must publish pin_cell first: see Forward Insights for the contract.
chartnaut insights
Lists your Forward Insights, newest change first, with whether each one is active.
Flag | What it does |
|---|---|
| Only insights on this definition |
| Only insights made from this study |
| Only this instrument |
| Only this timeframe |
| Page size and the next page |
chartnaut insights create <run>
Saves a succeeded study run to your library as a Forward Insight: run_… from chartnaut run, or srun_… for a run made in the app. It belongs to the definition, and the run's instrument and timeframe. To see it on a chart, make it active with chartnaut insights activate.
Flag | What it does |
|---|---|
| Required. The card's title on the chart |
| Your definition, when the study reads more than one |
| What the card answers |
| Checks everything and prints the preview card without saving |
| Refuses instead of replacing your insight with the same name on that definition |
| Re-saves this insight ( |
When the study needs a change, the error ends with fix: and docs: lines.
chartnaut insights show <id>
Prints one insight: its definition, instrument, timeframe, study version, window and breakdown.
chartnaut insights update <id>
--name and --description change what the chart shows. To change the numbers, run the study again and insights create with the same name.
chartnaut insights activate <id>
Makes the insight active on your charts. A definition has one active insight per market and timeframe, so this replaces any other active there. Otherwise it takes one of your plan's places (Forward Insights on charts). When every place is taken it stops with plan_limit and names the active ones: deactivate one first.
chartnaut insights deactivate <id>
Stops the insight showing on your charts and frees its place. It stays in your library.
chartnaut insights rm <id>
Removes the insight from your library, and from your charts if it was active. The study and its runs are kept.
Developer projects
A project is the Chartnaut side of an app that puts the Chartnaut terminal on your own site, with the Terminal SDK: its keys, sites and webhooks. These commands need the apps:write permission: when your login lacks it, they sign you in again through your browser to add it. They never make Live keys. Getting started walks through them.
The old chartnaut app commands, chartnaut init --app and chartnaut login --apps still work and do the same thing.
chartnaut init --project [slug]
Links this project folder to a project: picks it (or creates one), writes a Test key to .env.local as CHARTNAUT_SECRET_KEY (never printed) with CHARTNAUT_APP, adds .env.local to .gitignore, checks localhost is allowed, writes the project's slug into chartnaut.json, a guide into AGENTS.md and CLAUDE.md, the skill .claude/skills/chartnaut-sdk/SKILL.md, a template in an empty folder, then runs chartnaut project check.
Flag | What it does |
|---|---|
| Creates a new project with this name |
|
|
| Your dev server's port. Default 3000 for |
| Prints the sign-in link instead of opening it |
| Skips the checklist at the end |
With --json it prints the project, what happened to each file and the checklist. The key's secret is replaced by where it was written.
chartnaut project list
Your projects: slug, name, your role and whether each is live.
chartnaut project create <name>
Creates a project and writes its first Test key to .env.local here.
chartnaut project key [slug]
Makes a new Test key and writes it to .env.local in place of the old one. The old key works until you revoke it on the project's Keys tab in Developers. Without a slug it uses this folder's project (CHARTNAUT_APP in .env.local, then chartnaut.json), or your only project.
chartnaut project check [slug]
Prints the project's checklist: Test key made, first frame, your account linked, then what Live still needs. Exits 0 whatever it shows.
Account and discovery
chartnaut login
Signs in through your browser: it prints a code and opens the approval page. See Sign in.
Flag | What it does |
|---|---|
| Saves this API key instead of signing in through the browser. For CI. |
| Signs in again, replacing the current login |
| Prints the link instead of opening it |
| How long the key works: |
| Also asks for the permission to create developer projects and Test keys ( |
When it signs in, login prints the date the key expires. From 7 days before that date, every command prints a one-line warning on stderr. Once the key has expired, commands say your key expired. Run chartnaut login. and exit 3. A key saved with --token keeps the expiry it was made with.
chartnaut logout
Signs out and revokes the key this machine used.
chartnaut whoami
Prints your user, plan, the key's name, the date it expires (or that it never does), its scopes, and the API address.
chartnaut usage
Prints this period's compute and every plan cap with how much of it you use. --json adds the request limits. See Limits.
chartnaut instruments [q]
Lists the instruments you can run on, with their category, order flow and the dates they cover. q matches the symbol, the short symbol and the name.
Flag | What it does |
|---|---|
|
|
| Paging |
chartnaut library search [q]
Searches every script you can use: your own, Chartnaut's built-ins, other people's public scripts and the ones you added to your library. Prints one row per script with its ref, kind, latest version, adoptions, author and name. Every word of q must appear in the name, slug, description, tags, category or author. The source never comes back. See Search the library.
Flag | What it does |
|---|---|
| Whose scripts: |
| One author: a username, |
|
|
|
|
| Adds each script's settings, outputs and events to the response. They show with |
| Paging. |
The ref in the first column runs as it is: chartnaut run chartnaut/rsi --on BTC --tf 1h --last 30d.
chartnaut library show <ref>
Prints one library script: its ref, kind, version and author, its name and description, tables of its settings, outputs, events and results, and its app link. Never its source. The ref is author/slug, chartnaut/slug for a built-in or me/slug for your own, with @N for version N: chartnaut library show chartnaut/rsi. See Get a library script.
Flag | What it does |
|---|---|
|
|
chartnaut library add <ref>
Adds another author's script to your library, as Add to library does in the app: chartnaut library add bob/vwap-bands. Their script runs for you only once it is in your library. When it needs other scripts you have not added, the CLI prints To use <name>, we'll add N more scripts to your library: with the list, then asks Add them? [y/N].
Answering anything but y adds nothing. Adding never copies a script: it stays its author's, picks up their edits, and you can remove it at any time. When something it needs is not shared with you, nothing is added and the CLI names it. Studies cannot be added: only your own studies run. See Add to your library.
Flag | What it does |
|---|---|
| Adds everything it needs without asking. For scripts and CI. Without a terminal to ask in, |
|
|
chartnaut library remove <ref>
Takes a script you added out of your library. The scripts it brought along stay. Your own scripts and Chartnaut's built-ins cannot be removed this way. See Remove from your library.
Flag | What it does |
|---|---|
|
|
chartnaut library needs <ref>
Shows what adding a script would add, and changes nothing: each script it needs with its status, anything not shared with you, and the message the app would show. library requirements is the same command. See Check what a script needs.
chartnaut docs [topic]
With no topic, lists the scripting reference topics. With one, such as chartnaut docs series-outputs, prints that topic as markdown. These are the Scripting pages.
chartnaut mcp install [client]
Prints the setup that connects an AI tool to Chartnaut's MCP server, with your API address filled in. client is claude, cursor or codex; with none, it prints all three. It makes no network calls, and it never prints your saved key: the API-key variants read CHARTNAUT_TOKEN from the environment. See Connect Chartnaut to an AI app.
Client | Prints |
|---|---|
|
|
| The |
| The |
Flag | What it does |
|---|---|
| Applies the setup for one client. |
chartnaut upgrade
Updates the CLI to the latest release. See Install.
Flag | What it does |
|---|---|
| Only reports whether a newer version exists |
Environment variables
Variable | What it does |
|---|---|
| An API key to use instead of the saved login. It wins when both are set. |
| When set, |
| The API address. Defaults to |
| The app address the CLI trusts when opening links. The CLI only opens |
chartnaut login saves your key in ~/.config/chartnaut/credentials.json, readable only by you.
