π A powerful CLI tool to interact with DuckDuckGo's AI
Advanced context integration, multi-models and enhanced productivity
π§ Now with Intelligent Analytics, Context Optimization & Persistent History
Features β’ Installation β’ Usage β’ Configuration β’ Intelligent Features β’ Reverse Engineering
- π Real-time streaming - Live response display with smooth markdown formatting
- π€ Multiple AI models - GPT-4o mini, Claude 3 Haiku, Llama 3.3, Mistral Small, o4-mini & more
- π» Terminal-native - Optimized for command-line workflows with interactive menus
- β¨οΈ Smart autocompletion - Interactive command menus and context-aware suggestions
- π Auto-authentication - Seamless session management with dynamic header refresh
- π Model switching - Interactive model selection during conversations
- π Smart Analytics - Real-time session statistics with API monitoring, performance metrics, and usage insights
- π― Context Optimization - Automatic context compression and importance scoring to maintain conversation quality
- πΎ Persistent History - Intelligent session management with compression, recovery, and searchable archive
- π Performance Tracking - Monitor success rates, error patterns, token usage, and optimization effectiveness
- π Web search - Integrate DuckDuckGo search results into conversations
- π File processing - Add local file content (15+ formats: Go, Python, JS, TS, JSON, MD, etc.)
- π URL scraping - Extract and analyze webpage content with Chrome-based scraping
- π Project analysis - Generate comprehensive project prompts with PMP auto-installation
- πΎ Session persistence - Maintain conversation history across sessions
- π Library management - Organize and search through document collections
- βοΈ Command Chaining - Chain multiple commands (e.g.,
/url,/file,/search) using&&to build a combined context before sending a final prompt with--.
- π Smart clipboard - Copy responses, code blocks, or full conversations with interactive selection
- π€ Advanced export - Save conversations in multiple formats with search-based filtering
- π History management - Browse your conversation history with intelligent search
- π Content search - Search within conversations and document libraries
- βοΈ Interactive config - Visual configuration menus for all settings
- π¨ Rich formatting - Colored output with markdown rendering
- β‘ Performance - Efficient memory usage and fast response times
- π REST API - Built-in HTTP server for external integrations
- π‘ Real-time endpoints - Chat, history, and status endpoints
- π§ Request logging - Configurable API request/response logging
- π Auto-documentation - Interactive API documentation at root endpoint
- π Document collections - Organize files into searchable libraries
- π Advanced search - Search across all libraries with pattern matching
- π Library stats - File counts, sizes, and modification dates
- π― Selective loading - Load specific libraries or files into context
- π Multi-format support - 15+ file formats automatically recognized
- π οΈ PMP Integration - Auto-install and use Prompt My Project for code analysis
- π Dynamic headers - Automatic browser session management
- π± Cross-platform - Linux, Windows, macOS support
- π Chain multiple commands - Execute a series of commands in a single line using
&& - π‘ Context accumulation - Combine context from files, URLs, and web searches
- π£οΈ Final prompt - Use
--to add a final prompt to the accumulated context for the AI to process
# Chain multiple commands to build a rich context before asking a question
You: /url https://devbyben.fr/about && /search devbyben.fr twitter account && /file ~/Documents/my_notes.md -- Based on all this, write a summary.The CLI now tracks comprehensive real-time metrics:
- Performance Metrics: API call timing, success/failure rates, retry counts
- Content Analysis: Message counts, token estimation, context optimization savings
- Error Tracking: 418/429 error monitoring, VQD refresh rates, header refresh frequency
- Usage Patterns: Command usage statistics, model changes, file/URL processing
- Session Duration: Total time spent in the session, average response times
Commands:
/stats- View current session analytics anytime- Automatic display on
/exitwith detailed session summary
Automatically manages conversation context for optimal performance:
- Intelligent Compression: Compresses old context when approaching token limits
- Importance Scoring: Preserves critical information while removing redundant content
- Memory Efficiency: Reduces token usage by up to 40% while maintaining quality
- Configurable Thresholds: Customize optimization triggers and compression ratios
- Automatic Context Management: Automatically compresses and optimizes context as needed
Never lose important conversations:
- Session Persistence: Automatically saves conversations with metadata
- Compression Storage: Efficient gzip compression reduces storage by 70%
- Session Recovery: Resume conversations from any previous session
- Intelligent Indexing: Fast search and retrieval of historical conversations
- Searchable Archive: Use
/historyto browse and search past conversations - Session Loading: Load previous sessions interactively or by ID with
/load
| Model Name | Integration ID | Alias | Strength | Best For | Characteristics |
|---|---|---|---|---|---|
| GPT-4o mini | gpt-4o-mini | gpt-4o-mini | General purpose | Everyday questions | β’ Fast β’ Well-balanced |
| Claude 3 Haiku | claude-3-haiku-20240307 | claude-3-haiku | Creative writing | Explanations & summaries | β’ Clear responses β’ Concise |
| Llama 3.3 70B | meta-llama/Llama-3.3-70B-Instruct-Turbo | llama | Programming | Code-related tasks | β’ Technical precision β’ Detailed |
| Mistral Small | mistralai/Mistral-Small-24B-Instruct-2501 | mixtral | Knowledge & analysis | Complex topics | β’ Reasoning β’ Logic-focused |
| o4-mini | o4-mini | o4mini | Speed | Quick answers | β’ Very fast β’ Compact responses |
πͺ Windows (PowerShell)
$exe="duckduckgo-chat-cli_windows_amd64.exe"; Invoke-WebRequest -Uri ((Invoke-RestMethod "https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest").assets | Where-Object name -like "*windows_amd64.exe").browser_download_url -OutFile $exe; Start-Process -Wait -NoNewWindow -FilePath ".\$exe"π§ Linux (curl)
curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest | grep -oP 'https.*linux_amd64' | grep -oP 'https.*v[0-9]+\.[0-9]+\.[0-9]+_linux_amd64' | head -1) && chmod +x duckduckgo-chat-cli_v*_linux_amd64 && ./duckduckgo-chat-cli_v*_linux_amd64π MacOS (curl)
Apple Silicon (ARM64):
curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest | grep -oP 'https.*darwin_arm64' | grep -oP 'https.*v[0-9]+\.[0-9]+\.[0-9]+_darwin_arm64' | head -1) && chmod +x duckduckgo-chat-cli_v*_darwin_arm64 && ./duckduckgo-chat-cli_v*_darwin_arm64Intel (AMD64):
curl -LO $(curl -s https://api.github.com/repos/benoitpetit/duckduckGO-chat-cli/releases/latest | grep -oP 'https.*darwin_amd64' | grep -oP 'https.*v[0-9]+\.[0-9]+\.[0-9]+_darwin_amd64' | head -1) && chmod +x duckduckgo-chat-cli_v*_darwin_amd64 && ./duckduckgo-chat-cli_v*_darwin_amd64π Prerequisites:
- Go 1.21+ (
go version) - Chrome/Chromium 115+ (
chromium-browser --version)
git clone https://github.com/benoitpetit/duckduckGO-chat-cli
cd duckduckGO-chat-cli
./scripts/build.shβοΈ Example 1: Command Chaining
# Chain multiple commands to build a rich context before asking a question
You: /url https://devbyben.fr/about && /search devbyben.fr twitter account && /file ~/Documents/my_notes.md -- Based on all this, write a summary.π Example 2: Code Analysis
./duckduckgo-chat-cli_linux_amd64
Accept terms? [yes/no] yes
Type /help to show available commands
You: /search Go concurrency patterns -- What are the best practices?
π Searching for: Go concurrency patterns
β
Added 10 search results to the context
Processing your request about the search results...
You: /file main.go -- Explain this code and suggest improvements
π Adding file content: main.go
β
Successfully added content from file: main.go
Processing your request about the file...
GPT-4o mini: Based on the search results about Go concurrency patterns and your code...
[Detailed analysis follows]
You: /stats
π§ SESSION ANALYTICS SUMMARY
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Session Performance
Duration: 8.5m | Messages: 6 | Avg Response: 1.1s
API Success Rate: 100% (3/3 calls)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
You: /copy
Choose what to copy:
1) Last Q&A exchange
2) Largest code block
3) Cancel
Enter your choice: 2
β
Content copied to clipboardποΈ Example 3: Session Loading
# List and interactively select a previous session to restore
You: /load
# Or load a session directly by its ID
You: /load 12345
# The chat context and history will be restored for continued conversation.| Command | Example | Description |
|---|---|---|
π /search <query> [-- prompt] |
/search machine learning -- What are the best practices? |
Add search results as context and optionally process them with a prompt |
π /file <path> [-- prompt] |
/file src/main.go -- Explain this code |
Import file content as context and optionally analyze it with a prompt |
π /library [command] [args] |
/library add /path/to/docs |
Manage library directories for bulk file operations |
π /url <link> [-- prompt] |
/url github.com/golang -- Summarize this page |
Add webpage content as context and optionally process it with a prompt |
π¦ /pmp [path] [options] [-- prompt] |
/pmp . -i "*.go" -e "test/*" |
Generate structured project prompts with automatic PMP installation |
π /prompt or /prompt add <name> -- <prompt> |
/prompt or /prompt add myprompt -- This is my prompt |
Manage and load custom prompts. /prompt opens the interactive menu; subcommands are also available. |
π /stats β¨ |
/stats |
Show real-time session analytics and performance metrics |
π‘ /api [port] |
/api or /api 8080 |
Start or stop the API server |
π€ /model |
/model or /model 2 |
Change AI model (interactive) |
π§Ή /clear |
/clear |
Reset conversation context (with session save) |
π€ /export |
/export |
Export content (interactive) |
π /copy |
/copy |
Copy to clipboard (interactive) |
π /history |
/history |
Display conversation history |
π /load [session_id] |
/load or /load 12345 |
Load and restore a previous session interactively or by ID |
βοΈ /config |
/config |
Modify configuration settings |
π·οΈ /version |
/version |
Show version and system info |
π /update |
/update or /update --force |
Update the CLI to the latest version |
β /help |
/help |
Show available commands |
πͺ /exit |
/exit |
Exit application (with analytics) |
/prompt: Open the interactive prompt management menu (list, add, edit, remove)/prompt list: List all saved prompts/prompt add <name> -- <prompt>: Add a new prompt/prompt edit <name> -- <prompt>: Edit an existing prompt/prompt remove <name>: Remove a prompt/prompt load <name>: Send the prompt content as a message to the model
Note:
/promptis not chainable and does not support chaining with&&. The--is only for separating the prompt text, not for chaining.
| Option | Description | Default | Range |
|---|---|---|---|
DefaultModel |
Starting AI model | gpt-4o-mini | 5 models available |
GlobalPrompt |
System prompt always sent | "" | Any text |
ExportDir |
Export directory | ~/Documents/duckchat | Any valid path |
ShowMenu |
Display commands on start | true | true/false |
AnalyticsEnabled β¨ |
Enable session analytics | true | true/false |
| Option | Description | Default | Range |
|---|---|---|---|
MaxResults |
Results per search | 10 | 1-20 |
IncludeSnippet |
Show result descriptions | true | true/false |
| Option | Description | Default | Range |
|---|---|---|---|
Enabled |
Enable library system | true | true/false |
Directories |
List of library paths | [] | Array of paths |
| Option | Description | Default | Range |
|---|---|---|---|
Enabled |
Enable API server | false |
true/false |
Port |
API server port | 8080 |
Any valid port |
Autostart |
Start API on app launch | false |
true/false |
π‘ Tip: Use
/configto modify these settings interactively.
The CLI includes an integrated update system that keeps your installation current:
- π Automatic Check: Checks for new versions every 24 hours at startup
- π SHA256 Verification: Verifies downloaded binaries for security
- π― Cross-Platform: Works on Linux, Windows, and macOS
- β‘ In-Place Update: Updates the current binary without changing location
- π Backup & Restore: Creates backups and restores on failure
# Check for updates and install (with confirmation)
/update
# Force update without confirmation
/update --force
# The CLI will also prompt you when updates are available:
π A new version is available!
Current: 1.1.9
Latest: 1.2.0
π‘ Run '/update' to update to the latest version.- Detection: Detects your OS and architecture automatically
- Download: Downloads the correct binary from GitHub releases
- Verification: Verifies SHA256 checksum for security
- Installation: Replaces the current binary with the new version
- Restart: Prompts you to restart the CLI to use the new version
This project uses GitHub Actions for automated building and releasing:
- Development: Work on the
masterbranch - Release: Create PR to
prodbranch to trigger automatic release - CI/CD: Automated testing, building, and publishing
- π§ CI/CD & Release Process - Complete GitHub Actions documentation
- π¬ Reverse Engineering - Complete technical reverse engineering documentation
If you encounter connection errors:
# Try clearing the conversation context to refresh security tokens
/clear
# Check your Chrome/Chromium installation
chromium-browser --version
# Enable debug mode
DEBUG=true ./duckduckgo-chat-cli_linux_amd64
# View session analytics for debugging
/stats- Privacy First: This tool respects your privacy and stores no personal data
- Verify Information: Always verify critical information from AI responses
- Responsible Use: Use responsibly and in accordance with DuckDuckGo's terms
π§ This is an unofficial client and not affiliated with or endorsed by DuckDuckGo
Made with β₯ for the community
|
