cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

cat/module-path
012 / docs / reference / command-line.md
command-line.md 5.4K source

title: "Command line" sidebar_position: 6

Command line

Every way to start 012, with the page that describes each. A file named like a command (get, diff) opens as ./get.

With the screen

Command Does
012 [flags] [file] Opens a .012 workbook (created on saving when it doesn't exist), or imports another format: Files
012 [flags] - A table from standard input: Pipelines
012 [flags] --listen [file] Lets agents work in the session with you, attached with 012 mcp --attach: Live mode
012 [flags] --pipe [--to nuon|json|csv|tsv] [--send ask|selection|sheet] [file] On quitting, sends a table to standard output: Pipelines
012 nu [flags] [file] A nushell notebook, at its prompt: Notebooks
012 serve [flags] [dir] Serves the sheets in a directory over SSH: Serving over SSH

The flags are the options' flags, listed in Configuration.

Without the screen

Command Does
012 get file.012 [ref] Writes a cell's value, or a range or sheet as a table: Scripts
012 set file.012 ref input [ref input ...] Types entries into cells and saves, or with --dry-run prints the change: Scripts
012 recalc file.012 Recalculates, saves and lists the cells showing errors: Scripts
012 export file.012 out [ref] Writes the workbook, a sheet or a range in another format: Scripts
012 describe file.012 Lists the sheets and what's on them: Agents
012 mcp [file.012] Serves the workbooks in the folders open to it to MCP hosts over standard input and output: MCP server
012 mcp --attach [name|socket] Joins a running 012 listening for agents, as the agent's MCP server: Live mode
012 diff a.012 b.012 Lists what changed, cell by cell: Diff and merge in git
012 diff --textconv file.012 Writes a workbook as lines, for git's textconv: Diff and merge in git
012 merge-driver base ours theirs [path] Merges theirs into ours, for git: Diff and merge in git
012 nu --module, 012 nu --install-module [--force] [path] Prints or installs the nushell module: Nushell
012 agent --skill, 012 agent --install-skill [--force] [dir] Prints or installs the Claude Code skill: Agents
012 agent --install-mcp claude-code|claude-desktop|codex [--root dir]... [--print] Adds 012 mcp to a host's configuration, or prints the entry: MCP server
012 config [path|edit|default|themes|set-key|delete-key] The settings: Configuration
012 version [--format text|json|nuon] Prints the version

get, set, recalc, export, describe, mcp, diff, merge-driver and agent take their flags anywhere after the command's name, and --help prints their usage. -- ends the flags, so what follows is taken as it is (012 set book.012 -- A1 --), and an argument such as -5 is never a flag.

Flag Commands Does
--format text|csv|tsv|json|nuon get The form of what's written; text by default
--input get What was typed (a formula) rather than its value
--no-header get JSON and NUON columns named by their letters, the first row a record
--force set Sets cells in protected ranges
--dry-run set Prints what would change, as 012 diff would, and saves nothing
--format text|json|nuon set, recalc, describe, merge-driver, version The result as text, or as JSON or NUON
--report json|nuon export Writes what was exported as JSON or NUON
--format kind, --table name export The format when the file's extension doesn't say; SQLite's table
--chart n|title export One chart of the sheet as a web page, by its number or title
--notebooks get, recalc, export, describe Runs the notebooks' cells first, when the file is trusted here
--trust with --notebooks Runs the cells of a file saved on another computer
--root dir, --read-only, --force, --notebooks, --jev mcp The folders open to it, the tools offered and what they may do: MCP server
--jev get, recalc, export, describe Asks JEV for the JEV functions' answers first
--format text|json|nuon diff The form of the changes; text by default
--color auto|always|never diff Colors the text; auto colors on a terminal or git's pager unless NO_COLOR is set

Exit status

Status Means
0 Done; for diff, the workbooks are the same
1 An error, said on standard error; for recalc, cells show errors (after saving); for diff, the workbooks differ; for merge-driver, conflicts; for get, recalc and export with --notebooks, a notebook cell failed (after writing)
2 The command was used wrongly (its usage is printed); for diff and merge-driver, trouble reading or merging the files