r/PiCodingAgent
•
u/aziz0x00
•
Jul 07 '26
•
1
News No framework, no SDK: what a coding agent looks like when it's just bash + jq + curl
Every agent framework I tried felt like a lot of machinery around what is, at its core, a loop: send messages, maybe run a tool, append the result, repeat. So I built one with no framework at all, just bash, jq, and curl. The core loop is ~190 lines; the whole thing (ten tools, permissions, skills, three providers) is ~1,200. Repo: https://github.com/aziz0x00/agent.sh
The design decisions that I think are interesting:
Tools are one file each, no registration. A tools/Foo.sh defines a TOOL_DEF JSON schema and two functions: PreFoo validates the model's args and builds a human-readable preview (a real diff for Edit/Write), then Foo executes. Drop a file in tools/, it's a tool.
Permissions are per-signature, not per-tool. Approval prompts show the preview (the actual diff, the actual command), and "always allow" whitelists that exact signature, not the whole tool. Read-only tools are pre-approved. --free bypasses everything when you're feeling brave.
Context is a JSON file you can just... edit. /state opens the exact request payload in $EDITOR mid-conversation; /continue sends whatever you saved. Delete a bloated tool result, rewrite the model's last answer, whatever.
5
u/ParaboloidalCrest Jul 09 '26
This looks like the beginning of something great to come. I especially like the per-signature vs per-tool approach. Good job bro!
One pet-peeve however is allowing Python into the repo. It's a slippery slope that robs the minimalism quickly. Is there an pure shell alternative to that mdcat.py?
And as others suggested, replacing ollama with a generic OpenAI API provider would be an easy, clean win.
1
u/aziz0x00 Jul 12 '26
Thank you alot.
Fair concern about python. an alternative would be using
glowbut it doesn't allow streaming, and there's a PR on it but it's not yet merged. However, I'm limitingmdcat.pyto do only one thing and do it well, which is stream-rendering markdown, and it usesuvwhich makes it a standalone script.On the generic OpenAI API provider. actually the opencode-zen/go implementations are pretty much compliant with it (with anthropic's too), the only change is the endpoint URL and maybe the way they pass the API Key, but I might actually refactor the generic functionality in a seperate common script. However, some providers tend to have some weird quirks which are not so standard, groq for instance, but in any way, it should be a piece of cake to have the agent configure a new provider for u (opencode-zen has permenant free models).
7
u/Fig_da_Great Jul 08 '26
is this not just pi?
6
u/aziz0x00 Jul 08 '26
pi's codebase is 212033 lines if i count only typescript. agent.sh is just 1599 lines total.
2
2
u/Ok_Veterinarian_6364 Jul 07 '26
i see what you did here. nice bro
2
u/hazed-and-dazed Jul 08 '26
Um what has he done? Basically replicate pi using bash?
2
u/aziz0x00 Jul 08 '26
pi's codebase is 212033 lines if i count only typescript. agent.sh is just 1599 lines total.
fun fact: i began to write it before claudecode was publicly out1
Jul 09 '26
[removed] — view removed comment
1
u/aziz0x00 Jul 12 '26
I can say easy to navigate through, for educational purpose and for ease of building upon..
-1
0
0
u/ujjwaldrayaan Jul 08 '26
Can you answer of my one question, I want to embed Window powershell functionality into An Android app , is this possible?
I got this idea by how claude test code in it's chat window itself so if calude can embed testing python file , why can't we embed Command prompt into An app?
7
u/mpread-it Jul 08 '26
great idea. i started with pi specifically for how tiny it was compared to the rest of the harnesses. At that time. You're redefining the "genre". Congratulations!
One small pet peeve: why Ollama?!? why not simply any OpenAI-compatible endpoint? Most of us interested in pi are doing it for efficiency, to squeeze every drop of performance out of our limited hardware. So we use vLLM and llama-server - many of us compile them from source for our specific gear. Ollama & friends? Not so much. Thanks!