search-cli.
An open-source command-line client for the same modes, in one Rust binary.
search queries search and scraping engines from one command, merges results from several engines by rank fusion on your machine, and prints JSON an agent can pipe into its next step. search agent-info prints every command, flag and exit code as JSON; search doctor shows which engines are configured and how each one is reached.
Install#
$ brew install paperfoot/tap/search-cli$ cargo install agent-search$ curl -fsSL https://metasearch.sh/install | shSource and issues at github.com/paperfoot/search-cli; the crate is agent-search on crates.io.
First run#
$ search doctor $ search -m news -q "solid-state batteries" --json $ search -m academic -p exa,serper -q "sparse attention" --json
-m picks the mode and -p names the engines. Without -m the mode is auto: the CLI picks one and reports the choice in metadata.routing.auto. A mode or engine you name always wins.
Your own keys, your account, or both#
With your own provider keys, search-cli calls each engine directly and you pay each vendor yourself. Keys come from environment variables first, then the config file.
From version 0.10, search login adds your metasearch.sh account. Engines you have no key for then go through metasearch.sh and are charged to your balance at the prices on /pricing. The rules:
- Your own key always wins: that engine is called directly.
- Rank fusion still runs on your machine; metasearch.sh serves each engine's results separately.
- A fused search sends at most 3 engines through metasearch.sh (6 in
deep), in router order, and warns about the rest. Name engines with-pto choose others or more. - The JSON output reports what the search cost in
metadata.cost, with a figure per engine.
Sign in from the terminal#
$ search login $ search whoami $ search logout --revoke
search loginprints a short code and opens your browser; you approve the request there, and the key is saved in the CLI's config file (mode 0600). Logging in again from the same machine reuses its key. On a machine without a browser, search login --no-browser prints the URL to open elsewhere. search whoami shows the account and balance. search logout removes the local key, and --revoke also revokes it on the server. Keys created this way are listed in the dashboard and can be revoked there.
Versions before 0.10 store the key but still search only with your own provider keys.