CLI reference
One binary, osf, for everything. Every command also takes -h/--help and -V/--version; osf <command> --help prints the details shown here.
osf lint report.osf
osf render report.osf --target pdf -o report.pdf
osf query report.osf 'finding[confidence>=0.8]'
osf serve mcp .| Command | Does |
|---|---|
osf parse | Parse a document and print its JSON. |
osf lint | Check documents (files or directories) for errors and warnings. Exit status 1 on errors. |
osf fmt | Format documents (files or directories) in place. Lossless: comments and content are kept. |
osf format | Print a formatted document (`osf fmt` edits files in place). |
osf diff | Semantic diff of two documents: blocks added, removed and moved, properties and content changed. Blocks are matched by id. With --redline, a word-level redline instead. |
osf spell | Check the spelling of prose with an installed Hunspell dictionary. Dictionaries are found in OSF_DICT_PATH, ~/.config/osf/dictionaries, ~/.local/share/hunspell and /usr/share/hunspell. Words in @meta spell_ignore are accepted. |
osf render | Render a document to html, pdf, docx, pptx, xlsx, md, json, typst, epub, odt or ods. Alias: export. |
osf import | Convert Markdown, DOCX, XLSX, ODS or CSV into an OSF document. Markdown footnotes, math and Mermaid or DOT fences are kept; DOCX tracked insertions are kept and deletions dropped. |
osf eval | Evaluate sheet formulas and show the values. |
osf themes | List the built-in themes with their colours and fonts. |
osf query | Find blocks with a selector, e.g. 'finding[confidence>=0.8]'. |
osf search | Full-text search (BM25) across documents in files or directories, with snippets. Also the MCP tool osf.search. |
osf graph | Print the reference graph. |
osf serve mcp | MCP server over stdio, or streamable HTTP with --listen. Serves a directory or .osf files (default: the current directory). |
osf serve a2a | Run a document as an A2A agent. The document needs an @agent_card. |
osf serve http | Preview the documents in a directory in a browser. |
osf serve collab | Edit one document together in the browser: live, conflict-free (Yjs CRDT), with a preview, diagnostics and autosave. |
osf card | Print the document's A2A Agent Card. --url replaces the url in @agent_card. |
osf skill | Install the osf Agent Skill, or print its SKILL.md. |
osf lsp | Run the language server on stdio (used by the VS Code extension and other editors). |
osf check | Run the conformance corpus (default spec/conformance). |
osf schema | Print the JSON Schema of the canonical JSON. |
osf completions | Print shell completions for bash, elvish, fish, powershell or zsh. |
Check and format
osf parse
Parse a document and print its JSON.
osf parse [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
-q, --quiet | Print only diagnostics |
--spans | Include source spans in the JSON |
--no-includes | Do not resolve @include directives |
--max-depth <N> | Maximum include depth (default 10) |
osf lint
Check documents (files or directories) for errors and warnings. Exit status 1 on errors.
osf lint [OPTIONS] <FILES>...| Flag | Meaning |
|---|---|
--json | Print diagnostics as JSON |
--fix | Also format the files in place |
--deny-warnings | Treat warnings as errors |
--no-includes | Do not resolve @include directives |
--max-depth <N> | Maximum include depth (default 10) |
osf lint docs/ --deny-warningsosf fmt
Format documents (files or directories) in place. Lossless: comments and content are kept.
osf fmt [OPTIONS] <FILES>...| Flag | Meaning |
|---|---|
--check | Report files that are not formatted; change nothing |
--stdout | Print the result instead of writing it |
osf fmt --check .osf format
Print a formatted document (`osf fmt` edits files in place).
osf format [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
-o, --output <file> | Write to this file instead of stdout |
--no-includes | Do not resolve @include directives |
--max-depth <N> | Maximum include depth (default 10) |
osf diff
Semantic diff of two documents: blocks added, removed and moved, properties and content changed. Blocks are matched by id. With --redline, a word-level redline instead.
osf diff [OPTIONS] <OLD> <NEW>| Flag | Meaning |
|---|---|
--json | Print the diff as JSON |
--redline <format> | Write a redline: html, md, pdf or docx (Word tracked changes you can accept or reject) |
-o, --output <file> | Redline output file (stdout for html and md when omitted) |
--all | Include unchanged blocks in the redline |
osf diff v1.osf v2.osf --redline docx -o changes.docxosf spell
Check the spelling of prose with an installed Hunspell dictionary. Dictionaries are found in OSF_DICT_PATH, ~/.config/osf/dictionaries, ~/.local/share/hunspell and /usr/share/hunspell. Words in @meta spell_ignore are accepted.
osf spell [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
--lang <lang> | Language (default: @meta language, else en-US) |
--dict <file.dic> | Dictionary to use (its .aff next to it) |
Render
osf render
Render a document to html, pdf, docx, pptx, xlsx, md, json, typst, epub, odt or ods. Alias: export.
osf render [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
-t, --target <target> | Output format (default html) |
-o, --output <file> | Output file. Text formats go to stdout when omitted; binary formats next to the input |
--theme <name> | default, corporate, academic, modern, dark, minimal |
--page-size <size> | Page size for PDF and DOCX: a4 (default), letter or legal |
--landscape | Landscape pages |
--pdf-ua | Accessible PDF (PDF/UA-1) |
--pdf-standard <list> | PDF standards, comma-separated: a-1b … a-4e (PDF/A), ua-1, 1.7, 2.0. Also @meta pdf_standard |
--fragment | HTML fragment instead of a full page |
--no-metadata | Leave out the @meta title block |
--mermaid <cmd> | Command that renders Mermaid instead of the built-in renderer (flowchart, sequence, state, class, pie), called as `<cmd> -i in.mmd -o out.svg` (e.g. "mmdc") |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
--no-includes | Do not resolve @include directives |
--max-depth <N> | Maximum include depth (default 10) |
osf render report.osf --target pdf --theme academic --pdf-ua -o report.pdfosf import
Convert Markdown, DOCX, XLSX, ODS or CSV into an OSF document. Markdown footnotes, math and Mermaid or DOT fences are kept; DOCX tracked insertions are kept and deletions dropped.
osf import [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
-o, --output <file> | Output file (stdout when omitted) |
--from <format> | md, docx, xlsx, ods or csv, when the extension does not tell |
osf import notes.md -o notes.osfosf eval
Evaluate sheet formulas and show the values.
osf eval [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
--json | JSON output |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
osf themes
List the built-in themes with their colours and fonts.
osf themesQuery
osf query
Find blocks with a selector, e.g. 'finding[confidence>=0.8]'.
osf query [--json] <FILE> <SELECTOR>osf query report.osf '#D-1 -> criteria' --jsonosf search
Full-text search (BM25) across documents in files or directories, with snippets. Also the MCP tool osf.search.
osf search [OPTIONS] <QUERY> [PATHS]...| Flag | Meaning |
|---|---|
--limit <n> | Most hits to show (default 10) |
--json | Print hits as JSON |
osf search "budget overrun" reports/osf graph
Print the reference graph.
osf graph [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
--dot | Graphviz DOT output |
--json | JSON output: { nodes, edges } |
Serve and agents
osf serve mcp
MCP server over stdio, or streamable HTTP with --listen. Serves a directory or .osf files (default: the current directory).
osf serve mcp [OPTIONS] [PATHS]...| Flag | Meaning |
|---|---|
--listen <addr> | Serve over streamable HTTP on this address, e.g. 127.0.0.1:8091 |
--write | Allow osf.set to write files |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
osf serve a2a
Run a document as an A2A agent. The document needs an @agent_card.
osf serve a2a [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
--listen <addr> | Address to listen on (default 127.0.0.1:8090) |
--url <url> | Public URL to advertise in the Agent Card |
--token <token> | Token for the security scheme declared in @agent_card (env OSF_A2A_TOKEN) |
--write | Allow skills that change the document |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
osf serve http
Preview the documents in a directory in a browser.
osf serve http [OPTIONS] [DIR]| Flag | Meaning |
|---|---|
--listen <addr> | Address to listen on (default 127.0.0.1:8080) |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
osf serve collab
Edit one document together in the browser: live, conflict-free (Yjs CRDT), with a preview, diagnostics and autosave.
osf serve collab [OPTIONS] <FILE>| Flag | Meaning |
|---|---|
--listen <addr> | Address to listen on (default 127.0.0.1:8095) |
--token <token> | Token collaborators pass as ?token=; required when not listening on localhost, otherwise a random one is made and printed in the link. Also OSF_COLLAB_TOKEN |
--allow-net[=<servers>] | Let @data_source blocks fetch through MCP. Without a value every server is allowed; with a comma-separated list only those servers |
--mcp-config <file> | MCP server configuration file (mcpServers JSON) |
osf serve collab paper.osfosf card
Print the document's A2A Agent Card. --url replaces the url in @agent_card.
osf card [--url <url>] <FILE>osf skill
Install the osf Agent Skill, or print its SKILL.md.
osf skill install [--for <target>] | osf skill show| Flag | Meaning |
|---|---|
--for <target> | claude (~/.claude/skills, default), project (./.claude/skills), agents (~/.agents/skills) or a directory |
osf lsp
Run the language server on stdio (used by the VS Code extension and other editors).
osf lspTooling
osf check
Run the conformance corpus (default spec/conformance).
osf check [DIR]osf schema
Print the JSON Schema of the canonical JSON.
osf schemaosf completions
Print shell completions for bash, elvish, fish, powershell or zsh.
osf completions <SHELL>Aliases
osf export is the same command as osf render, and --format is accepted for --target. Includes are resolved by default; --no-includes turns them off.