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/spicadust/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/spicadust/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.1.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.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cheap_search-2026.5.1.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.1.tar.gz
Algorithm Hash digest
SHA256 016b980d2ea4cccc6982f56ce2b7babc0f06bc8900331fbdeeaff392be94c8dd
MD5 f2b49b640cdd7c7a9a1212f2acdfde44
BLAKE2b-256 c9de26d39f68ba20e6a1a878175293e2fa82671a8b9408449e250af0edb67be7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cheap_search-2026.5.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 738a5e07dab850b940bada696336e49d4166dbb8e2c8ae8368a8d9e98691ed0d
MD5 970422bfc363e532ffce33cd85051f87
BLAKE2b-256 c4bc2a6aad29cda27b2b7386d585f8e428ec7ddd6ff0a3645c774c202fe2c1cd

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