The web, from your terminal.
Search the web, extract pages, get grounded answers, and run deep research with
one command: web. Choose your providers, bring your API keys, and use the same
configuration in your terminal, TypeScript applications, and pi.
Important
Coming from pi-web-providers? Webfox continues the project as v4.0.0. Replace the old Pi package:
pi remove npm:pi-web-providers
pi install npm:webfoxRecreate your provider defaults in the Webfox configuration
and restart pi. The old ~/.pi/agent/web-providers.json settings aren't imported.
-
Terminal: Install the
webcommand with Homebrew:brew install mavam/tap/webfox
Or use npm:
npm install -g webfox
-
Nix: Run the CLI directly:
nix run github:mavam/webfox -- --help
The flake exports
packages.<system>.defaultfor Linux (aarch64,x86_64) and macOS (Apple Silicon). -
TypeScript: Add
webfoxas an application dependency. -
Pi: Install the extension:
pi install npm:webfox
This installs the extension, not the
webcommand on your shell'sPATH. Then follow Use with Pi to select a web provider and supply its API key.
Set an API key and make your first request. For example, with Brave Search:
export BRAVE_SEARCH_API_KEY=β¦
web search "Node.js release notes" --provider braveSave your provider choice so you don't need to repeat it:
web config default search brave
web search "TypeBox validation"Choose a provider for each capability, or override it with --provider. API keys
alone never select a provider.
web search "Node.js cancellation" "Bun cancellation"
web contents https://example.com/a https://example.com/b --provider tavily
web answer "What is MCP?" --provider openai --model gpt-6-astra
web research "Compare databases for an analytics service" --provider gemini --timeout 20mEach provider needs its own credentials. Research runs in the foreground and shows progress while you wait. Ctrl-C stops waiting, but may not cancel an already-running, billable research job at the provider.
web providers
web providers openai
web search --help
web search --provider openai --helpProvider-specific help lists the options available for that provider, such as models, source filters, and page extraction settings.
Quote each independent query or question. Search and answer accept up to ten inputs; research accepts one brief. Omit the input to read from a pipe or file:
# Read from files
web search < query.txt
web answer --provider openai < question.txt
web research --provider gemini < brief.md
web contents --provider tavily < urls.txt
# Pipe input
echo "What is MCP?" | web answer --provider openai
echo "https://example.com" | web contents --provider tavily
# Save or process JSON results
web search "TypeBox" --format json > results.json
web search "TypeBox" --format json | jq -r '.results[] | select(.ok) | .value.results[].url'Contents reads one URL per line. The other commands read the entire stdin stream
as one input. Positional arguments take precedence over stdin; - is optional.
Text is the default, including when piped. Use --format json for structured
results; the last example uses jq to extract result URLs.
Results go to stdout; progress and errors go to stderr. --quiet hides progress
and success notices, not errors. Use --timeout 30s or --timeout 20m to set a
deadline, and --no-color or NO_COLOR to disable colors.
See the CLI reference for output formats, exit codes, and scripting details.
Use different providers for different tasks:
| Provider | Search | Contents | Answer | Research |
|---|---|---|---|---|
| Brave | βοΈ | βοΈ | βοΈ | |
| Cloudflare | βοΈ | |||
| Custom | βοΈ | βοΈ | βοΈ | βοΈ |
| Exa | βοΈ | βοΈ | βοΈ | βοΈ |
| Firecrawl | βοΈ | βοΈ | βοΈ | |
| Gemini | βοΈ | βοΈ | ||
| Linkup | βοΈ | βοΈ | βοΈ | |
| Ollama | βοΈ | βοΈ | ||
| OpenAI | βοΈ | βοΈ | βοΈ | |
| Parallel | βοΈ | βοΈ | ||
| Perplexity | βοΈ | βοΈ | βοΈ | |
| SerpBase | βοΈ | |||
| Serper | βοΈ | |||
| Tavily | βοΈ | βοΈ | ||
| Valyu | βοΈ | βοΈ | βοΈ | βοΈ |
| You.com | βοΈ |
See the provider guide for credentials, examples, and caveats.
Save choices with web config default, or edit YAML for more control:
web config path
web config show
web config validateshow hides credentials. validate checks your settings without making requests.
The default file is ~/.config/webfox/config.yaml, respecting XDG_CONFIG_HOME
or, on Windows, APPDATA. Override it with WEBFOX_CONFIG or --config <path>.
For example:
$schema: https://unpkg.com/webfox@latest/dist/config.schema.json
defaults:
search:
provider: brave
maxResults: 5
answer:
provider: openai
providers:
openai:
options:
answer:
model: gpt-6-astraStandard API key environment variables work without a credentials section. Run
web providers <id> to find the names for your provider. You can also read keys
from a password manager rather than store them in the file.
See the example configuration and configuration reference for credential commands, timeouts, retries, and provider defaults.
Install the Pi extension:
pi install npm:webfoxTo also use the web command in your terminal, follow Installation.
Both installations share the same Webfox configuration.
Add to ~/.config/webfox/config.yaml:
defaults:
search:
provider: braveStart Pi with your API key:
export BRAVE_SEARCH_API_KEY=β¦
piAsk Pi: Search the web for the latest Node.js release notes.
Add contents, answer, or research defaults for more tools.
Restart Pi after changing defaults.
import { createWebfox } from "webfox";
const web = createWebfox();
const document = await web.search({
provider: "brave",
queries: ["Node.js AbortSignal"],
maxResults: 5,
});
for (const result of document.results) {
if (result.ok) console.log(result.value.results);
else console.error(result.error.message);
}The client also provides contents, answer, and research. See the
library reference for request controls,
configuration, progress, and errors.
- No provider selected: Pass
--provider <id>or save a default withweb config default <capability> <provider>. - Missing credentials: Run
web providers <id>to check the required key names, or see the provider guide. - Invalid configuration in pi: Pi continues to start, but Webfox registers
no tools and reports the error (on stderr in print and JSON modes). Fix the
configuration, then restart Pi or run
/reloadto load the extension again. - No pi tools: Select default providers in the shared configuration and restart pi. Installing the extension or setting keys alone isn't enough.