{"id":50742745,"url":"https://github.com/tripledoublev/anaphor","last_synced_at":"2026-06-10T18:01:58.939Z","repository":{"id":355530782,"uuid":"1227618392","full_name":"tripledoublev/anaphor","owner":"tripledoublev","description":"Ask questions, gather context and get answers with anaphor, a CLI tool that selects tools based on your request","archived":false,"fork":false,"pushed_at":"2026-05-04T03:22:57.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T05:17:03.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tripledoublev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-02T23:45:17.000Z","updated_at":"2026-05-04T03:23:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tripledoublev/anaphor","commit_stats":null,"previous_names":["tripledoublev/anaphor"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tripledoublev/anaphor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripledoublev%2Fanaphor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripledoublev%2Fanaphor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripledoublev%2Fanaphor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripledoublev%2Fanaphor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tripledoublev","download_url":"https://codeload.github.com/tripledoublev/anaphor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tripledoublev%2Fanaphor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34163252,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-10T18:01:58.849Z","updated_at":"2026-06-10T18:01:58.934Z","avatar_url":"https://github.com/tripledoublev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anaphor\n\nA minimal terminal context resolver. Ask in natural language; Anaphor gathers the relevant context and answers with an LLM.\n  \nIn linguistics, *anaphora* is an expression whose meaning depends on another expression in context. Anaphor does the same for terminal questions: it finds the antecedent context needed to answer.\n\n## How it works\n\nYou ask a question. Anaphor:\n\n1. Plans which tools to use (web search, fetch URL, read file, or none)\n2. Gathers context from selected sources\n3. Provides an LLM-powered answer grounded in that context\n\nNo source-selection flags. Just natural language.\n\n```bash\nanaphor \"what is rust-lang.org about?\"\n# recognizes a URL, fetches it, and answers about the page\n\nanaphor \"find me links about axum\"\n# recognizes search intent and returns links with summaries\n\nanaphor \"summarize the readme\"\n# recognizes a file reference, reads README.md, and summarizes it\n```\n\n## Prerequisites\n\n- **Rust 1.70+** — to build from source\n- **OpenRouter API key** — required, free tier at https://openrouter.ai\n- **Brave Search API key** — optional, free tier at https://api.search.brave.com, only needed for web search\n- **Internet connection** — for API calls (30s timeout for web/URLs, 90s for LLM)\n\n## Setup\n\n1. Run from source:\n   ```bash\n   cargo run -- \"summarize the readme\"\n   ```\n\n2. Or build once:\n   ```bash\n   cargo build --release\n   ```\n\n3. Optional: install commands on Linux/macOS:\n   ```bash\n   mkdir -p ~/.local/bin\n   ln -sf \"$PWD/target/release/anaphor\" ~/.local/bin/anaphor\n   ln -sf \"$PWD/target/release/anaphor\" ~/.local/bin/a\n   ```\n   Ensure `~/.local/bin` is on `$PATH`. Then use `anaphor` or the shorter `a`.\n\n4. Configure:\n   ```bash\n   cp .env.example .env\n   # Fill in OPENROUTER_API_KEY (required) and BRAVE_API_KEY (optional)\n   ```\n\n5. Test:\n   ```bash\n   cargo run -- \"what is Rust?\"\n   ```\n\n## Usage\n\n```bash\n# Direct question (no tools needed)\ncargo run -- \"what is WAL mode in sqlite?\"\n\n# Web search (auto-detected)\ncargo run -- \"find me links about the axum web framework\"\n\n# Fetch URL (auto-detected)\ncargo run -- \"what is rust-lang.org about?\"\n\n# Read file (auto-detected)\ncargo run -- \"summarize the readme\"\n\n# Stdin (auto-included)\ncat notes.md | cargo run -- \"extract action items\"\n```\n\nIf you installed the command, replace `cargo run --` with `anaphor` or `a`.\n\n## Configuration\n\nEnvironment variables (set in `.env` or shell):\n\n| Variable | Required | Default | Notes |\n|----------|----------|---------|-------|\n| `OPENROUTER_API_KEY` | Yes | — | Get at https://openrouter.ai |\n| `BRAVE_API_KEY` | No | — | Get at https://api.search.brave.com (only needed for web search) |\n| `ANAPHOR_MODEL` | No | `openai/gpt-4o-mini` | Any OpenRouter model ID |\n| `ANAPHOR_MAX_CHARS` | No | `30000` | Total context budget across all sources |\n\n### Recommended models\n\n- `openai/gpt-4o-mini` — best quality, very cheap\n- `google/gemini-flash-1.5` — fast and cheap\n- `meta-llama/llama-3-8b-instruct` — fast and free\n\n## Tools\n\nAnaphor automatically routes to three internal tools based on your question:\n\n- **search_web** — \"find links about X\", \"search for Y\"\n- **read_url** — \"what is example.com?\", \"summarize rust-lang.org\"\n- **read_file** — \"summarize README\", \"what's in Cargo.toml?\"\n\nNo flags. No syntax to learn. Just ask.\n\n## Security\n\n- File reads are sandboxed to the current working directory\n- HTTP requests timeout (30s for web/URLs, 90s for LLM) to prevent hanging\n- Tool errors are sanitized before being sent to the LLM\n- Context is truncated to your budget (default 30KB) to manage API costs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftripledoublev%2Fanaphor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftripledoublev%2Fanaphor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftripledoublev%2Fanaphor/lists"}