Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

CLI Reference

Core commands for the Grimoire CLI.

Command Summary

CommandDescription
grimoire setupConfigure chain and RPC settings
grimoire compileCompile a spell to IR
grimoire validateCompile + validate structural rules
grimoire simulateRun full preview against live data
grimoire castPreview + commit (execute onchain)
grimoire venuesList registered venue adapters
grimoire venueFetch live data from a specific venue
grimoire venue doctorCheck adapter/RPC readiness
grimoire historyList past runs
grimoire logShow event ledger for a run
grimoire walletWallet management commands
grimoire initInitialize .grimoire scaffolding
grimoire setupInteractive execute-mode onboarding
grimoire compile-allCompile all spells in a directory
grimoire resumeResume a waiting cross-chain run

compile

Compile a spell file to its intermediate representation.

Terminal
grimoire compile <spell-file> [options]
OptionDescription
--prettyPretty-print the IR output
--output <path>Write IR to file instead of stdout

compile-all

Compile all .spell files in a directory.

Terminal
grimoire compile-all [dir] [options]
OptionDescription
--fail-fastStop on first compilation error
--jsonOutput results as JSON

init

Initialize the .grimoire scaffolding for the current directory.

Terminal
grimoire init [options]
OptionDescription
--forceOverwrite existing scaffolding
--runtime-quickstartInclude quickstart spell examples

validate

Compile and run structural validation on a spell.

Terminal
grimoire validate <spell-file> [options]
OptionDescription
--strictEnable strict validation mode

simulate

Run a full preview without committing any actions.

Terminal
grimoire simulate <spell-file> [options]
OptionDescription
--chain <id>Target chain ID
--rpc-url <url>RPC endpoint
--params '<json>'Override spell parameters
--advisory-replay <path>Replay advisory decisions from a prior run
--destination-chain <id>Destination chain ID for cross-chain spells
--destination-spell <path>Spell to hand off to on the destination chain
--handoff-timeout-sec <n>Seconds to wait for cross-chain handoff

cast

Run preview and optionally commit actions onchain.

Terminal
grimoire cast <spell-file> [options]
OptionDescription
--dry-runPreview + sign only, do not submit
--key-env <var>Environment variable containing private key
--chain <id>Target chain ID
--rpc-url <url>RPC endpoint
--params '<json>'Override spell parameters
--advisory-replay <path>Replay advisory decisions from a prior run
--destination-chain <id>Destination chain ID for cross-chain spells
--destination-spell <path>Spell to hand off to on the destination chain
--handoff-timeout-sec <n>Seconds to wait for cross-chain handoff

venue

Fetch live data from a specific venue adapter.

Terminal
grimoire venue <adapter> <command> [options]
OptionDescription
--chain <id>Target chain ID
--format <fmt>Output format: json, table, spell
--rpc-url <url>RPC endpoint

venue doctor

Check that a venue adapter is properly configured:

Terminal
grimoire venue doctor --chain 1 --adapter uniswap --rpc-url <url> [--json]

history

List past spell runs.

Terminal
grimoire history [options]
OptionDescription
--limit <n>Number of runs to show
--jsonOutput as JSON

log

Show the event ledger for a specific run.

Terminal
grimoire log <spell-file> <runId> [options]
OptionDescription
--lastShow the most recent run
--run-id <id>Show a specific run
--jsonOutput as JSON

resume

Resume a cross-chain run that is waiting for its destination spell to complete.

Terminal
grimoire resume <runId> [options]
OptionDescription
--watchPoll until the run completes
--jsonOutput as JSON

wallet

Manage wallets for onchain execution.

Terminal
grimoire wallet <command> [options]
CommandDescription
generateCreate a new wallet keystore
importImport an existing private key
addressShow wallet address
balanceCheck wallet balance
wrapWrap ETH to WETH
unwrapUnwrap WETH to ETH
Common options:
OptionDescription
--key-env <var>Environment variable with private key
--chain <id>Target chain ID
--rpc-url <url>RPC endpoint
--amount <n>Amount for wrap/unwrap
--jsonOutput as JSON

setup

Interactive onboarding wizard for execute mode — configures wallet, RPC, and runs readiness checks.

Terminal
grimoire setup [options]
OptionDescription
--chain <id>Target chain ID
--rpc-url <url>RPC endpoint
--adapter <name>Adapter for venue doctor check (default: uniswap)
--keystore <path>Path to keystore file (default: ~/.grimoire/keystore.json)
--key-env <var>Environment variable containing private key to import
--no-doctorSkip venue doctor checks
--non-interactiveDisable interactive prompts (for CI)
--jsonMachine-readable output

Creates .grimoire/setup.env with configuration for subsequent commands.

RPC Resolution

Exit Codes

CodeMeaning
0Success
1General error
2Validation/compilation failure
3Preview rejected (constraint violation)
4Commit rejected (drift/safety check)