Introducing /monitor. Notify your AI agent the moment pages or sites change. Try it now โ†’

How to add basic web search from the command line

Basic web search from the command line means sending a query to a search API and receiving ranked results as structured text, without a browser. The two main approaches are calling a search API directly with curl or using a dedicated CLI tool that handles authentication, output formatting, and pagination for you.

ApproachSetupOutput formatBest for
curl + search APIAPI key, manual auth headersRaw JSONScripting, one-off lookups
Dedicated CLI toolInstall once, store keyFormatted text or JSONInteractive use, shell pipelines
Search-enabled agent CLIInstall onceLLM-ready markdownAI agents, code assistants
Browser automationHeadless browser runtimeFull HTMLSites that block API access

Command-line search is most useful when you need to pull live web results into a shell script, feed real-time data to a local model, or run a quick lookup without leaving the terminal. The minimum setup is a search API key and one curl call.

The Firecrawl CLI adds web search to the terminal in one step:

npx -y firecrawl-cli@latest init
firecrawl search "your query here"

Results come back as LLM-ready markdown with page content included, skipping the separate scrape step. The CLI also registers automatically as a tool in Claude Code, Codex, and other agents that support tool use โ€” this is especially valuable for Codex CLI web search, since Codex's built-in search returns snippets only and has no live browsing by default.

Last updated: Apr 30, 2026