diff --git a/docs/features/onboard.mdx b/docs/features/onboard.mdx index d74d095b..a22d13d5 100644 --- a/docs/features/onboard.mdx +++ b/docs/features/onboard.mdx @@ -36,8 +36,6 @@ graph LR -Launch the interactive bot setup wizard: - ```bash # Zero prompts once you have the token — wizard configures the bot # and installs the background daemon automatically. @@ -49,28 +47,17 @@ Once tokens are collected, the daemon is installed automatically by default. Run - -Select from the supported messaging platforms: + +The wizard asks exactly 4 questions — everything else uses sensible defaults: -``` -Choose a platform: -1. Telegram -2. Discord -3. Slack -4. WhatsApp -``` - -Each platform has different token requirements and setup steps. +1. **Which platform(s)?** — Telegram, Discord, Slack, WhatsApp (multi-select) +2. **Paste your bot token** — hidden input, validated against the platform API +3. **Allowed user IDs** — comma-separated allowlist (security). Leave blank for open access (not recommended). +4. **Install as background service?** — `Y` on desktop, auto-skipped on CI/headless. - -The wizard now supports multiple platforms and reads environment variables first. For each platform: - -- Enter bot tokens (password-hidden) -- Configure user allowlists for security -- Set home channels for proactive messages - -Tokens are automatically validated and the daemon is installed silently. + +The wizard writes bot configuration to `~/.praisonai/bot.yaml`, stores tokens/secrets in `~/.praisonai/.env` only (chmod 600), and shows the ✅ Done panel with your dashboard URL. @@ -100,24 +87,26 @@ The onboarding process follows these phases: | Phase | Description | |-------|-------------| | **Platform Selection** | Choose Telegram, Discord, Slack, or WhatsApp | -| **Token Entry** | Paste the bot token for your chosen platform | -| **Validation** | Wizard tests the token with the platform API | -| **Auto-install Daemon** | Automatically sets up the platform daemon (launchd/systemd/Windows Task) | +| **Token Entry** | Paste the bot token for your chosen platform and validate it against the platform API | +| **Security Setup** | Set allowed user IDs (or leave blank for open access) | +| **Daemon Install** | Sets up the platform daemon (launchd/systemd/Windows Task) | | **Configuration** | Writes config files to `~/.praisonai/` | | **Completion** | Shows the ✅ Done panel with all connection details | --- -## What Gets Installed +## What The Wizard Writes -When onboarding completes successfully, the wizard installs: +| File | Contents | +|------|----------| +| `~/.praisonai/bot.yaml` | Platform routing, token env-var references, allowlist, agent defaults | +| `~/.praisonai/.env` | Bot token(s), `*_ALLOWED_USERS`, `GATEWAY_AUTH_TOKEN` (chmod 600) | -| Component | Location | Purpose | -|-----------|----------|---------| -| **Platform daemon** | System service (launchd/systemd/Windows Task) | Keeps bot running in background | -| **Bot configuration** | `~/.praisonai/config/` | Stores tokens and settings | -| **Gateway auth token** | `~/.praisonai/.env` (env var `GATEWAY_AUTH_TOKEN`) | Authentication for web dashboard | -| **Dashboard URL** | Printed in Done panel | Local web interface | +Agent name (`assistant`) and instructions (`"You are a helpful AI assistant."`) use sensible defaults — edit `~/.praisonai/bot.yaml` to customise. The file contains the full schema as inline documentation. + + +**Upgrading?** Older `bot.yaml` files may contain a `home_channel` key (for example, `home_channel: ${TELEGRAM_HOME_CHANNEL}` or the equivalent for Discord / Slack / WhatsApp). This was never read by the gateway and is safe to delete. Re-running `praisonai onboard` and accepting the overwrite regenerates a clean file. + --- @@ -174,74 +163,12 @@ Re-running the wizard will: - Skip daemon installation if already installed and running (prints `✓ Daemon already installed and running`) - Preserve existing chat histories and agent memory - -If the daemon is already installed, re-running `praisonai onboard` is a no-op for the daemon service. Only configuration files are updated. - - ---- - -## Manage the Daemon - -The onboard wizard installs platform-specific daemon services. Use these commands to restart after configuration changes: - - - -```bash -# Restart the daemon service -launchctl kickstart -k gui/$(id -u)/ai.praison.bot - -# Check daemon status -launchctl list | grep ai.praison -``` - -Service label: `ai.praison.bot` (launchd) - - - -```bash -# Restart the daemon service -systemctl --user restart praisonai-bot - -# Check daemon status -systemctl --user status praisonai-bot -``` - -Service unit: `praisonai-bot` (systemd) - - - -```bash -# Restart the daemon service -schtasks /End /TN PraisonAIGateway && schtasks /Run /TN PraisonAIGateway - -# Check daemon status -schtasks /Query /TN PraisonAIGateway -``` - -Service name: `PraisonAIGateway` (Task Scheduler) - - - ---- - -## Terminology - -Understanding the commands and what they actually do: +The config file path is **always** `~/.praisonai/bot.yaml` (no longer prompted for). When re-running, the overwrite prompt now says `{path} exists. Overwrite with fresh config?` with `Kept existing file` on decline. -**Important distinction**: `praisonai gateway start` runs in the **foreground** (not a daemon). The daemon is installed by `praisonai gateway install` or automatically by `praisonai onboard`. +If the daemon is already installed, re-running `praisonai onboard` is a no-op for the daemon service. Only configuration files are updated. -| Command | What it does | -|---------|--------------| -| `praisonai gateway start` | Runs the gateway **in the foreground**. Not a daemon. | -| `praisonai gateway install` | Installs the launchd/systemd/Task-Scheduler service that auto-runs `praisonai gateway start` in the background with `KeepAlive=true`. | -| `praisonai gateway status` | Reports whether the daemon is loaded + running. | -| `praisonai gateway uninstall` | Removes the daemon service. | -| `praisonai onboard` | Configures messaging bots and automatically runs `praisonai gateway install` | - -The daemon service literally wraps `praisonai gateway start --config ~/.praisonai/bot.yaml` to run it persistently in the background. - --- ## Relationship to Setup @@ -344,7 +271,7 @@ Telegram has the simplest setup process and most permissive API limits. Use it f -Bot tokens are stored in `~/.praisonai/config/`. Ensure this directory has proper permissions (600) and exclude it from version control. +Bot tokens are stored in `~/.praisonai/.env`. Ensure this file has proper permissions (600) and exclude it from version control. diff --git a/docs/install/installer.mdx b/docs/install/installer.mdx index 64e9ccc8..b15fedc3 100644 --- a/docs/install/installer.mdx +++ b/docs/install/installer.mdx @@ -69,7 +69,7 @@ flowchart TD Runs `praisonai setup` for LLM configuration - Optional `praisonai onboard` for messaging bots (Telegram/Discord/Slack/WhatsApp) + Optional `praisonai onboard` for messaging bots — asks 4 questions to configure Telegram/Discord/Slack/WhatsApp Shows either onboard wizard's ✅ Done panel or installer's Next Steps @@ -152,7 +152,7 @@ curl -fsSL https://praison.ai/install.sh | bash -s -- --help After successful installation and verification, the installer runs an interactive onboarding sequence: 1. **Setup wizard** (`praisonai setup`) - Configure LLM API keys -2. **Bot onboarding** (`praisonai onboard`) - Set up messaging bots (default: Yes) +2. **Bot onboarding** (`praisonai onboard`) - Asks 4 questions to set up messaging bots (default: Yes). See the [onboard guide](/docs/features/onboard) for details. 3. **Final summary** - Either the onboard wizard's ✅ Done panel or installer's Next Steps **Two possible end states:**