DEV Community

Ramandeep Singh
Ramandeep Singh

Posted on

Termux Commands — Quick Reference - Phone Hacks

Looking for terminal command experience on your phone? Here you go!

Local AI (SLMs)

Task Command
Install Ollama `curl -sL https://github.com/Anon4You/ollama-in-termux/raw/main/ollama.sh
Start Ollama server {% raw %}ollama serve &
Run AI (1B/3B only) ollama run llama3.2:1b
llama.cpp: deps pkg install clang cmake git
llama.cpp: build git clone https://github.com/ggerganov/llama.cpp && cd llama.cpp && cmake -B build && cmake --build build --config Release
llama.cpp: chat ./build/bin/llama-cli -m models/your_model.gguf -p "Your prompt"

Image viewing

Tool Install Use
tiv pkg install tiv tiv image.jpg
viu pkg install viu viu image.jpg
termimage pkg install termimage termimage image.jpg
Open in gallery pkg install termux-api termux-open image.jpg
ASCII art (retro) pkg install libcaca cacaview image.jpg

Image fetching & generation

Task Command
Random Unsplash curl -L https://source.unsplash.com/random/1080x1080 -o random.jpg
Topic image curl -L https://source.unsplash.com/featured/?topic,keyword -o file.jpg
Placeholder curl https://via.placeholder.com/500x500.png?text=Text -o placeholder.png
QR code pkg install qrencodeqrencode -o qr.png "https://url"
ASCII fire pkg install libcacaaafire
Avatar curl https://robohash.org/username.png -o avatar.png

Games

Install Games
pkg install bsdgames snake, tetris-bsd
pkg install moon-buggy moon-buggy
pkg install nethack nethack
pkg install ninvaders ninvaders

Social & effects

Tool Install Use
Reddit (Reddix) pkg install reddix reddix
Matrix rain pkg install cmatrix cmatrix
Train easter egg pkg install sl sl
ASCII banner pkg install figlet figlet "Hello"
Fake hacker UI pkg install hollywood hollywood

Dashboard

pkg install tmux
tmux
# Split: Ctrl+b then %
# Pane 1: curl wttr.in/Phuket
# Pane 2: ping 8.8.8.8
Enter fullscreen mode Exit fullscreen mode

Suggested models: Llama 3.2 (1B/3B), Gemma 2 (2B), Phi-3.5 Mini. Running AI can heat the phone.

Top comments (0)