CLI Reference
Scritorio includes a Bun-powered CLI for agents, scripts, and developers. From the repository root, run it with:scritorio, and the implementation lives in packages/cli/src/main.ts.
Output Rules
Most commands support--json. In JSON mode, structured data is printed to stdout. Human output is printed to stdout when --json is not present. The ai tool-smoke command prints progress logs to stderr and the final model answer to stdout.
Paths accept absolute paths, repo-relative paths, ~, and ~/....
Global Options
| Option | Applies to | Description |
|---|---|---|
--json | Most commands | Print structured JSON. |
--project <path> | Project, book, Codex, and AI commands | Select the book, series, or destination project path. |
doctor
Checks that the local CLI environment can see the schema migration, sample project, and Bun runtime.
schemasample-projectbun
0 when all checks pass and 1 when any check fails.
project inspect
Indexes a local project and reports its shape.
.scritorio/index.sqlite from Markdown files. It ignores .git, .scritorio, and node_modules. It records file metadata, front matter, manuscript units, beat-sheet links, Codex entries, full-text search rows, and Codex mentions.
The result includes:
- resolved project path
- index database path
- detected project kind
- Markdown file count
- indexed file count
- front matter block count
- sample indexed files
index rebuild
Rebuilds the local index for a project. It currently returns the same inspection result as project inspect.
book create
Creates a standalone book project.
| Option | Required | Values | Description |
|---|---|---|---|
--title <title> | Yes | any text | Book title. |
--project <path> | Yes | path | Destination folder. |
--type <type> | No | fiction, nonfiction | Defaults to fiction. |
--genre <genre> | No | any text | Stored in book.md. |
--point-of-view <pov> | No | first_person, second_person, third_person | Defaults to third_person. |
--pov <pov> | No | same as --point-of-view | Alias for --point-of-view. |
--structure <structure> | No | blank, novel, nonfiction | Defaults to blank. |
--json | No | flag | Print structured result. |
book.mdstory.yml.scritorio/settings.jsonmanuscript/- Codex folders for characters, locations, organizations, items, concepts, events, and style
- starter style files at
codex/style/series-style-guide.mdandcodex/style/dialogue-rules.md
book.md.
series create
Creates a series workspace.
| Option | Required | Values | Description |
|---|---|---|---|
--title <title> | Yes | any text | Series title. |
--project <path> | Yes | path | Destination folder. |
--series-type <type> | No | fiction, nonfiction, mixed | Defaults to mixed. |
--json | No | flag | Print structured result. |
series.mdstory.yml.scritorio/settings.jsonbooks/- Codex folders for characters, locations, organizations, items, concepts, events, and style
- starter style files at
codex/style/series-style-guide.mdandcodex/style/dialogue-rules.md
series.md.
book move
Moves a book project into a series workspace or back out to the default Scritorio books folder.
| Option | Required | Description |
|---|---|---|
--project <book-path> | Yes | Existing book project containing book.md. |
--series <series-path> | Required unless --out is used | Existing series project containing series.md. |
--out | Required unless --series is used | Move the book to ~/Documents/Scritorio. |
--json | No | Print structured result. |
<series>/books/. If a folder with the same name exists, Scritorio chooses a numbered unique path.
codex create
Creates a new Codex entry Markdown file.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--entry-type <type> | No | Codex type. Alias: --codex-type. Defaults to concept. |
--name <name> | Yes | Entry name and filename seed. |
--aliases <a,b> | No | Comma-separated aliases. |
--short-description <text> | No | Compact description for search and AI context. |
--categories <a,b> | No | Comma-separated categories. |
--tags <a,b> | No | Comma-separated tags. |
--global | No | Mark entry global. |
--no-global | No | Mark entry local to the project. |
--json | No | Print structured result. |
| Canonical type | Accepted aliases |
|---|---|
characters | character |
locations | location, place, places |
organizations | organization |
items | item, object, objects |
concepts | concept, term, terms |
events | event, timeline, timeline-event |
style | style |
codex/<type>/<safe-name>.md. If the preferred filename already exists, it appends a numeric suffix.
codex list
Lists compact Codex entries.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--entry-type <type> | No | Optional Codex type filter. Alias: --codex-type. |
--json | No | Print structured result. |
-compilation.md or -compilation.mdx are ignored.
codex get
Looks up one Codex entry by name, alias, title, filename stem, or partial-name match.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--entry-type <type> | No | Codex type. Alias: --codex-type. Defaults to concept. |
--name <name> | Yes | Name, alias, title, filename stem, or partial name. |
--json | No | Print structured result. |
codex search
Searches Codex entries with simple local scoring.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--query <query> | Yes | Search query. |
--entry-type <type> | No | Optional Codex type filter. Alias: --codex-type. |
--json | No | Print structured result. |
codex propose-update
Creates a review-only proposal for a character dossier update. It never writes files.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--entry-type character | Recommended | Accepted for consistency, but the command currently always resolves character entries. |
--name <name> | Yes | Character name, alias, title, filename stem, or partial name. |
--change-summary <text> | Yes | Natural-language summary of the requested canon change. |
--target-section <heading> | No | Markdown heading to inspect or replace. |
--proposed-markdown <markdown> | No | Proposed replacement or insertion text. |
--json | No | Print structured result. |
applied: false, and warnings. Narrative-role changes are narrowed to a single Role field proposal when the requested role matches one of Scritorio’s known narrative roles.
ai tool-smoke
Runs a real OpenAI Responses API tool-calling smoke test against a selected project.
| Option | Required | Description |
|---|---|---|
--project <path> | Yes | Existing project folder. |
--persona <persona-id> | No | Chat persona. Defaults to developmental-editor when omitted or invalid. |
--ask <question> | Yes | User question. Alias: --prompt. |
--model <model> | No | OpenAI model. Defaults to gpt-5.5. |
developmental-editorcharacter-psychologistcontinuity-editorworldbuilding-auditorfirst-time-readerwriting-coach
get_manuscript_context tool.
The smoke-test tool set includes generic review-only Codex mutation tools:
propose_codex_updatefor changing existing characters, locations, organizations, items, concepts, events, and style entriespropose_codex_createfor proposing new Codex entries, including optional charactersoul.mdfilespropose_character_updatefor legacy character-update behavior
Exit Codes
Current behavior:0for successful commands1for command failures or thrown validation/provider errors2for unknown commands
doctor command also uses 1 when an environment check fails.