Metadata-Version: 2.4
Name: acoder
Version: 0.1.0
Summary: Interactive agentic coding CLI backed by your own open-source model endpoint
Author: amogh
License: MIT
Project-URL: Homepage, https://github.com/amogh/acoder
Project-URL: Issues, https://github.com/amogh/acoder/issues
Keywords: ai,cli,coding-agent,llm,agent,qwen,openai-compatible
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.0
Requires-Dist: openai>=1.40
Requires-Dist: httpx>=0.27
Requires-Dist: python-dotenv>=1.0
Provides-Extra: research
Requires-Dist: firecrawl-py>=1.0; extra == "research"
Provides-Extra: bench
Requires-Dist: evalplus>=0.3.1; extra == "bench"
Requires-Dist: datasets>=2.0; extra == "bench"
Provides-Extra: all
Requires-Dist: firecrawl-py>=1.0; extra == "all"
Requires-Dist: evalplus>=0.3.1; extra == "all"
Requires-Dist: datasets>=2.0; extra == "all"
Dynamic: license-file

# acoder

Interactive agentic coding CLI backed by **your own** open-source model endpoint
(any OpenAI-compatible URL — e.g. Qwen3-Coder on RunPod serverless). A terminal
coding agent like Claude Code / Codex, but pointed at a model you host.

## Install & run (no install needed)

```bash
uvx acoder setup      # one-time: enter your endpoint URL + API key
uvx acoder chat       # interactive agent session
```

`uvx` (from [uv](https://docs.astral.sh/uv/)) runs acoder without installing it and
provisions Python for you — nothing to set up but your endpoint. Prefer a permanent
install? `uv tool install acoder` or `pipx install acoder`, then just `acoder chat`.

Config is read from env vars, `./.env`, or `~/.config/acoder/config.env`
(written by `acoder setup`): `ACODER_ENDPOINT`, `ACODER_API_KEY`, `ACODER_MODEL`.
Optional extras: `acoder[research]` (Firecrawl library docs), `acoder[bench]`
(benchmark harness), `acoder[all]`.

## Interactive agent

```bash
acoder chat --mode approve   # default: approve each write/command (y/n/a)
acoder chat --mode auto      # full autonomy
acoder chat --mode plan      # read-only: investigates, proposes, never edits
acoder do "fix the failing test in parser.py and run pytest"   # one-shot
```

The agent reads/searches freely and gates every file write and shell command by
your chosen mode. Slash commands in the REPL: `/mode`, `/ingest`, `/cost`,
`/reset`, `/help`, `/exit`.

## Batch workflow (the original staged pipeline)

Works like a careful human dev, in strict stages:

1. **Ingest** — map the repo: every file, class, function, signature,
   docstring, import, and cross-file call edge → `.acoder/repomap.json`
2. **Research** — detect the libraries the task touches; fetch official docs
   via Firecrawl (free search fallback without a key); cache condensed API
   notes per package in `.acoder/libdocs/`
3. **Plan** — short step plan + edge-case list, grounded in the map + docs
4. **Code** — generate the full solution with that assembled context
5. **Verify** — run tests in a sandbox; repair loop with anchored acceptance

### Verification design (measured, not vibes)

Naive self-repair (model writes tests, repairs until they pass) **lowered**
HumanEval+ from 89.0 → 87.2 in our runs: bad model-written tests break good
code. acoder therefore treats task-statement examples as ground truth anchors;
model-written tests are advisory, and a repair is only accepted if it strictly
improves the score.

## Usage

```bash
cp .env.example .env   # RUNPOD_API_KEY, ACODER_ENDPOINT, FIRECRAWL_API_KEY
pip install -e ".[bench]"

acoder ingest .                    # build the repo map
acoder research pandas             # cache API notes for a library
acoder solve "add a retry decorator to http_get in client.py" --path .
acoder bench humaneval --mode baseline
acoder bench bigcodebench --mode agent
acoder report                      # scorecard vs frontier reference numbers
```

## Benchmarks (this deployment, pass@1)

| Benchmark | Baseline | Agentic | Notes |
|---|---|---|---|
| HumanEval | 92.7 | — | greedy, FP8, 48GB serverless worker |
| HumanEval+ | 89.0 | 87.2 (naive v1) | v1 regression is what motivated anchored verify |
| BigCodeBench-Hard | pending | pending | research stage on |

macOS note: EvalPlus's sandbox calls `resource.setrlimit(RLIMIT_AS, ...)`,
which macOS rejects — wrap it in try/except ValueError in
`evalplus/eval/utils.py` or every task scores 0.
