Command-Line Interface (CLI)
ExoGraph provides a powerful command-line interface for uploading documents and querying knowledge graphs directly from your terminal.
Installation
# Install from source
cd cli
pip install -e .
# Or with conda
conda activate exograph
cd cli
pip install -e .Quick Start
1. Configure API Key
Get your API key from exograph.ai → Settings → API Keys
exograph config set api-key exo_key_live_...2. Upload Documents
# Upload to private graph
exograph upload document.pdf --scope private
# Upload to world graph (shared)
exograph upload paper.pdf --scope world3. Query Knowledge Graphs
# Query world graph
exograph query "what is machine learning?" --scope world
# Query private graph
exograph query "tell me about X" --scope private
# Use specific model
exograph query "analyze this" --model ponder
# Save response to file
exograph query "explain transformers" --output response.mdCommands
exograph upload
Upload documents to ExoGraph.
Usage:
exograph upload <file> [options]Options:
--scope, -s: Graph scope (worldorprivate, default: from config)--progress, -p: Show upload progress--endpoint, -e: Override API endpoint
Examples:
# Single file upload
exograph upload document.pdf
# Upload with scope
exograph upload paper.pdf --scope private
# Upload with progress tracking
exograph upload large-doc.pdf --progressSupported Formats:
- PDF (
.pdf) - Microsoft Word (
.docx)
exograph query
Query ExoGraph knowledge graphs.
Usage:
exograph query <question> [options]Options:
--scope, -s: Graph scope (worldorprivate, default: from config)--model, -m: Model (snaporponder, default: from config)--graph-id, -g: Query specific graph by ID--output, -o: Save response to file--endpoint, -e: Override API endpoint
Examples:
# Simple query
exograph query "what is machine learning?"
# Query with model selection
exograph query "analyze this deeply" --model ponder
# Query specific graph
exograph query "what's in this document?" --graph-id graph_abc123
# Save response
exograph query "explain transformers" --output response.mdexograph list
List documents, graphs, or sessions.
Usage:
exograph list <resource> [options]Resources:
documents- List all documentsgraphs- List all graphs
Options:
--scope, -s: Filter by scope (worldorprivate)--verbose, -v: Show detailed information--endpoint, -e: Override API endpoint
Examples:
# List all documents
exograph list documents
# List private documents
exograph list documents --scope private
# List graphs with details
exograph list graphs --verboseexograph research
Manage research sessions.
Usage:
exograph research <command> [options]Commands:
start <topic>- Start a new research sessionlist- List research sessionsstatus <session-id>- Check research session statusdelete <session-id>- Delete a research session
Options:
--scope, -s: Research scope (worldorprivate, default: world)--mode: Research mode (auto,manual,systematic,curious,deep_dive, default: auto)--model: Model (snaporponder, default: ponder)--max-iterations: Maximum iterations (default: 1)--budget: Budget limit in credits--graph-id: Target graph ID
Examples:
# Start research
exograph research start "quantum computing" --scope world
# List research sessions
exograph research list --scope world
# Check status
exograph research status 550e8400-e29b-41d4-a716-446655440000
# Delete research session
exograph research delete 550e8400-e29b-41d4-a716-446655440000exograph document
Manage documents.
Usage:
exograph document <command> [options]Commands:
get <doc-id>- Get document detailsdelete <doc-id>- Delete a documentchunks <doc-id>- List chunks for a document
Options:
--scope, -s: Graph scope (worldorprivate, default: world)--endpoint, -e: Override API endpoint
Examples:
# Get document details
exograph document get 00f1e557-7080-472c-9527-1ee6a9d35652 --scope world
# List document chunks
exograph document chunks 00f1e557-7080-472c-9527-1ee6a9d35652
# Delete document
exograph document delete 00f1e557-7080-472c-9527-1ee6a9d35652exograph search
Search documents and entities.
Usage:
exograph search <resource> <query> [options]Resources:
documents- Search documents by semantic similarityentities- Search for entities in knowledge graphs
Options:
--scope, -s: Search scope (worldorprivate, default: world)--limit: Maximum number of results (default: 10)--endpoint, -e: Override API endpoint
Examples:
# Search documents
exograph search documents "machine learning" --scope world
# Search entities
exograph search entities "deep learning" --limit 5exograph graph
Manage knowledge graphs.
Usage:
exograph graph <command> [options]Commands:
create <name>- Create a new graphget <graph-id>- Get graph metadatashow <graph-id>- Show graph data (nodes and edges)delete <graph-id>- Delete a graph
Options:
--scope, -s: Graph scope (worldorprivate, default: world)--endpoint, -e: Override API endpoint
Examples:
# Create graph
exograph graph create "My Research Graph" --scope private
# Show graph data
exograph graph show world --scope world
# Delete graph
exograph graph delete graph_abc123 --scope privateexograph chat
Manage chat sessions and conversations.
Usage:
exograph chat <command> [options]Commands:
send <message>- Send a chat message (creates session if needed)create <title>- Create a new chat sessionsessions- List chat sessionsshow <session-id>- Show a chat session with all messagesdelete <session-id>- Delete a chat session
Options:
--scope, -s: Chat scope (worldorprivate, default: world)--model: Model (snaporponder, default: snap)--reasoning: Reasoning engine (rag,graph,web, default: graph)--session-id: Existing session ID forsendcommand--graph-id: Target specific graph ID--endpoint, -e: Override API endpoint
Models:
- snap: Fast responses for quick conversations
- ponder: Deep thinking for complex analysis
Examples:
# Send message (creates session automatically)
exograph chat send "Tell me about IBM" --scope world
# Create chat session
exograph chat create "ML Discussion" --model ponder --scope world
# List chat sessions
exograph chat sessions --scope world
# Show chat session
exograph chat show 61124873-a318-47be-9ffe-3d6e220df3d1
# Delete chat session
exograph chat delete 61124873-a318-47be-9ffe-3d6e220df3d1exograph config
Manage CLI configuration.
Usage:
exograph config <command> [options]Commands:
show- Display current configurationset <key> <value>- Set configuration valuereset- Reset to defaults
Configuration Keys:
api-key- Your ExoGraph API keyendpoint- API endpoint URL (default:https://exograph.ai)scope- Default graph scope (worldorprivate)model- Default model (snaporponder)
Examples:
# Show current config
exograph config show
# Set API key
exograph config set api-key exo_key_live_...
# Set default scope
exograph config set scope private
# Set default model
exograph config set model ponder
# Reset configuration
exograph config resetConfiguration
Configuration is stored in ~/.exograph/config.yaml:
api_key: exo_key_live_...
endpoint: https://exograph.ai
default_scope: world
default_model: snapYou can also use environment variables:
EXOGRAPH_API_KEY- API key (takes precedence over config file)EXOGRAPH_ENDPOINT- API endpoint (takes precedence over config file)
Graph Scopes
World Graph (world)
- Shared knowledge accessible to all users
- Contribute documents to earn tokens when others query your knowledge
- Default scope for new installations
Private Graph (private)
- Personal knowledge base isolated to your account
- Documents stay private and are only accessible to you
- Perfect for sensitive documents or personal research
Authentication
The CLI uses the same authentication system as the REST API:
- API Key Authentication: Set via
exograph config set api-keyorEXOGRAPH_API_KEYenvironment variable - Automatic User ID: The backend extracts your user ID from the API key automatically
- Secure Storage: API keys are stored locally in
~/.exograph/config.yaml
Get your API key from:
- Web UI: exograph.ai/app → Settings → API Keys
- Dashboard: Navigate to your profile settings
Examples
Complete Workflow
# 1. Configure CLI
exograph config set api-key exo_key_live_abc123...
exograph config set scope private
# 2. Upload documents
exograph upload research-paper.pdf --scope private
# ✓ Uploaded research-paper.pdf (doc_xyz789)
# ✓ Created graph graph_abc123
# 3. Query knowledge
exograph query "what is the main contribution of the paper?"
# [Response with sources and citations]
# 4. List documents
exograph list documents --scope private
# Shows all your private documents
# 5. Query world graph
exograph query "what is machine learning?" --scope world
# Queries shared knowledgeBatch Operations
# Upload multiple files (one at a time)
for file in *.pdf; do
exograph upload "$file" --scope private
done
# Query and save results
exograph query "explain transformers" --output transformers.md
exograph query "what is GPT?" --output gpt.mdTroubleshooting
API Key Not Configured
Error: API key not configured. Run 'exograph config set api-key <your-key>'Solution: Set your API key using exograph config set api-key <your-key>
Invalid or Expired API Key
Error: Invalid or expired API key. Check your configuration.Solution:
- Verify your API key is correct
- Check if the key has expired in the web UI
- Generate a new API key if needed
Network Errors
Error: Network error: Connection refusedSolution:
- Check your internet connection
- Verify the endpoint:
exograph config show - Try overriding endpoint:
exograph query "test" --endpoint http://localhost
File Upload Errors
Error: Unsupported file type: .txt. Only PDF and DOCX are supported.Solution: Convert your file to PDF or DOCX format before uploading
Advanced Usage
Local Development
For local development, override the endpoint:
exograph upload test.pdf --endpoint http://localhost
exograph query "test" --endpoint http://localhostScripting
The CLI is designed to be script-friendly:
#!/bin/bash
# Upload script
for file in documents/*.pdf; do
exograph upload "$file" --scope private
done
# Query script
response=$(exograph query "what is X?" --scope world)
echo "$response" > response.txtSee Also
- Getting Started Guide - API quick start
- Authentication - API authentication details
- API Reference - Complete API documentation
- MCP Integration - Model Context Protocol for AI clients