Welcome to Tana CLI! This guide will help you get started with the command-line tools for Tana.
Welcome to Supertag CLI! This guide will help you get started with the command-line tools for Tana.
Before installing Supertag CLI, make sure you have:
No additional runtime or dependencies are required - Supertag CLI is distributed as standalone executables.
Download the latest release from GitHub:
Or build from source:
git clone https://github.com/jcfischer/supertag-cli.git
cd supertag-cli
bun install
bun run build
# Extract the downloaded archive
unzip supertag-cli-*.zip
cd supertag-cli
To run supertag from anywhere:
# Option A: Symlink to /usr/local/bin (recommended)
sudo ln -s $(pwd)/supertag /usr/local/bin/supertag
sudo ln -s $(pwd)/export/supertag-export /usr/local/bin/supertag-export
# Option B: Add to PATH in your shell config
echo 'export PATH="$PATH:/path/to/supertag-cli"' >> ~/.zshrc
source ~/.zshrc
The export tool requires Playwright for browser automation. Install it once:
cd export
npm install
This installs the Playwright browser automation library needed for supertag-export.
Supertag CLI needs your API token to create nodes in Tana.
Choose one method:
# Method A: Environment variable (recommended for scripts)
export TANA_API_TOKEN="your-token-here"
# Method B: Save to config file
supertag config --token your-token-here
# Method C: Pass with each command
supertag create todo "Task" --token your-token-here
supertag config --show
To search and query your Tana data locally, you need to export and index your workspace.
The easiest way to configure workspaces is to let the export tool discover them automatically:
# Login to Tana (opens browser for authentication)
supertag-export login
# Discover all your workspaces
supertag-export discover
# Auto-add discovered workspaces with --add flag
supertag-export discover --add
This automatically captures the rootFileId needed for exports and configures your workspaces.
If you prefer manual configuration:
# Add your workspace with the rootFileId from discover
supertag workspace add M9rkJkwuED --alias main
# Or if you have multiple workspaces
supertag workspace add M9rkJkwuED --alias personal
supertag workspace add 7e25I56wgQ --alias work
# Set your default workspace
supertag workspace set-default main
The login opens a browser window. Log in to Tana as usual (via Google or email). Once you see your workspace, close the browser. Your session is saved for future exports.
Note: On first run, Chromium browser (~300 MB) downloads automatically.
# Export default workspace
supertag-export run
# Export with verbose output (see auth method used)
supertag-export run -v
Verbose output shows the authentication flow:
[supertag-export] Using cached token
[supertag-export] Token valid (expires in 57 minutes, method: cached)
[supertag-export] Workspace: π Personal Tana
[supertag-export] Nodes: 47,832, Size: 35.2MB
[supertag-export] Downloading snapshot...
[supertag-export] Saved to: ~/Documents/Tana-Export/personal/M9rkJkwuED@2025-12-09.json
Export is fast - uses Tana's API directly (no browser automation needed):
Export locations by platform:
~/Documents/Tana-Export/~/.local/share/supertag/exports/supertag sync index
This creates a local SQLite database for fast searching:
Indexing workspace export...
β Indexed 47,832 nodes in 0.4s
# Check database stats
supertag stats
# Try a search
supertag search "meeting"
Create nodes with any supertag directly from the command line:
# Create a todo
supertag create todo "Buy groceries" --status active
# Create a todo with due date
supertag create todo "Submit report" --status active --duedate 2025-12-31
# Create a meeting note
supertag create meeting "Team Standup" --date 2025-12-08
# Create with multiple supertags
supertag create video,towatch "Tutorial Video" --url https://youtube.com/watch?v=xxx
# Full-text search
supertag search "project planning"
# Limit results
supertag search "AI" --limit 5
# Find by supertag
supertag search --type tagged meeting --limit 10
# Semantic search (requires embeddings)
supertag search --type semantic "productivity tips"
# Show node with depth traversal (children)
supertag nodes show <node-id> -d 3 # 3 levels deep
supertag nodes show <node-id> -d 2 --json # JSON output with depth
# Database statistics
supertag stats
# Embedding statistics
supertag stats --type embed
# Most used supertags
supertag tags --top --limit 20
# List all supertags
supertag tags list
Manage personal and work workspaces separately.
Automatic Discovery (Recommended):
# Login first
supertag-export login
# Discover all workspaces (captures rootFileId automatically)
supertag-export discover
# Auto-add all discovered workspaces
supertag-export discover --add
# Or update existing workspaces with rootFileIds
supertag-export discover --update
Manual Setup:
If you prefer manual configuration, use supertag-export discover first to find your workspace's rootFileId:
# Add workspace with rootFileId (primary identifier for exports)
supertag workspace add M9rkJkwuED --alias personal
# List configured workspaces
supertag workspace list
# Set default workspace
supertag workspace set-default personal
# Query specific workspace
supertag search "budget" -w work
# Export all workspaces
supertag-export run --all
# Export a specific workspace
supertag-export run -w work
Important: Each workspace needs a
rootFileIdfor exports to work. Usesupertag-export discoverto find it automatically.
Run a local server for integrations:
# Start server
supertag server start --port 3100
# Start as background daemon
supertag server start --daemon
# Check status
supertag server status
# Stop server
supertag server stop
API Endpoints:
GET /health - Health checkGET /help - API documentationPOST /search - Unified search ({"query": "term", "type": "fts|semantic|tagged"})GET /stats - Statistics (?type=all|db|embed|filter)GET /nodes/:id - Get node by ID with depth traversalGET /tags - List all supertagsGET /tags/top - Top supertags by usageGET /tags/:name - Get supertag schemaSee WEBHOOK-SERVER.md for complete API documentation.
Semantic search finds nodes by meaning, not just keywords. Unlike full-text search which requires exact word matches, semantic search understands concepts and context.
Prerequisites:
Semantic search requires the sqlite-vec extension for vector operations. Install it for your platform:
macOS (Homebrew):
brew install asg017/sqlite-vec/sqlite-vec
This installs the extension to /opt/homebrew/lib/sqlite-vec/vec0.dylib (Apple Silicon) or /usr/local/lib/sqlite-vec/vec0.dylib (Intel).
macOS (Manual):
# Download the latest release
curl -L https://github.com/asg017/sqlite-vec/releases/latest/download/sqlite-vec-0.1.6-loadable-macos-aarch64.tar.gz -o sqlite-vec.tar.gz
# Extract
tar xzf sqlite-vec.tar.gz
# Move to library location
sudo mkdir -p /opt/homebrew/lib/sqlite-vec
sudo mv vec0.dylib /opt/homebrew/lib/sqlite-vec/
Linux:
# Download for your architecture
curl -L https://github.com/asg017/sqlite-vec/releases/latest/download/sqlite-vec-0.1.6-loadable-linux-x86_64.tar.gz -o sqlite-vec.tar.gz
# Extract and install
tar xzf sqlite-vec.tar.gz
sudo mkdir -p /usr/local/lib/sqlite-vec
sudo mv vec0.so /usr/local/lib/sqlite-vec/
Windows:
# Download from GitHub releases
# https://github.com/asg017/sqlite-vec/releases
# Extract vec0.dll to a known location, e.g.:
# C:\sqlite-vec\vec0.dll
Supertag CLI automatically searches for the extension in standard locations. To specify a custom path:
# Set custom extension path
export SQLITE_VEC_PATH="/path/to/vec0.dylib"
Setup:
# 1. Install Ollama (recommended provider)
# Download from https://ollama.ai
# 2. Pull the embedding model
ollama pull mxbai-embed-large
# 3. Configure Supertag CLI
supertag embed config --provider ollama --model mxbai-embed-large
# 4. Generate embeddings (one-time, ~5-10 minutes for 300K nodes)
supertag embed generate
# 5. Check status
supertag stats --type embed
Search:
# Basic semantic search
supertag search --type semantic "project planning discussions"
# With more results
supertag search --type semantic "authentication issues" --limit 20
# Include ancestor context
supertag search --type semantic "meeting notes" --include-ancestor
# Minimum similarity threshold
supertag search --type semantic "project ideas" --min-similarity 0.7
# JSON output
supertag search --type semantic "tasks" --format json
How it works:
_TRASH ancestors are filtered outCLI Results Format:
Semantic search returns Tana Paste references using [[Name^nodeID]] syntax. These are proper references to existing nodes - clicking them in Tana will navigate to the actual node (not create duplicates).
Webhook API Results:
The webhook server returns results as a formatted Tana table with three columns:
- Semantic Search Results %%view:table%%
- [[Found Node Name^nodeID]]
- Ancestor:: [[Parent Node^parentID]]
- Similarity:: 85%
- [[Another Result^nodeID2]]
- Ancestor:: [[Parent^parentID2]]
- Similarity:: 72%
Each result includes:
Webhook API Examples:
# Semantic search via HTTP (returns Tana table format)
curl -X POST http://localhost:3100/semantic-search \
-H "Content-Type: application/json" \
-d '{"query": "productivity tips", "limit": 10}'
# JSON format response (for programmatic access)
curl -X POST http://localhost:3100/semantic-search \
-H "Content-Type: application/json" \
-d '{"query": "productivity tips", "limit": 10, "format": "json"}'
Known Limitation:
Some deleted nodes may occasionally appear in results because Tana's JSON export doesn't include comprehensive deletion metadata. The tool filters nodes with _TRASH ownership patterns, but cannot detect all deletion states from exports alone.
View and use your custom supertags:
# Sync schema from latest export
supertag schema sync
# List all supertags
supertag schema list
# Show fields for a supertag
supertag schema show todo
# Search supertags
supertag schema search project
Remove old export files to save disk space:
# Show what would be deleted (dry run)
supertag sync cleanup --dry-run
# Delete old exports, keep last 7 (default)
supertag sync cleanup
# Keep custom number of files
supertag sync cleanup --keep 5
# Clean up all workspaces
supertag sync cleanup --all
Configure in ~/.config/supertag/config.json:
{
"cleanup": {
"keepCount": 7,
"autoCleanup": false
}
}
Set autoCleanup: true to automatically clean up after each sync.
The MCP (Model Context Protocol) server enables Tana integration with AI tools like ChatGPT Desktop, Cursor, VS Code Copilot, Claude Code, and other MCP-compatible applications. MCP is the emerging industry standard for AI-tool integration, supported by Anthropic, OpenAI, Google, and Microsoft.
Think of MCP as "USB-C for AI" - a universal standard that lets any AI assistant access your Tana data. The supertag-mcp binary runs locally on your machine as a subprocess - no server setup, no cloud hosting, no network exposure needed.
| Tool | Description | Example Use |
|---|---|---|
tana_search |
Full-text search across workspace | "Search my Tana for project planning notes" |
tana_semantic_search |
Vector similarity search (requires embeddings) | "Find notes about knowledge management" |
tana_tagged |
Find nodes by supertag | "Find all my todos" |
tana_stats |
Database statistics | "How many nodes are in my Tana?" |
tana_supertags |
List all supertags | "What supertags do I have?" |
tana_node |
Get node contents with depth | "Show me node abc123 with its children" |
tana_create |
Create new nodes with references | "Create a todo linked to node abc123" |
tana_sync |
Trigger reindex or check status | "Reindex my Tana database" |
The Tana Input API does not support inline reference syntax ([[text^nodeId]]) in node names. If you ask an AI to create a node "with a link to X", the AI should use the children parameter, not inline syntax.
Correct way to create a node with a reference:
{
"supertag": "todo",
"name": "Follow up on feedback form",
"children": [{"name": "NetSec Feedback Form", "id": "dvpAO46vtnrx"}]
}
This creates a todo with a child reference that links to the existing node.
Before setting up MCP, ensure you have:
supertag sync index at least oncetana_create): Configure via supertag config --token YOUR_TOKENtana_create): Run supertag schema syncClaude Desktop was the first app to support MCP (November 2024).
macOS: Edit ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: Edit %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp",
"env": {
"TANA_WORKSPACE": "personal"
}
}
}
}
After saving, restart Claude Desktop. You should see Tana tools available in the tools menu.
Add to ~/.claude/mcp.json:
{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp",
"env": {
"TANA_WORKSPACE": "personal"
}
}
}
}
Restart Claude Code to load the MCP server.
ChatGPT Desktop added MCP support in March 2025.
macOS: Edit ~/Library/Application Support/ChatGPT/chatgpt_config.json
Windows: Edit %APPDATA%\ChatGPT\chatgpt_config.json
{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp"
}
}
}
Restart ChatGPT Desktop after saving.
Cursor has excellent MCP support for code-focused workflows.
~/.cursor/mcp.json:{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp"
}
}
}
VS Code supports MCP through the GitHub Copilot extension.
Edit .vscode/mcp.json in your project or user settings:
{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp"
}
}
}
Windsurf (Codeium's AI IDE) supports MCP natively.
Add to Windsurf settings (Settings β MCP Servers):
{
"tana": {
"command": "/path/to/supertag-mcp"
}
}
On Windows, use the full path to the executable:
{
"mcpServers": {
"tana": {
"command": "C:\\path\\to\\supertag-mcp.exe"
}
}
}
| Variable | Description | Default |
|---|---|---|
TANA_WORKSPACE |
Workspace alias to use | Default workspace |
DEBUG |
Enable debug logging | false |
SERVICE_NAME |
Service name for logs | supertag-mcp |
Use the MCP Inspector to test your server:
npx @modelcontextprotocol/inspector /path/to/supertag-mcp
This opens a web interface where you can:
Searching:
"Search my Tana for notes about authentication" β Uses
tana_searchto find relevant nodes
Finding by tag:
"Show me all my meeting notes from this week" β Uses
tana_taggedwith the meeting supertag
Creating nodes:
"Create a todo to review the pull request" β Uses
tana_createto add a new todo node
Exploring structure:
"What supertags do I have in my workspace?" β Uses
tana_supertagsto list all tags
Database maintenance:
"Reindex my Tana database" β Uses
tana_syncto trigger reindexing
Tools not appearing:
supertag-mcp path is absolutetail -f ~/.local/state/supertag/logs/*.log"Database not found" errors:
supertag sync index # Index your export first
"Schema registry empty" errors (for tana_create):
supertag schema sync # Sync schema from export
"API token not configured" errors (for tana_create):
supertag config --token YOUR_TOKEN
Debug mode:
{
"mcpServers": {
"tana": {
"command": "/path/to/supertag-mcp",
"env": {
"DEBUG": "true"
}
}
}
}
You can use Supertag MCP tools with local LLMs running in Ollama. This provides completely offline, private AI access to your Tana data - no cloud API required.
Why use Ollama?
Prerequisites:
Step 1: Install mcphost
# macOS (recommended)
brew install mcphost
# Or build from source (requires Go)
go install github.com/mark3labs/mcphost@latest
Step 2: Configure MCP servers
Create ~/.mcp.json (mcphost's config file):
{
"mcpServers": {
"supertag": {
"command": "/path/to/supertag-mcp",
"args": []
},
"datetime": {
"command": "/path/to/datetime-mcp",
"args": []
}
}
}
Replace the paths with actual paths to your binaries.
Why datetime-mcp? Local LLMs don't have real-time awareness - they don't know the current date or time. The
datetimeMCP providesget_current_datetimeandget_date_infotools so your local LLM can answer questions like "what day is it?" or "show my meetings for today".
Step 3: Pull a tool-calling model
Not all models support tool calling well. Recommended models:
# Recommended - fast and reliable tool calling
ollama pull qwen2.5:7b
# Alternatives
ollama pull llama3.1:8b
ollama pull mistral:7b
Note: Smaller models (1B-3B) may struggle with tool calling. 7B+ parameter models work best.
Step 4: Run mcphost
Interactive mode (chat with your Tana data):
mcphost --quiet -m ollama:qwen2.5:7b
Tip: Use
--quietto reduce visual noise from MCP server initialization messages.
Now you can chat naturally:
> What's the date today?
> What supertags do I have?
> Find all my todos
> Search for notes about authentication
Single prompt mode (for scripts):
mcphost --quiet -m ollama:qwen2.5:7b -p "List the top 5 supertags in workspace 'main'"
Example output:
Executing supertag__tana_supertags...
The top 5 supertags in the 'main' workspace are:
1. meeting (2190 nodes)
2. todo (1847 nodes)
3. contact (956 nodes)
4. project (543 nodes)
5. note (412 nodes)
Supported Models:
| Model | Tool Calling | Speed | Notes |
|---|---|---|---|
qwen2.5:7b |
Excellent | Fast | Recommended - best balance |
qwen2.5:14b |
Excellent | Medium | More capable, needs more RAM |
llama3.1:8b |
Good | Fast | Good alternative |
mistral:7b |
Fair | Fast | Works but less reliable |
deepseek-r1:7b |
Good | Medium | Good reasoning |
We tested multiple models with the query "List all my meetings in workspace 'main' for today" to evaluate MCP tool-calling capabilities and date awareness.
Test Results (December 2025):
| Model | Tool Execution | Date Awareness | Result |
|---|---|---|---|
| Claude Code | β Correct | β Real-time | 5 meetings - Uses actual date (2025-12-11) |
qwen2.5:7b |
β Works | β Training cutoff | Returns wrong results without explicit date |
llama3.1:8b |
β Works | β Training cutoff | Returns wrong results without explicit date |
qwen2.5:14b |
β Failed | N/A | Outputs tool call as text |
mistral:7b |
β Failed | N/A | Recognizes but doesn't execute |
Critical Finding: Date Awareness
The key difference between Claude Code and local LLMs is date awareness:
2023-10-17) when asked about "today"When told to use datetime tool first:
"First get the current date using the datetime tool, then list my meetings for that date"
qwen2.5:7b correctly chains: get_current_datetime β gets "2025-12-11" β tana_tagged β 5 meetings β
Without explicit instruction:
"List meetings for today"
Local LLMs skip the datetime tool and use training cutoff dates β wrong results β
Today's 5 Meetings (December 11, 2025):
Recommendations:
get_current_datetime firstqwen2.5:7b - most reliable tool execution when given proper parametersTroubleshooting Ollama:
"Model doesn't call tools"
"mcphost not found"
eval "$(/opt/homebrew/bin/brew shellenv)""Connection refused"
ollama serveollama listKeep your local database up-to-date:
# Manual: Export and index
supertag-export run && supertag sync index
# Or use the daily script (includes cleanup)
./tana-daily
# Skip cleanup
./tana-daily --no-cleanup
# Cleanup only
./tana-daily --cleanup
macOS LaunchAgent (runs daily at 6 AM):
cp launchd/ch.invisible.tana-daily.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/ch.invisible.tana-daily.plist
# Set your token
supertag config --token your-token-here
# Verify
supertag config --show
You need to export and index first:
supertag-export login # First time only
supertag-export run # Export workspace
supertag sync index # Index the export
Chromium auto-installs on first run. If it fails:
cd export
npx playwright install chromium
supertag-export statussupertag-export loginAuth troubleshooting (use -v flag to see auth method):
supertag-export run -v
Output shows which auth method was used:
Using cached token - Fast path (~0.7s)Token refreshed via API - Automatic refresh (~1s)Extracting token from browser - Fallback (~8s)If exports consistently fail, clear the auth cache and re-login:
rm ~/.cache/supertag/auth-token.json
supertag-export login
supertag statssupertag sync indexThe sqlite-vec extension is required for semantic search. Install it:
# macOS (Homebrew - recommended)
brew install asg017/sqlite-vec/sqlite-vec
# Verify installation
ls /opt/homebrew/lib/sqlite-vec/vec0.dylib
If installed in a non-standard location, set the path:
export SQLITE_VEC_PATH="/path/to/vec0.dylib"
See Semantic Search Prerequisites for full installation instructions.
supertag paths
macOS Output:
π Supertag CLI Paths:
Config: ~/.config/supertag/
Data: ~/.local/share/supertag/
Cache: ~/.cache/supertag/
Database: ~/.local/share/supertag/supertag-index.db
Exports: ~/Documents/Tana-Export/
Linux Output:
π Supertag CLI Paths:
Config: ~/.config/supertag/
Data: ~/.local/share/supertag/
Cache: ~/.cache/supertag/
Database: ~/.local/share/supertag/supertag-index.db
Exports: ~/.local/share/supertag/exports/
Note: Uses
supertagnamespace to avoid conflicts with the official Tana app.
Note: Supertag CLI follows the XDG Base Directory Specification on all platforms. You can override paths using environment variables like
XDG_CONFIG_HOME,XDG_DATA_HOME, etc.
supertag --help
supertag search --help
supertag create --help
Supertag CLI is open source! Contributions are welcome via pull requests on GitHub.
| Task | Command |
|---|---|
| Set API token | supertag config --token TOKEN |
| Discover workspaces | supertag-export discover |
| Add workspace | supertag workspace add ROOTFILEID --alias NAME |
| Set default workspace | supertag workspace set-default NAME |
| List workspaces | supertag workspace list |
| Login for export | supertag-export login |
| Export workspace | supertag-export run |
| Export (verbose) | supertag-export run -v |
| Export status | supertag-export status |
| Index export | supertag sync index |
| Cleanup old exports | supertag sync cleanup |
| Search | |
| Full-text search | supertag search "term" |
| Semantic search | supertag search --type semantic "concept" |
| Find by tag | supertag search --type tagged meeting |
| Nodes | |
| Show node | supertag nodes show <id> |
| Show with children | supertag nodes show <id> -d 3 |
| Tags | |
| List supertags | supertag tags list |
| Top supertags | supertag tags --top |
| Stats | |
| Database stats | supertag stats |
| Embedding stats | supertag stats --type embed |
| Other | |
| Create todo | supertag create todo "Task" --status active |
| Start server | supertag server start --daemon |
| View paths | supertag paths |
| MCP Server | |
| Test MCP server | npx @modelcontextprotocol/inspector supertag-mcp |
Supertag CLI is open source software, developed by InVisible GmbH, Switzerland. View on GitHub
Tana CLI is developed by InVisible GmbH, Switzerland.