Skip to content

CLI Reference

Scannable command reference. Each entry is a one-liner description followed by the canonical invocation and one concrete example. For narrative guides see basic.md and advanced.md; for system-level tweaks see configuration.md.


1. Ollama

ollama list

Show locally installed models.

ollama list
# NAME             ID          SIZE    MODIFIED
# llama3.2:latest  abc123...   2.0 GB  3 days ago

ollama pull

Download a model from the registry.

ollama pull <model>[:<tag>]
ollama pull llama3.1:8b-instruct-q4_K_M

ollama run

Start an interactive chat with a model, loading it if needed.

ollama run <model> [prompt]
ollama run llama3.2 "Explain systemd in 3 bullets."

ollama rm

Remove a local model to free disk.

ollama rm <model>
ollama rm llama3.1:70b

ollama show

Print a model's Modelfile, parameters, or template.

ollama show --modelfile <model>
ollama show --modelfile llama3.2

ollama create

Build a custom model from a Modelfile.

ollama create <name> -f <Modelfile>
ollama create terse-llama -f ./Modelfile

Common flags: --verbose (show load/eval timings), --keepalive <dur> (how long to hold weights in RAM, e.g. --keepalive 30m).


2. Model manager (PAI-specific)

PAI ships a small wrapper around Ollama for curated model sets. See prompts/04-model-manager.md.

pai-models list

List models from PAI's curated catalog.

pai-models list

pai-models install

Install a curated bundle (downloads + verifies signatures).

pai-models install <bundle>
pai-models install writing-assistant

pai-models verify

Re-verify installed models against upstream hashes.

pai-models verify [--all]
pai-models verify --all

pai-models prune

Remove models not touched in N days.

pai-models prune --older-than <days>
pai-models prune --older-than 30


3. Persistence

persistence-setup

Interactive setup for the encrypted persistent volume.

persistence-setup

persistence unlock

Unlock an existing persistent volume (prompted at boot, but can be re-run).

sudo persistence unlock

persistence lock

Lock the persistent volume immediately (umounts + closes LUKS).

sudo persistence lock

persistence resize

Grow the persistent volume in place.

sudo persistence resize --to <size>
sudo persistence resize --to 50G

persistence backup

Dump an encrypted tarball of persistent data.

persistence backup --out <file.tar.age>
persistence backup --out /mnt/usb/pai-$(date +%F).tar.age

persistence verify

Re-check integrity of the persistent filesystem.

sudo persistence verify


4. Tor

systemctl status tor

Check whether the Tor daemon is running.

systemctl status tor

torsocks

Wrap an arbitrary command through the Tor SOCKS proxy.

torsocks <command> [args...]
torsocks curl https://check.torproject.org

Tor: switch identity (new circuit)

Send NEWNYM to the control port.

echo -e 'AUTHENTICATE ""\nSIGNAL NEWNYM\nQUIT' | nc 127.0.0.1 9051

Tor: view current circuits

Using nyx (ships with PAI):

nyx


5. Networking

nmcli

NetworkManager's CLI for Wi-Fi, Ethernet, VPN.

nmcli device wifi list
nmcli device wifi connect <SSID> password <PASS>
nmcli connection show --active

nmcli: MAC spoof toggle

Randomize hardware address per connection.

nmcli connection modify <name> 802-11-wireless.cloned-mac-address random
nmcli connection modify home-wifi 802-11-wireless.cloned-mac-address random

ufw status

Show firewall state and rules.

sudo ufw status verbose

ufw allow / deny

Add a rule.

sudo ufw allow <port>/<proto>
sudo ufw allow 22/tcp
sudo ufw deny out 25

ufw delete

Remove a rule by number or exact match.

sudo ufw status numbered
sudo ufw delete 3

ss

Show active sockets.

ss -tulpn


6. Wallets

bitcoin-cli

Talk to a running bitcoind.

bitcoin-cli <command> [args...]
bitcoin-cli getwalletinfo
bitcoin-cli -rpcwallet=cold walletprocesspsbt <psbt>

bitcoin-cli: new receiving address

bitcoin-cli getnewaddress

monero-wallet-cli

Interactive Monero wallet.

monero-wallet-cli --wallet-file <path>
monero-wallet-cli --wallet-file ~/wallets/daily.mw

monero-wallet-cli: view-only export

monero-wallet-cli --wallet-file full.mw
# then inside the REPL:
# export_view_key

7. Build

./build.sh

Build a PAI image from source.

./build.sh <edition> <arch>
./build.sh full amd64

ShellCheck

Lint all shell scripts in the repo.

shellcheck <files...>
find . -name '*.sh' -print0 | xargs -0 shellcheck

make test

Run the repo's test suite (where applicable).

make test


8. Diagnostics

journalctl

Query the systemd journal.

journalctl -u <unit> [-f] [--since <time>]
journalctl -u tor -f
journalctl --since '10 min ago' -p err

dmesg

Kernel ring buffer (hardware, drivers, OOM killer).

sudo dmesg -T | tail -n 50

ss

Open sockets and listeners (also listed in §5).

ss -tulpn

iotop

Per-process disk I/O.

sudo iotop -oPa

htop

Interactive process / CPU / memory viewer.

htop

free

Memory summary (useful before loading a big model).

free -h

nvidia-smi / rocm-smi

GPU state, where applicable.

nvidia-smi
# or on AMD:
rocm-smi


See also