CLI Commands
Control analytics, search your coding history, and leverage tribal knowledge with AI agents
tribecode provides four simple CLI commands to manage your AI tool analytics collection. All commands are run through the main tribecode CLI interface.
Prerequisites
Make sure you have the tribecode CLI installed and authenticated. See our Getting Started guide for setup instructions.
Core Commands
tribe enable
Start collecting analytics data from your AI coding assistants.
Expected output:
✓ Analytics collection enabled
✓ Monitoring Claude Code, Cursor, GitHub Copilot
→ Visit https://tribecode.ai/tribe/analytics to view dataWhat This Does:
- Starts background telemetry collection
- Begins monitoring supported AI tools
- Creates local analytics database
- Enables dashboard access at tribecode.ai
tribe disable
Stop collecting analytics data and pause all monitoring.
Expected output:
✓ Analytics collection disabled
✓ All monitoring stopped
→ Existing data preserved, collection pausedWhat This Does:
- Stops background telemetry collection
- Preserves existing analytics data
- Dashboard remains accessible with historical data
- Can be re-enabled anytime with
tribe enable
tribe status
Check the current status of analytics collection and system health.
Expected output:
tribecode Status:
├─ Collection: ✓ Enabled
├─ Tools Monitored: Claude Code, Cursor
├─ Events Today: 47
├─ Database: ✓ Connected
└─ Dashboard: ✓ Available at https://tribecode.aiStatus Information Includes:
- Collection enabled/disabled state
- Currently monitored AI tools
- Recent activity summary
- Database connection status
- Dashboard availability
tribe logs
View real-time logs from the analytics collection system.
Expected output:
2024-10-02 14:23:15 | Claude Code | Event recorded: completion
2024-10-02 14:23:16 | Analytics | Tokens: 150 in, 300 out
2024-10-02 14:23:17 | Database | Event stored successfully
2024-10-02 14:24:01 | Cursor | Event recorded: chat
^C (Press Ctrl+C to exit)Log Information Shows:
- Real-time event collection
- Token usage per interaction
- Database operations
- Error messages and debugging info
- Tool-specific activity
Tip: Use logs for troubleshooting collection issues. Press Ctrl+C to exit the log stream.
Tribal Knowledge Commands
Search your coding history, recall past sessions, and extract specific content. These commands turn your development history into searchable tribal knowledge.
tribe search
Search across all your coding sessions for specific patterns, errors, or implementations.
Example output:
🔍 Found 2 sessions matching "authentication middleware":
1. myapp [c5aa183a] Claude Code
📅 6:06 PM
→ ...implementing JWT authentication middleware for the API...
→ ...OAuth authentication patterns and credential management...
2. backend [30efbc4e] Claude Code
📅 5:53 PM
→ ...Review system - focus on OAuth authentication...Options:
--limit N- Limit number of results (default: 10)--project NAME- Filter to specific project--time-range 7d- Limit to time range (7d, 30d, etc.)--tool "Claude Code"- Filter by AI tool--format json- Output as JSON
More examples:
tribe recall
Get a detailed summary of a specific coding session, including files touched, commands run, and tools used.
Example output:
📋 Session Recall: c5aa183a-715
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 Project: myapp
🛠️ Tool: Claude Code
⏱️ Duration: 21 min (6:06 PM → 6:27 PM)
📊 Events: 125 events, 5.0K tokens
✅ Summary:
• Worked on 12 files (.ts, .tsx, .json)
• Executed 5 shell commands
• Used tools: Bash (66x), Edit (7x), Read (60x)
• Key areas: api, auth, security
📄 Files touched:
• src/middleware/auth.ts
• src/routes/login.ts
• tests/auth.test.ts
... and 9 more
💻 Commands run:
$ npm test
$ npm run buildOptions:
--format json- Output as JSON for scripting
tribe extract
Extract specific content types from a session: code snippets, shell commands, or file changes.
Example output:
💻 Extracted 3 commands from session c5aa183a:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] $ npm test
[2] $ npm run build
[3] $ git status --shortContent Types:
--type code- Extract code snippets (default)--type commands- Extract shell commands--type files- List files modified--type edits- Extract file edits
More examples:
tribe query
Query sessions, insights, or raw events with flexible filtering options.
Example output:
📋 Found 3 sessions (showing 2):
1. myapp [c5aa183a] Claude Code
97 events · 1h 13m · 6.4K tokens
5:14 PM → 6:27 PM
2. backend [30efbc4e] Claude Code
729 events · 1h 13m · 47K tokens
5:14 PM → 6:26 PMQuery Types:
tribe query sessions- List coding sessionstribe query insights- View AI-generated insightstribe query events --session ID- View raw events
Options:
--all- Show all projects (not just current)--time-range 7d- Filter by time range--limit N- Limit results--format json- Output as JSON
More examples:
Using TRIBE with AI Coding Agents
Your AI coding agents (Claude Code, Cursor, Codex, etc.) can use the TRIBE CLI directly to search your coding history and leverage tribal knowledge while working on your codebase.
Example Prompts for Your AI Agent
Tell your AI coding assistant to use TRIBE commands to find relevant context:
Finding past implementations:
"Use tribe search to find how we handled authentication before implementing the new login flow"
Debugging similar errors:
"Search tribe for similar errors we've seen and how they were fixed"
Reviewing recent work:
"Use tribe query sessions to see what we worked on this week"
Finding patterns in the codebase:
"Search tribe for API endpoint patterns in this project"
Claude Code
Claude can run tribe commands directly via bash to search your history.
Bash: tribe search "error handling"Cursor
Use the terminal within Cursor to run tribe commands.
Terminal: tribe query sessions --project myappGitHub Copilot
Add tribe search results to your context for better suggestions.
tribe recall abc123 > context.mdAny AI Agent
JSON output works with any tool that can parse structured data.
tribe search "pattern" --format jsonPro tip: Your coding agents can search tribal knowledge to avoid re-solving problems you've already solved. Stop reinventing the wheel - search tribe first.
Common Usage Patterns
Daily Workflow
Start your day:
If disabled, enable it:
End of day review:
Troubleshooting
Check system status:
Monitor for issues:
Reset if needed:
Privacy Control
Pause data collection temporarily:
Work privately (no analytics)...
Resume normal analytics:
Privacy & Data Control
Complete Control
You have full control over data collection. tribecode only collects metadata (timestamps, token counts, tool names) - never your actual code or prompts.Learn more about our privacy practices.
Next Steps
Getting Started
Complete setup guide for first-time tribecode users.
Analytics Dashboard
Master the dashboard to understand your AI tool usage patterns.
Troubleshooting
Resolve common CLI and collection issues.