Skip to main content

CLI Reference

IntentText ships a command-line tool for parsing, rendering, querying, sealing, and managing .it files.

Installation

npm install -g intenttext

Or use with npx:

npx intenttext <command>

Commands

Parse

Parse a .it file to JSON.

intenttext document.it

Output: full JSON AST of the document.


Render to HTML

intenttext document.it --html
intenttext document.it --html --theme corporate
intenttext document.it --html --output document.html
FlagDescription
--htmlRender to HTML
--theme <name>Apply a built-in theme
--outputSave to file (same name, .html extension)

Generate print-optimized HTML with page layout, fonts, headers, footers, and watermarks.

intenttext document.it --print
intenttext document.it --print --theme legal
FlagDescription
--printGenerate print HTML
--theme <name>Apply a theme

Template merge

Merge a template with data to produce a document.

intenttext template.it --data data.json
intenttext template.it --data data.json --html
intenttext template.it --data data.json --html --theme corporate
intenttext template.it --data data.json --print
intenttext template.it --data data.json --pdf
FlagDescription
--data <file>JSON data file for template merge
--htmlRender merged output to HTML
--printRender merged output to print HTML
--pdfRender to PDF (requires Puppeteer)
--theme <name>Apply a theme

Convert to IntentText

Convert Markdown or HTML files to .it format.

intenttext document.md --to-it
intenttext page.html --to-it
intenttext document.md --to-it --output
FlagDescription
--to-itConvert input to .it format
--outputSave to file

Single-file query

Query blocks within a single document.

intenttext document.it --query "type=task owner=Ahmed sort:due:asc limit:10"
FlagDescription
--query "<string>"Query string with operators

See Query System for operator syntax.


Multi-file query

Query across a directory of .it files.

intenttext query <dir> --type <type> --format <format>
intenttext query "docs/*.it" --type deadline --format table
FlagDescription
--type <type>Filter by block type
--by <author>Filter by author
--status <status>Filter by status
--section <name>Filter by section
--content <text>Substring content search
--format table|json|csvOutput format (default: table)

Natural language query

Ask questions about documents in plain English.

intenttext ask <dir> "What deadlines are coming up?" --format text
intenttext ask <dir> "Who approved the service agreement?" --format json
FlagDescription
--format text|jsonOutput format

Requires ANTHROPIC_API_KEY environment variable.


Validate

Validate a document against a built-in schema.

intenttext document.it --validate project
intenttext document.it --validate meeting
intenttext document.it --validate article
intenttext document.it --validate checklist
intenttext document.it --validate agentic
SchemaDescription
projectProject documents — expects title, sections, deadlines
meetingMeeting notes — expects title, attendees, action items
articleArticles — expects title, summary, sections
checklistChecklists — expects title, items
agenticAgent pipelines — expects steps, gates

Theme management

List and inspect built-in themes.

intenttext theme list
intenttext theme info corporate
intenttext theme info legal
SubcommandDescription
theme listList all 8 built-in themes with descriptions
theme info <name>Show theme metadata and color palette

Built-in themes: corporate, minimal, warm, technical, print, legal, editorial, dark


Build index

Build shallow .it-index files for fast queries.

intenttext index ./contracts
intenttext index ./company --recursive
FlagDescription
--recursiveBuild indexes in all subfolders

See Index Files for index architecture.


Seal (sign + freeze)

Digitally sign and freeze a document in one step.

intenttext seal document.it --signer "Ahmed Al-Rashid" --role "CEO"
FlagDescription
--signer <name>Signer name (required)
--role <title>Signer role

This adds sign: and freeze: blocks to the document with a computed content hash.


Verify

Check document integrity — validate the seal hash against current content.

intenttext verify document.it

Output:

  • Valid: seal is intact, content matches hash
  • Invalid: content has been modified since sealing
  • Amendments: lists all amendments applied after freeze

History

View the change history of a tracked document.

intenttext history document.it
intenttext history document.it --json
intenttext history document.it --by "Ahmed"
intenttext history document.it --section "Payment"
FlagDescription
--jsonOutput as JSON
--by <author>Filter by author
--section <name>Filter by section

Amend

Since v2.11

Add a formal amendment to a frozen document.

intenttext amend document.it \
--section "Payment" \
--was "Net 30" \
--now "Net 15" \
--ref "Amendment #1" \
--by "Ahmed Al-Rashid"
FlagDescription
--section <name>Section being amended (required)
--was <text>Previous value
--now <text>New value (required)
--ref <id>Amendment reference (required)
--by <author>Amendment author

Requirements: The document must be frozen first. Returns an error if no freeze: block exists.


Exit codes

CodeMeaning
0Success
1Parse error, validation failure, or general error

Global behavior

  • All commands read from stdin if no file argument is provided
  • --output flag writes to a file instead of stdout
  • JSON output is pretty-printed by default