safia command. This page documents each subcommand in detail.
Setup commands
safia setup
Runs the interactive setup wizard. This is the first command you run after installation. It guides you through every required configuration option and writes the result to a .env file in your SAFIA installation directory.
Syntax
- Language selection — choose between Bahasa Indonesia and English
- Telegram bot token — paste the token from
@BotFather - LLM provider and API key — pick Lunos, Groq, OpenAI, or a custom endpoint
- Model selection — the wizard fetches available models from the provider and lets you pick or type one
- Groq API key for Whisper — enables voice message transcription (optional if provider is not Groq)
- Firecrawl API key — enables web search and article fetching (optional)
- Database URL — defaults to SQLite; accepts PostgreSQL connection strings
- Redis URL — defaults to
redis://localhost:6379/0 - Admin dashboard — set credentials for the web UI at
http://127.0.0.1:5454
.env. If a .env already exists, it creates a .env.backup first.
If Redis is not reachable at
localhost:6379 when the wizard runs, it will warn you and pause. Start Redis before continuing or provide a different REDIS_URL.safia config
Opens the interactive configuration manager for editing an existing .env. Use this when you want to change individual settings — an API key, the LLM model, admin credentials — without re-running the full setup wizard.
Syntax
.env. A .env.backup is created automatically before every write.
Available sections in the menu:
| Menu item | Variables affected |
|---|---|
| View configuration | Read-only display of all current values |
| Telegram Bot Token | TELEGRAM_BOT_TOKEN |
| AI Provider & API Key | LLM_PROVIDER, LLM_API_KEY, LLM_BASE_URL |
| AI Model | LLM_MODEL |
| Groq Key (voice transcription) | GROQ_API_KEY |
| Firecrawl Key (web search) | FIRECRAWL_API_KEY |
| Database URL | DATABASE_URL |
| Redis URL | REDIS_URL |
| Admin Dashboard | ADMIN_USERNAME, ADMIN_PASSWORD, FLASK_SECRET_KEY |
| Advanced settings | VISION_MODEL, REMINDER_ENABLED, REMINDER_TICK_SECONDS, rate limits |
Daemon management commands
safia start
Starts the Telegram bot and the admin dashboard as background daemons. On first run, it also registers the services for auto-start on reboot.
Syntax
| Platform | Daemon system | Auto-start |
|---|---|---|
| Linux | systemd user services (safia.service, safia-admin.service) | Enabled on first start |
| macOS | launchd agents (com.safia.bot, com.safia.admin) | Enabled on first start |
| Windows | Scheduled Tasks | Enabled on first start |
safia start requires a .env file. If none is found, the command exits with an error and prompts you to run safia setup first.safia stop
Stops both the bot daemon and the admin dashboard daemon.
Syntax
safia uninstall if you want to remove the services entirely.
safia restart
Stops and then starts both daemons. Use this after changing .env to apply the new configuration.
Syntax
safia status
Shows whether the bot and admin dashboard daemons are currently running.
Syntax
safia status delegates to systemctl --user status and prints the full systemd unit status, including recent log excerpts.
safia logs [N]
Tails recent log output from both the bot and admin dashboard log files.
Syntax
| Parameter | Default | Description |
|---|---|---|
N | 30 | Number of lines to show from each log file |
- Bot:
~/.safia/logs/bot.log - Admin dashboard:
~/.safia/logs/admin.log
Maintenance commands
safia test
Runs the SAFIA test suite with verbose output.
Syntax
safia update
Pulls the latest code from the main branch, updates Python dependencies, and restarts the daemons — all in one command.
Syntax
Fetch and pull
Runs
git fetch origin main and git pull --ff-only origin main to fast-forward to the latest release.Sync dependencies
Runs
uv sync to install any new or updated Python packages declared in pyproject.toml.safia uninstall
Completely removes SAFIA from your system. This is irreversible.
Syntax
yes to confirm:
- All SAFIA code, configuration, database files, and logs under
~/.safia/ - The
safiaCLI binary at~/.local/bin/safia - All registered daemon services (systemd units, launchd plists, or Scheduled Tasks)