CLI Queries
For quick queries and scripting, use the CLI commands directly.
Listing Nodes
$ deciduous nodes ID Type Title Status Confidence ───────────────────────────────────────────────────────────────────── 1 goal Implement user authentication active 90 2 decision Choose authentication method active 75 3 option JWT tokens active 80 4 option Session cookies active 70 5 action Implementing JWT authentication active 85 6 outcome JWT auth working, tests passing active 95
Filter by Branch
$ deciduous nodes --branch feature/auth $ deciduous nodes -b main
Filter by Type
$ deciduous nodes --node-type goal $ deciduous nodes -t decision
Listing Edges
$ deciduous edges From To Type Rationale ──────────────────────────────────────────────────────────────── 1 2 leads_to Need to decide approach 2 3 leads_to Stateless, scales well 2 4 leads_to Simpler but requires server state 2 5 chosen Stateless preferred for microservices 5 6 leads_to Implementation complete
Exporting the Full Graph
$ deciduous graph > graph.json
This exports the complete graph as JSON, useful for:
- Backup
- External processing
- Integration with other tools
Recent Commands
$ deciduous commands 2024-01-15 10:30:00 deciduous add goal "Add rate limiting" -c 90 2024-01-15 10:30:15 deciduous add decision "Choose strategy" -c 75 2024-01-15 10:30:30 deciduous link 47 48 -r "Deciding approach" ...
This shows what deciduous commands were recently run, helpful for debugging or auditing.
Syncing for Web Viewer
$ deciduous sync Exported graph to docs/graph-data.json
Run this before deploying to GitHub Pages or after adding nodes when using the static web viewer.
Combining with Unix Tools
The CLI output is designed to work with standard Unix tools:
# Count nodes by type $ deciduous nodes | awk '{print $2}' | sort | uniq -c 5 action 8 decision 12 goal 3 observation 7 option 4 outcome # Find all goal nodes $ deciduous nodes | grep "goal" # Find edges involving node 47 $ deciduous edges | grep "47" # Export just node IDs $ deciduous nodes | awk 'NR>2 {print $1}'
For Claude Code Usage
Claude typically uses CLI queries for context recovery:
$ deciduous nodes --branch $(git rev-parse --abbrev-ref HEAD) $ deciduous edges $ deciduous commands | tail -10
These commands give Claude a quick overview of the current state.