Skip to content

Just an AI assistant for termux users with coding assistant abilities

License

Notifications You must be signed in to change notification settings

DresOperatingSystems/DresTermuxAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ODB – Termux AI Assistant

A lightweight self-hosted AI companion that runs inside Termux.
It watches your recent bash commands, reads files, suggests fixes, answers questions and learns from you to better suit your needs.

He's called ODB after the GOAT ODB from Wu-Tang Clan.

He is mostly for users who do not understand Termux or coding in Termux making it easier to get help with commands, scripts and errors.

Features

  • Chat-style AI powered by Cerebras inference (very fast and secure!)
  • Context-aware — automatically includes your ~last 12 executed commands (from ~/.bash_history)
  • File helpers:
    odb read <file> → shows file content
    odb fix <file> → suggests improvements / patch
  • Personal knowledge base:
    odb teach me about git hooks: pre-commit runs before commit → remembers forever, learns from you
  • Safety first — never modifies files automatically, only suggests changes
  • Privacy-focused — anonymous requests to the model provider
  • Runs in background with a simple command
  • Help command: odb help for usage guide

Prerequisites

Item Purpose Termux install command
Termux Android terminal emulator (already installed)
Python 3 Runs server & wrapper pkg install python
pip Installs Python packages pip install --upgrade pip
curl Used by the odb wrapper pkg install curl
git Clone the repository pkg install git
Cerebras API key Access to fast LLM inference Sign up at https://cloud.cerebras.ai → API Keys → Create key (free tier available)

Important: You need a Cerebras API key — free tier is generous (~1M tokens/day). Keep it private!

Installation

1. Clone the repository

git clone https://github.com/DresOperatingSystems/DresTermuxAI.git
cd DresTermuxAI

2. Install dependencies

pip install -r requirements.txt

3. Add your Cerebras API key to odb.py

Open the script:

nano odb.py

Find the line:

API_KEY = "place cerebras api key here"

Replace "place cerebras api key here" with your real key should start with csk- or cs-.

save it (Ctrl+X, Y, enter).

4. Start the ODB server in the background

nohup python odb.py > ~/.odb_server.log 2>&1 &
disown

Make sure it's running:

ps aux | grep odb.py

To watch startup logs:

tail -f ~/.odb_server.log

(Use Ctrl+C to stop watching.)

5. Create the odb command wrapper

mkdir -p "$HOME/bin"
cat > "$HOME/bin/odb" << 'EOF'
#!/usr/bin/env bash
# ODB – simple wrapper that sends your query to the local server

msg="$*"
encoded=$(python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.argv[1]))" "$msg")
curl -s "http://127.0.0.1:8123/chat?q=${encoded}"
EOF
chmod +x "$HOME/bin/odb"

Add ~/bin to PATH

echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

How to use

Use odb help to see what he can do or just talk to him.

Examples:

odb <message>
odb hello
odb teach me about the termux api system
odb read myscript.sh
odb fix mycode.py

Usage:

  • General chat: odb <your question>.
  • Teach: odb teach me about python (saves to knowledge base).
  • File read: odb read <file>.
  • File fix: odb fix <file> (describe the issue in the message or paste code snippets).
  • Recent activity: odb what have I been doing lately? (references bash history).
  • Help: odb help.

ODB will respond right in your terminal.

Troubleshooting

  • Server not starting?
    • Check logs: tail -f ~/.odb_server.log (look for errors like missing modules or bad API key).
  • Connection refused error?
    • If server isn't running try to restart it with the nohup command.
  • No reply / empty output?
    • Check if the server is alive: ps aux | grep odb.py or curl http://127.0.0.1:8123/chat?q=test.
  • API errors?
  • Slow or killed in background?
    • Run termux-wake-lock and set Termux battery to "Unrestricted" in Android Settings → Apps → Termux → Battery.
  • Need to reset knowledge/history?
    • Delete ~/.odb_knowledge.json or ~/.odb_history.json.
  • If non of that works then run odb in the frontend using python odb.py and read what the output says.

Stop the server

pkill -f odb.py

End

We recently deployed our own website that gives you access to other DresOS services like our own ecoverse where you can post bug reports and feedback it is also where you can find sneak peeks of our future projects etc etc so please go ahead and check it out. https://dresoperatingsystems.github.io/

Thank you and lets keep building,

The DresOS Team (forever free, forever private)

Releases

No releases published

Packages

No packages published

Languages