cd /news/ai-agents/a-minimalistic-ai-coding-agent-in-62… · home › topics › ai-agents › article
[ARTICLE · art-153728] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

A minimalistic AI coding agent in 62 lines of bash, curl and jq

A developer tutorial published on dev.to and GitHub under the repository antonum/bash-harness shows how to build an AI coding agent harness in 62 lines of bash, curl and jq, working with any OpenAI-compatible endpoint that supports tool calling, including local models. The walkthrough is split into three numbered scripts: 01-LLM-Call.sh makes one raw curl call to a chat completions endpoint, 02-Chat.sh turns call_llm into a function with the conversation held as a JSON array and a read/call/print loop, and 03-Harness.sh adds a bash tool so the model can request commands that the harness runs and feeds back until the model answers. The tutorial warns that 03-Harness.sh executes whatever the model asks with the user's permissions and no confirmation, and notes that tetris.py is the output step 03 produced when asked to "write a tetris game in python, make sure it runs"; the code is MIT licensed and requires an OpenRouter API key or another OpenAI-compatible endpoint with tool calling.

read1 min views2 publishedOct 20, 2026
A minimalistic AI coding agent in 62 lines of bash, curl and jq
Image: Michielbdejong (auto-discovered)

A tutorial on building an agentic harness in nothing but bash, curl and jq. Each numbered script adds one idea on top of the previous one. The full

walkthrough is in [ARTICLE.md](https://github.com/antonum/bash-harness/blob/main/ARTICLE.md) or on
[dev.to](https://dev.to/antonum/minimalistic-ai-harness-in-62-lines-of-bash-script-170m).

Works with any OpenAI-compatible endpoint that supports tool calling, including local models.

  • A terminal with bash ,curl andjq
- An [OpenRouter](https://openrouter.ai) API key, or any other OpenAI-compatible endpoint with tool calling

Setup: put `OPENROUTER_API_KEY=sk-or-...` in `.env`.
Step File Adds
01 01-LLM-Call.sh One raw curl call to a chat completions endpoint.
02 02-Chat.sh call_llm as a function, the conversation as a JSON array, and a read/call/print loop.
03 03-Harness.sh A bash tool: the model asks to run commands, the harness runs them and feeds results back until the model answers.

Run any step with bash 0N-....sh.

tetris.py is what step 03 produced when asked to "write a tetris game in python, make sure it runs". Try it with python3 tetris.py.

03-Harness.sh runs whatever the model asks for, with your permissions and no confirmation. It is a tutorial. Read the commands as they scroll by and don't run it in a directory you care about.

MIT, see LICENSE.

── more in #ai-agents 4 stories · sorted by recency
── more on @antonum/bash-harness 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/a-minimalistic-ai-co…] indexed:0 read:1min 2026-10-20 · —