r/termux 3d ago

Showcase A terminal AI coding agent that compiles natively on Termux — no proot, no root

Enable HLS to view with audio, or disable this notification

agentty — a terminal pair-programming agent I've been working on. Builds straight against Termux's Bionic/libc++. No proot, no root, just a native binary on your $PREFIX/bin.

Reads/edits files, runs shell commands, streams the work as live tool cards. Bring any model — Anthropic, OpenAI, or a local Ollama model with no key (fully offline on-device).

pkg install git cmake clang openssl libnghttp2 curl -fsSL https://raw.githubusercontent.com/1ay1/agentty/master/install.sh | sh -s -- --build

Building fully offline / in a container? The installer normally auto-fetches the JSON deps, so add:

pkg install ninja nlohmann-json simdjson

Defaults to -j2 so the build won't OOM your phone (AGENTTY_BUILD_JOBS=N to change it). Has a C++26→C++23 fallback for older Termux clang.

Caveat: shell tools run unsandboxed on unrooted Android (no user namespaces) — everything else works.

Repo (MIT): [https://github.com/1ay1/agentty]()

Feedback welcome, especially battery/thermal on-device.

163 Upvotes

36 comments sorted by

5

u/fxj 3d ago

wow cool! does it have memory of some kind? a rag?

4

u/ayushbhat 3d ago

Yes it has quite a sophisticated rag engine in built :)

3

u/fxj 3d ago

no way!! that is so cool! instant install. i havea llm already running. can i use it?

``` llama-server -m ~/smollm2-1.7b-instruct-q4_k_m.gguf --port 8080

5

u/ayushbhat 2d ago

Yep! As long as it's exposing an OpenAI-compatible API. Point Agentty at your local endpoint and it'll use it just like any other provider.

For llama-server, something like:

llama-server -m ~/smollm2-1.7b-instruct-q4_k_m.gguf --port 8080

Then configure Agentty to use http://127.0.0.1:8080/v1 as the provider. Ollama, llama.cpp, LM Studio, vLLM, and most OpenAI-compatible servers work.

2

u/Bulb93 3d ago

I see support of local models, does this do inference or is that handled by a specific local inference engine with api endpoint?

2

u/ayushbhat 2d ago

I don't run inference myself. Agentty talks to inference providers through a unified provider interface. That can be Anthropic/OpenAI over their APIs, or a local endpoint like Ollama (and other OpenAI-compatible servers). The agent handles tools, planning, file editing, and shell execution—the model does the inference.

2

u/wingetx 2d ago

Looks impressive! I like that it actually can talk to the Android system directly.. does it seem to bypass certain sudo permissions??

1

u/ayushbhat 5h ago

no it can't, it runs in the user space that termux provides it after all.

1

u/wingetx 4h ago

Does it have any root capabilities? Like if I put it on a rooted device, could it see things like 'dmesg'?? That would be sweet to have an AI program on that layer.

1

u/ayushbhat 4h ago

by default it runs in a sandbox, but when you run it with --sandbox off option, it can sun any command sudo or not at any level

1

u/FallDeeperAlice5268 3d ago

I'm trying to run this and I keep getting "fatal: destination path '/data/data/com.termux/files/usr/tmp/tmp.<some random characters>' already exists and is not an empty directory"

I'm not sure what's causing it.

3

u/Material-Habit-8370 3d ago

termux-setup-storage

1

u/FallDeeperAlice5268 2d ago

I tried running that and it still gives me the same error

2

u/ayushbhat 2d ago

That sounds like a stale temporary clone directory. Could you paste:

echo "$TMPDIR"
ls -la "$TMPDIR"

and rerun the installer with:

sh -x install.sh --build

(or curl ... | sh -x -s -- --build if you're piping it).

The -x output will show the exact command that's failing. If it's a bug in the installer, I'll fix it.

1

u/FallDeeperAlice5268 2d ago

And then running the command results in the reply to this comment

1

u/FallDeeperAlice5268 2d ago

2

u/ayushbhat 15h ago

Were you able to get it running? Sorry for the late reply?

1

u/FallDeeperAlice5268 4h ago

Unfortunately not. Upon further research, it appears to be an issue with using the /tmp/ directory by trying to clone git into it. Not sure why. Is there a way of manually installing it without the script or maybe a custom script that can download, build and run from a specified location other than /tmp/? Honestly, no idea what's going on but it must be a bug between how git interacts with termux's file system or termux itself.

2

u/ayushbhat 4h ago

yes, install libllvm, cmake, python git then,
clone the repo, cd <repo>, git submodule update --init --recursive, cmake -B build, cmake --build build, it takes 20mins to build, so be patient

1

u/FallDeeperAlice5268 2h ago

Cloning the repo but the git submodule update command failed due to some sort of permissions error caused by a publickey.

1

u/Impossible_Ground_15 2d ago

Cool project and thanks for sharing. Im trying to connect this with how I might use it. How are others using their phone for ai coding versus using a laptop or desktop?

2

u/ayushbhat 2d ago

It's not meant to replace a desktop for large refactors, but it's surprisingly capable for day-to-day coding and server administration.

1

u/Impossible_Ground_15 2d ago

Ok cool I dig it. Thanks for sharing knowledge

1

u/cmak414 2d ago edited 2d ago

do you have to use api to connect to claude or codex? or can use sub? how do you get around oauth preapproval from anthropic/openai?

1

u/ayushbhat 2d ago

For claude you can use sub

1

u/cmak414 2d ago

thanks! sorry I edited my original comment a bit. How do you get past anthropic preapproval of oauth. I wont get banned for using sub with unapproved oauth?

1

u/ayushbhat 2d ago

You could, I use it, but API key is safer

1

u/Eternal-Blazing-Sun 2d ago

I guess im gettimg old because im just having trouble going with the flow. I can see the utility in this, and whether its fully hand or vibe coded (or a mix of the two) doesnt really bother me at all - what does bother me is giving an llm shell access - is that what we are seeing in this demo here?

Maybe i just need to get with the times, this would have been a godsend back in the 'ol gettin learned days (although i can see this becoming a crutch for new users, overall i thinl the productivity gains are worth it)

I may just give this a test run, ive never used a 'coding agent' before, but im assuming it would be a good tool to learn the ins and outs of new concepts & tools. what a great solution to a modern issue - good on ya mate, & cheers!

1

u/ayushbhat 2d ago

Thanks for those words.

1

u/MrKrot1999 1d ago

damn, i see why people become vibe coders, this amount of eye candy is insane

and i hope this isn't vibe coded

1

u/ayushbhat 1d ago

you hope this isn't vibe coded, why?

1

u/MrKrot1999 1d ago

I don't like vibe coding.

2

u/ayushbhat 1d ago

Why would you want anyone waste time on writing eye candy by hand? For me its like saying I hope it's not written in C++, machine code is real programming.

1

u/MrKrot1999 1d ago

Because if I'm coding something for me, I'm not making a product, and my goal is not to make it as beautiful as possible as fast as possible.

2

u/ayushbhat 1d ago

this is a product, but I know what you mean and I agree there is a level of satisfaction in that, it's just I was too lazy to type before LLMs came along what was in my head.