Quick Start
Get from zero to running your first spell in under 5 minutes.
1. Install and Set Up
Terminal
npm i -g @grimoirelabs/cli
grimoire setup --chain 1 --rpc-url YOUR_RPC_URL2. Run a Known Spell
Grimoire ships with example spells. Start with a compute-only spell that doesn't move any funds:
Terminal
grimoire validate spells/compute-only.spell
grimoire simulate spells/compute-only.spell --chain 1validate checks the spell compiles correctly. simulate runs a full preview against live chain data.
3. Check the Results
After simulation, review what happened:
Terminal
grimoire history
grimoire log --lasthistory shows all past runs. log shows the detailed event ledger for a specific run.
4. Try a Spell with Actions
When you're ready to try a spell that interacts with a protocol:
Terminal
# Validate first
grimoire validate spells/uniswap-swap-execute.spell
# Dry-run: preview + sign, but don't submit onchain
grimoire cast spells/uniswap-swap-execute.spell \
--dry-run \
--key-env PRIVATE_KEY \
--rpc-url YOUR_RPC_URLThe --dry-run flag runs the full preview and signing pipeline without actually submitting the transaction. This is the safest way to test before going live.
5. Execute Live
When you're confident in the preview results:
Terminal
grimoire cast spells/uniswap-swap-execute.spell \
--key-env PRIVATE_KEY \
--rpc-url YOUR_RPC_URLWithout --dry-run, this runs preview and then commits the actions onchain.
Safe Execution Path
Always follow this progression:
validate → simulate → cast --dry-run → cast- validate — check syntax and structure
- simulate — preview against live data (no wallet needed)
- cast --dry-run — full pipeline including signing (no submission)
- cast — preview + commit (live execution)
Next Steps
- Write your first spell — create a spell from scratch
- Core Concepts — understand the preview/commit model
- CLI Reference — all available commands