tribecode CLI Commands
Complete reference for tribecode CLI commands. Learn how to manage telemetry collection, view analytics, and control your AI coding assistant monitoring.
Overview
tribecode provides simple command-line tools for managing telemetry collection from AI coding assistants like Claude Code. All commands follow a consistent pattern and provide clear feedback.
Installation
First, install the tribecode CLI:
npx @_xtribe/cli
This installs the tribe command with tribecode functionality included.
Authentication
Before using tribecode commands, you need to authenticate:
# Authenticate with GitHub OAuth
tribe login
# Check authentication status
tribe auth-status
# View account information
tribe account-info
# Remove stored credentials
tribe logout
tribecode Commands
All tribecode commands are accessed via the tribe CLI:
| Command | Description | Example |
|---------|-------------|---------|
| tribe enable | Start collecting analytics | - |
| tribe disable | Stop collection | - |
| tribe status | Check collection status | - |
| tribe logs | View collector logs | --tail 50 |
tribe enable
Description: Start telemetry collection from Claude Code and other AI tools.
Prerequisites:
- OAuth authentication required (
tribe login) - Claude Code CLI must be installed and used at least once
Usage:
tribe enable
Expected Output:
π Starting tutor telemetry collector...
β
tribecode collector started (PID: 12345)
π Logs: /Users/username/.tribe/tutor/collector.log
What Happens:
- Verifies OAuth authentication
- Checks for existing collector process
- Starts background daemon for telemetry collection
- Begins monitoring Claude Code logs in
~/.claude/projects/ - Starts buffered transmission to analytics server
Troubleshooting:
- "OAuth authentication required": Run
tribe loginfirst - "No Claude logs found": Use Claude Code CLI to generate some logs
- "tribecode collector binary not found": Reinstall with
npx @_xtribe/cli --force
tribe disable
Description: Stop telemetry collection and terminate the collector daemon.
Usage:
tribe disable
Expected Output:
π Stopping tutor collector (PID: 12345)...
β
tribecode collector stopped
What Happens:
- Finds running collector process
- Sends graceful shutdown signal (SIGTERM)
- Removes PID file
- Stops all telemetry collection
Note: This does not delete collected data or remove authentication.
tribe status
Description: Check the current status of telemetry collection and authentication.
Usage:
tribe status
Expected Output:
π tribecode Status
==========================
π OAuth: β
Authenticated
π€ User: [email protected]
π Collector: β
Running
π§ PID: 12345
β±οΈ Uptime: 2h30m
π Recent: 147 events collected
Status Fields:
- OAuth: Shows authentication status and user email
- Collector: Shows if daemon is running with PID and uptime
- Recent: Shows count of recently collected events
Possible States:
- OAuth: β Authenticated | β Not authenticated
- Collector: β Running | β Stopped
tribe logs
Description: View collector logs to monitor telemetry collection activity.
Usage:
# View all logs
tribe logs
# View last 50 lines
tribe logs --tail 50
# Follow logs in real-time
tribe logs --follow
Available Flags:
--tail N: Show last N lines (default: 50)--follow: Follow logs in real-time--verbose: Show detailed debug information
Sample Log Output:
2025-10-02 14:30:15 [INFO] tribecode collector started
2025-10-02 14:30:16 [INFO] Discovered 3 Claude projects
2025-10-02 14:30:17 [INFO] Processing 12 new events
2025-10-02 14:30:22 [INFO] Transmitted batch of 12 events
2025-10-02 14:30:45 [INFO] Health check: 147 total events collected
Log Locations:
- Collector Logs:
~/.tribe/tutor/collector.log - Auth Logs:
~/.tribe/tutor/auth.json - State File:
~/.tribe/tutor/state.json
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
Description: Search across all your coding sessions for specific patterns, errors, or implementations.
Usage:
tribe search "authentication middleware"
tribe search "docker compose" --project myapp
tribe search "API error" --time-range 7d
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
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...
tribe recall
Description: Get a detailed summary of a specific coding session, including files touched, commands run, and tools used.
Usage:
tribe recall c5aa183a
tribe recall c5aa183a --format json
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
tribe extract
Description: Extract specific content types from a session: code snippets, shell commands, or file changes.
Usage:
tribe extract c5aa183a --type commands
tribe extract c5aa183a --type files
tribe extract c5aa183a --type code --limit 5
Content Types:
--type code: Extract code snippets (default)--type commands: Extract shell commands--type files: List files modified--type edits: Extract file edits
Example Output:
π» Extracted 3 commands from session c5aa183a:
βββββββββββββββββββββββββββββββββββββββββββββ
[1] $ npm test
[2] $ npm run build
[3] $ git status --short
tribe query
Description: Query sessions, insights, or raw events with flexible filtering options.
Usage:
tribe query sessions
tribe query sessions --all --time-range 30d
tribe query insights --limit 5
tribe query events --session c5aa183a
Query 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
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 PM
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:
- Finding past implementations: "Use tribe search to find how we handled authentication before"
- 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: "Search tribe for API endpoint patterns in this project"
Agent-Specific Usage
| Agent | How to Use TRIBE |
|-------|------------------|
| Claude Code | Claude can run tribe search directly via bash |
| Cursor | Use terminal within Cursor to run tribe commands |
| GitHub Copilot | Pipe tribe output to context files: tribe recall abc123 > context.md |
| Any Agent | Use --format json for structured output |
Pro 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
First-Time Setup
# 1. Install tribecode CLI
npx @_xtribe/cli
# 2. Authenticate
tribe login
# 3. Start collecting telemetry
tribe enable
# 4. Verify everything is working
tribe status
Daily Usage
# Check if collector is running
tribe status
# View recent activity
tribe logs --tail 20
# View analytics dashboard
open https://tribecode.ai/tribe/analytics
Troubleshooting
# Check authentication
tribe auth-status
# View collector status
tribe status
# Check logs for errors
tribe logs --tail 100
# Restart collector
tribe disable
tribe enable
Stopping Collection
# Temporarily stop collection
tribe disable
# Check that it stopped
tribe status
# Restart when needed
tribe enable
Configuration
Environment Variables
You can customize collector behavior with environment variables:
# Set custom server URL
export TRIBE_TUTOR_SERVER=https://tutor.company.com
# Set team ID for multi-tenant setup
export TRIBE_TEAM_ID=engineering
# Enable verbose logging
export TUTOR_COLLECTOR_FLAGS="-verbose -buffer 100"
Configuration Files
- Auth:
~/.tribe/tutor/auth.json- OAuth tokens and user info - State:
~/.tribe/tutor/state.json- Last processed log positions - Logs:
~/.tribe/tutor/collector.log- Collector activity logs
Advanced Usage
Scripting with JSON Output
Some commands support JSON output for scripting:
# Get status as JSON
tribe status --output json
# Example output:
{
"authenticated": true,
"user": "[email protected]",
"collector_running": true,
"pid": 12345,
"uptime_seconds": 9000,
"recent_events": 147
}
Integration with CI/CD
# Check if authentication is valid
if tribe auth-status --quiet; then
echo "Authenticated, starting collector"
tribe enable
else
echo "Not authenticated, skipping telemetry"
fi
Team Management
# Set team ID for shared analytics
export TRIBE_TEAM_ID=frontend-team
tribe enable
# Each team member uses same team ID
# Analytics will be aggregated by team
Error Handling
Common error messages and solutions:
"OAuth authentication required"
Cause: Not authenticated or token expired
Solution: Run tribe login to re-authenticate
"tribecode collector binary not found"
Cause: Installation incomplete or corrupted
Solution: Reinstall with npx @_xtribe/cli --force
"No Claude logs found"
Cause: Claude Code CLI hasn't been used yet Solution: Use Claude Code CLI first to generate logs
"Permission denied"
Cause: Incorrect file permissions on collector binary Solution: Fix permissions or reinstall CLI
"Server connection failed"
Cause: Network issues or server unavailable Solution: Check internet connection and retry
Next Steps
Once you have tribecode commands working:
- View Analytics: Open https://tribecode.ai/tribe/analytics
- Explore Dashboard: Learn about usage patterns and insights
- Team Setup: Configure shared analytics for your team
- Troubleshooting: Check our troubleshooting guide for common issues
Support
If you encounter issues with CLI commands:
- Check
tribe statusfor current state - Review
tribe logsfor error messages - Verify authentication with
tribe auth-status - Consult the troubleshooting guide
- Join our community Discord for help