ChartnautDocs

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 command

Options on every command

Option

What it does

--json

Prints the raw API response instead of the tables. Goes before or after the command name.

-v, --version

Prints the CLI's version.

-h, --help

Prints the command's usage. chartnaut help <command> does the same.

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

--on

An instrument symbol, such as BTC, ETH or EURUSD. chartnaut instruments lists them.

--tf

One of 1m 5m 15m 30m 1h 2h 4h 1d 1w.

--last

A span back from now: 30d, 12w, 6m or 1y. A month is 30 days and a year is 365.

--bars

A number of bars back from now. --bars 300 --tf 5m is the last 25 hours of clock time, weekend or not.

--from, --to

A date (2026-01-02, read as midnight UTC), a full timestamp, or unix seconds. --to defaults to now and needs --from.

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

--instrument <symbol>

BTC

The default instrument

--tf <timeframe>

5m

The default timeframe

--window <span>

90d

The default window: a span, or a bar count such as 2000

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

--name <name>

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

--kind <kind>

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

-m, --message <msg>

The change summary shown in the version history

--force

On a version conflict, save on top of the latest version

--visibility <v>

private or public, on the first push only. Defaults to private.

chartnaut pull <ref>

Writes a saved version of your own script to local files. <ref> is slug or slug@N.

Flag

What it does

--dir <dir>

The folder to write to. Defaults to the script's existing folder, or <kind-plural>/<slug>.

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

--kind <kind>

Only indicator, definition or study

-q, --query <q>

Only scripts whose slug, name or description contains the text

--limit <n>

Page size. 50 by default, 500 at most.

--cursor <cursor>

The next page, from the more: --cursor … line

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

--browser

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

--on <instruments>

The instrument. A comma list such as BTC,ETH starts one run each, three at a time, and prints a comparison table.

--tf, --from, --to, --last, --bars

The timeframe and window, as above

--set <key=value>

Overrides a setting. Repeat it for more than one. true, false, null, numbers and JSON arrays or objects are typed; anything else is a string.

--kind <kind>

The kind of a lone file that is not in a script folder

--label <text>

A free-text label kept on the run

--wait

Waits for the run to finish. This is the default.

--no-wait

Prints the run id and status, and exits

--out <file>

Writes the full results to a .csv or .json file. With several instruments, each gets its own file named after the full symbol, such as results.HYPERLIQUID_BTC.csv. A study writes .json only.

chartnaut runs

Lists your recent runs, newest first.

Flag

What it does

--script <slug>

Only runs of this script. --script inline lists runs of local files.

--source <source>

api for runs started from the CLI or API (the default), app for study runs made in the app, all for both

--status <status>

queued, running, succeeded, failed or cancelled

--limit <n>

Page size. 50 by default, 200 at most.

--cursor <cursor>

The next page

chartnaut runs get <id>

Prints a run's status, progress, failure, summary and console lines.

Flag

What it does

--watch

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

--keys <keys>

Study: a comma list of result keys to return in full

--full

Study: every block in full

--outputs <ids>

Indicator: a comma list of output ids

--event <id>

Definition: only this event id

--from <date>, --to <date>

Indicator and definition: only results in this range. Give full timestamps, such as 2026-09-01T00:00:00Z.

--format <format>

json (the default) or csv. A study's CSV needs exactly one key in --keys.

--limit <n>

Page size. 5,000 by default, 50,000 at most.

--cursor <cursor>

The next page

--all

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

--summary

Totals, one row per instrument and timeframe, and any runs still going or failed

--on <instrument>

Only this instrument

--tf <timeframe>

Only this timeframe

--event <id>

Only this event id

--from <date>, --to <date>

Only events starting at or after, or ending at or before, this time. Give an RFC 3339 timestamp, such as 2026-01-02T00:00:00Z.

--version <n>

Only events found by this version

--where <json>

Payload filters, such as '[{"key":"range","op":"gt","value":10}]'

--limit <n>

Page size. 100 by default, 1,000 at most.

--cursor <cursor>

The next page

--all

Follows every page

--format <format>

json (the default) or csv. CSV follows every page unless you give --limit or --cursor without --all.

--out <file>

Writes to a .csv or .json file

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

--on <instrument>

The instrument

--tf, --from, --to, --last, --bars

The timeframe and window, as above

--version <n>

Run this version. Defaults to the latest.

--wait

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

--token <token>

Saves this API key instead of signing in through the browser. For CI.

--force

Signs in again, replacing the current login

--no-browser

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

--category <c>

crypto, fx, index or commodities

--limit <n>, --cursor <cursor>

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

--scope <scope>

Whose scripts: all (the default), library (what your library in the app shows), mine, published (your public ones), chartnaut, community (other people's public ones) or installed (other people's you added)

--author <name>

One author: a username, chartnaut or me

--kind <kind>

indicator, definition or study. Only your own and Chartnaut's studies are listed

--sort <sort>

relevance (the default with q), updated (the default without), created, adoptions or name

--interface

Adds each script's settings, outputs and events to the response. They show with --json

--limit <n>, --cursor <cursor>

Paging. --limit is at most 200

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

--kind <kind>

indicator, definition or study, when one of your studies shares the slug with an indicator or definition

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

--check

Only reports whether a newer version exists

Environment variables

Variable

What it does

CHARTNAUT_TOKEN

An API key to use instead of the saved login. It wins when both are set.

CHARTNAUT_NO_BROWSER

When set, login prints the link instead of opening a browser

CHARTNAUT_API_URL

The API address. Defaults to https://api.chartnaut.com/v1.

CHARTNAUT_APP_URL

The app address the CLI trusts when opening links. The CLI only opens https links on chartnaut.com or this host, and prints any other link instead of opening it.

chartnaut login saves your key in ~/.config/chartnaut/credentials.json, readable only by you.