Skip to main content
The safia CLI is the single command you use to control every aspect of your SAFIA installation — from the first-time setup wizard to starting daemons, watching logs, and pulling updates. Once installed, the CLI wraps your bot and admin dashboard as background daemons that survive reboots, so you never have to manage processes manually.

Installation

Run the one-line installer in your terminal. It automatically handles Git, Python 3.12, the uv package manager, all Python dependencies, and the safia command itself — no Docker required. SAFIA uses an in-memory cache backed by SQLite, so no separate cache server needs to be installed.
SAFIA is installed to ~/.safia/safia and the safia binary is placed at ~/.local/bin/safia. The daemon auto-starts on reboot via systemd (Linux) or launchd (macOS).
After the installer finishes, confirm the safia command is available:
If your shell reports safia: command not found, ~/.local/bin is not in your PATH. Add it and reload your shell:
Use ~/.zshrc instead if you use Zsh.

All commands at a glance

Getting help

Run safia help (or safia --help) at any time to print a concise command reference directly in your terminal:

Common workflows

Initial setup

Follow these steps the first time you install SAFIA:
1

Install SAFIA

Run the one-line installer for your platform (see Installation above). The installer clones the repository, installs Python and all dependencies, and registers the safia command.
2

Run the setup wizard

The interactive wizard walks you through choosing an LLM provider, entering API keys, configuring the database and persistent cache file, and setting up the admin dashboard. It writes everything to a .env file when you confirm.
3

Start the daemons

This starts the Telegram bot and the admin dashboard (http://127.0.0.1:5454) as background daemons. Both are configured to restart automatically if they crash and to start on reboot.
4

Verify everything is running

You should see both the bot and the admin dashboard reported as running. Open Telegram, find your bot, and send /start to confirm it responds.

Daily use

Once the bot is up and running, most of your interaction with the CLI is limited to a few commands:

Editing configuration

If you need to change an API key, switch LLM providers, or update the admin password after the initial setup:
The interactive configuration manager loads your current .env, lets you edit any section, and writes the updated file (creating a .env.backup automatically). Restart the bot to apply changes:

Updating SAFIA

Pull the latest code, update Python dependencies, and restart in one step:
Run safia status before and after updating to confirm both daemons come back online cleanly.