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, Redis (installed and started if missing), all Python dependencies, and the safia command itself — no Docker required.
curl -fsSL https://raw.githubusercontent.com/superXdev/SAFIA/main/install.sh | bash
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:
safia --help
If your shell reports safia: command not found, ~/.local/bin is not in your PATH. Add it and reload your shell:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Use ~/.zshrc instead if you use Zsh.

All commands at a glance

CommandDescription
safia setupRun the interactive setup wizard — creates .env
safia configView and edit configuration interactively
safia startStart the bot and admin dashboard as background daemons
safia stopStop both daemons
safia restartRestart both daemons
safia statusShow running/stopped status of both daemons
safia logs [N]Tail recent log output (default: 30 lines)
safia testRun the test suite
safia updatePull latest changes, update dependencies, and restart
safia uninstallRemove SAFIA completely from your system

Getting help

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

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

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

Start the daemons

safia start
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

safia status
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:
safia status          # Are the daemons running?
safia logs            # What happened recently? (last 30 lines)
safia logs 100        # Show last 100 lines
safia restart         # Apply a config change without a full redeploy

Editing configuration

If you need to change an API key, switch LLM providers, or update the admin password after the initial setup:
safia config
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:
safia restart

Updating SAFIA

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