Skip to main content

Lightweight, agent-facing CLI for provider-specific search (Grok web/X, local Codex)

Project description

cheap-search

Lightweight, agent-facing CLI for provider-specific search. Wraps two backends behind one binary and ships two Claude Skills that teach a coding agent when and how to call it.

cheap-search
├── grok-search   # xAI / Grok — web + X (Twitter)
└── codex-search  # local Codex CLI passthrough

The agent picks the provider explicitly. There is no automatic routing.

Why

Built-in agent search (Claude WebSearch, etc.) is fine for generic lookups. cheap-search exists for the cases where you specifically want Grok's view of the web, Grok's read of X/Twitter, or Codex's grounding — and you want the agent to invoke the provider you asked for, not pick one for you.

Install

macOS (Apple Silicon) / Linux (x64, arm64)

curl -fsSL https://raw.githubusercontent.com/AirswitchAsa/cheap-search/main/scripts/install.sh | sh

Anywhere with Python 3.13

uv tool install cheap-search       # or: pip install cheap-search

Ephemeral (no install)

uvx --from cheap-search cheap-search --help

Configure

Grok needs an xAI API key. Either:

export XAI_API_KEY=xai-...

or persist it locally with the CLI (stores at ~/.config/cheap-search/config.toml, mode 0600):

cheap-search grok apikey set        # prompts with hidden input
echo "$KEY" | cheap-search grok apikey set -
cheap-search grok apikey status
cheap-search grok apikey unset

Env wins when both are set.

Codex handles its own auth — codex login once.

Use

cheap-search grok web "latest stable Python release"
cheap-search grok x   "xAI announcements" --from 2026-05-01
cheap-search codex    "look up the OpenAI Responses API web search syntax"

cheap-search doctor          # verify local setup
cheap-search providers       # list supported providers

Pass -o json for agent-parsable output:

{
  "answer": "…",
  "model": "grok-4.3",
  "tool_kind": "web",
  "citations": [{"url": "https://…", "title": "…"}]
}

For codex, trailing args after -- are forwarded:

cheap-search codex "<query>" -- --skip-git-repo-check -m gpt-5-codex

Skills

Two skills under skills/:

  • grok-search — fires only when the user explicitly names Grok / xAI / X / Twitter.
  • codex-search — fires only when the user explicitly names Codex.

Each skill bundles scripts/ensure-cheap-search.sh which resolves the bundled binary, falls back to uvx --from cheap-search cheap-search, and only complains if neither is available.

Exit codes

Code Meaning
0 Success
1 Usage error
2 Missing configuration (no API key / no codex binary)
3 Provider failure (network, 4xx/5xx, codex non-zero)

Agents can branch on these to choose between "tell user to configure" and "surface stderr."

Specification

The behavioral contract lives as a DOG document graph under docs/. Browse the project index for actors, behaviors, components, and data definitions. The implementation is built to match — lint stays clean: dog lint docs.

Development

git clone https://github.com/AirswitchAsa/cheap-search
cd cheap-search
uv sync

# Unit tests (no network):
uv run pytest -m "not live"

# Full matrix incl. live xAI + codex calls (costs ~$0.10 in xAI tool fees):
echo 'XAI_API_KEY=xai-...' > .env
uv run pytest

CI is build-only (manual workflow_dispatch); tests are run locally with a real API key. See .github/workflows/release.yml.

License

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cheap_search-2026.5.17.tar.gz (68.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cheap_search-2026.5.17-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file cheap_search-2026.5.17.tar.gz.

File metadata

  • Download URL: cheap_search-2026.5.17.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cheap_search-2026.5.17.tar.gz
Algorithm Hash digest
SHA256 7220872bd2573dc53d5055209fd22dc0332875c1daeb11e23018391c843f9e32
MD5 d11101f6e61619dce6bcd2ddb738550d
BLAKE2b-256 c4869e8679358da49dcbc31ba63688a0f193ff91de1662abb12ab3e01d113902

See more details on using hashes here.

File details

Details for the file cheap_search-2026.5.17-py3-none-any.whl.

File metadata

  • Download URL: cheap_search-2026.5.17-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cheap_search-2026.5.17-py3-none-any.whl
Algorithm Hash digest
SHA256 0fbef7072b98115d320c6d67f0e2ac4b70c610b7207c7cd0ea31042128a14b63
MD5 86f189b2302a55aaa13c427072198df4
BLAKE2b-256 427850317694ee429f3aff1adde5d2d8fb2c858fa7cdb9ed7109051080bdf01c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page