Skip to content

AI CLI Setup Guide

This guide covers the installation of AI CLI tools required for the AI Comments feature.

Quick Start

Most users should install Claude Code - it has the easiest setup and includes web search capabilities needed for Fact Check and Glossary features.

Supported AI CLI Tools

ToolProviderBest ForWeb Search
Claude CodeAnthropicGeneral analysis, researchYes
Gemini CLIGoogleFast responsesNo
CodexOpenAICode-related contentYes

Claude Code is Anthropic's official CLI tool with built-in web search capabilities.

macOS / Linux

bash
# Install with official script
curl -fsSL https://claude.ai/install.sh | bash

After installation:

  1. Open a new terminal window
  2. Run claude to start authentication
  3. Log in with your Anthropic account

Verify installation:

bash
claude --version

Windows

Open PowerShell and run:

powershell
# Install with official script
irm https://claude.ai/install.ps1 | iex

After installation:

  1. Restart PowerShell
  2. Run claude to start authentication
  3. Log in with your Anthropic account

Verify installation:

powershell
claude --version
Alternative Installation Methods
  • npm: npm install -g @anthropic-ai/claude-code (requires Node.js 18+)
  • WSL: Use the Linux installation method inside WSL

See official documentation for detailed instructions.

Troubleshooting

If claude command is not found after installation:

  1. Restart terminal/PowerShell
  2. Verify the installation path is in your PATH environment variable
  3. See official documentation for system requirements

Gemini CLI

Google's Gemini CLI for fast AI responses.

macOS / Linux

bash
# Install with npm (Node.js 18+ required)
npm install -g @google/gemini-cli

# Or install with Homebrew
brew install gemini-cli

Authenticate:

bash
gemini auth

Verify installation:

bash
gemini --version

Windows

powershell
# Install with npm (Node.js 18+ required)
npm install -g @google/gemini-cli

Authenticate:

powershell
gemini auth

Verify installation:

powershell
gemini --version

Codex (OpenAI)

OpenAI's Codex CLI, particularly good for technical content.

macOS / Linux

bash
# Install with npm (Node.js 18+ required)
npm install -g @openai/codex

# Set OpenAI API key
export OPENAI_API_KEY="your-api-key"

Verify installation:

bash
codex --version

Windows

powershell
# Install with npm (Node.js 18+ required)
npm install -g @openai/codex

# Set OpenAI API key (permanent)
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your-api-key", "User")

# Restart PowerShell after setting environment variable

Verify installation:

powershell
codex --version

Verifying Setup in Social Archiver

After installing at least one AI CLI tool:

  1. Restart Obsidian - Required to detect newly installed CLI tools
  2. Open Timeline View - Navigate to any archived post
  3. Look for AI Comment banner - Should appear below archived posts
  4. Check Settings - Go to Settings > Social Archiver > AI Comments to configure defaults

Detection Issues

If the AI Comment banner doesn't appear:

  • Verify CLI installation with version command
  • Ensure CLI is authenticated
  • Check that the CLI is in your system PATH
  • Restart Obsidian completely (not just reload)

Next Steps

Once your AI CLI is set up, learn how to use AI Comments:

AI Comments Guide - Learn about comment types, settings, and best practices.

Released under the MIT License.