Summary
Add web search capability to ck via --web and --answer flags, allowing users to search the web alongside local files without leaving the terminal.
Motivation
ck already covers local search well across all modes (regex, semantic, lexical, hybrid). The missing piece is web search -- useful for looking up documentation, finding solutions, or answering programming questions while staying in the same workflow.
Currently users need to switch to a browser or a separate tool for web queries. Integrating web search into ck would make it a complete search tool for both local codebases and external knowledge.
Proposed Behavior
# Search the web and return raw results (URLs + snippets)
ck --web "Next.js 15 app router migration"
# Search the web and return a summarized answer
ck --web --answer "how to handle async errors in Rust"
# Combine with local search
ck --hybrid --web "authentication middleware" src/
--web flag
- Queries a web search provider and returns ranked results (title, URL, snippet)
- Can be combined with local search modes to merge local + web results
- Respects
--topk, --json, --jsonl output formats
--answer flag
- Takes web search results and generates a concise summarized answer
- Could use a local LLM (e.g., via ollama) or optionally an external API
- Works with
--web to answer questions directly in the terminal
Privacy Considerations
Ideally this follows ck's local-first philosophy:
- Local-first approach: Use a self-hosted search engine like SearXNG for web queries, or a local LLM for
--answer summarization
- Optional external API fallback: Support external providers (Brave Search, DuckDuckGo API, etc.) as opt-in via config or env var when a local engine isn't available
Example config:
[web]
provider = "searxng" # or "brave", "duckduckgo"
searxng_url = "http://localhost:8080"
brave_api_key = "" # only if using Brave
[answer]
provider = "ollama" # or "openai", "anthropic"
model = "llama3"
Agent Integration
This would also benefit the MCP server mode (ck --serve). Agents using ck could get web search results alongside local code search without needing a separate web search tool.
References
Summary
Add web search capability to ck via
--weband--answerflags, allowing users to search the web alongside local files without leaving the terminal.Motivation
ck already covers local search well across all modes (regex, semantic, lexical, hybrid). The missing piece is web search -- useful for looking up documentation, finding solutions, or answering programming questions while staying in the same workflow.
Currently users need to switch to a browser or a separate tool for web queries. Integrating web search into ck would make it a complete search tool for both local codebases and external knowledge.
Proposed Behavior
--webflag--topk,--json,--jsonloutput formats--answerflag--webto answer questions directly in the terminalPrivacy Considerations
Ideally this follows ck's local-first philosophy:
--answersummarizationExample config:
Agent Integration
This would also benefit the MCP server mode (
ck --serve). Agents using ck could get web search results alongside local code search without needing a separate web search tool.References
--weband--answerbut requires cloud upload of all files (not local-first)