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)
--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.
Projects and scripts
chartnaut init
Sets up the current folder as a project: 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, kind, version, visibility, last update and name.
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. 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.
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 |
chartnaut logout
Signs out and revokes the key this machine used.
chartnaut whoami
Prints your user, plan, the key's name, expiry and 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 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 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.
