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
- Cache file path — defaults to
data/cache.db(SQLite-backed in-memory cache; no external service required) - 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.
SAFIA does not use any external cache server. Chat history, rate-limit counters, and market data caches live in an in-memory cache that is persisted to SQLite (
CACHE_DB_PATH), so state survives restarts.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:
After saving, restart the bot to apply changes:
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
Example output
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
Example output
- 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
1
Fetch and pull
Runs
git fetch origin main and git pull --ff-only origin main to fast-forward to the latest release.2
Sync dependencies
Runs
uv sync to install any new or updated Python packages declared in pyproject.toml.3
Restart daemons
Calls
safia restart so the updated code is loaded immediately.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)