{"slug": "a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq", "title": "A minimalistic AI coding agent in 62 lines of bash, curl and jq", "summary": "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.", "body_md": "A tutorial on building an agentic harness in nothing but `bash`, `curl` and `jq`.\nEach numbered script adds one idea on top of the previous one. The full\nwalkthrough is in [ARTICLE.md](https://github.com/antonum/bash-harness/blob/main/ARTICLE.md) or on\n[dev.to](https://dev.to/antonum/minimalistic-ai-harness-in-62-lines-of-bash-script-170m).\n\nWorks with any OpenAI-compatible endpoint that supports tool calling, including local models.\n\n- A terminal with `bash` ,`curl` and`jq`\n- An [OpenRouter](https://openrouter.ai) API key, or any other OpenAI-compatible endpoint with tool calling\n\nSetup: put `OPENROUTER_API_KEY=sk-or-...` in `.env`.\n\n| Step | File | Adds | \n|---|---|---|\n| 01 | `01-LLM-Call.sh` | One raw `curl` call to a chat completions endpoint. | \n| 02 | `02-Chat.sh` | `call_llm` as a function, the conversation as a JSON array, and a read/call/print loop. | \n| 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. | \n\nRun any step with `bash 0N-....sh`.\n\n`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`.\n\n`03-Harness.sh` runs whatever the model asks for, with your permissions and\nno confirmation. It is a tutorial. Read the commands as they scroll by and\ndon't run it in a directory you care about.\n\nMIT, see [LICENSE](https://github.com/antonum/bash-harness/blob/main/LICENSE).", "url": "https://wpnews.pro/news/a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq", "canonical_source": "https://github.com/antonum/bash-harness", "published_at": "2026-10-20 13:06:53+00:00", "updated_at": "2026-10-20 13:17:28.502305+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models", "ai-products"], "entities": ["antonum/bash-harness", "dev.to", "OpenRouter", "GitHub", "tetris.py", "bash", "curl", "jq"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq", "markdown": "https://wpnews.pro/news/a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq.md", "text": "https://wpnews.pro/news/a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq.txt", "jsonld": "https://wpnews.pro/news/a-minimalistic-ai-coding-agent-in-62-lines-of-bash-curl-and-jq.jsonld"}}