feat(skills): explain nanobot usage from bundled documentation (#6176)

* feat(skills): add nanobot documentation guide with bundled docs

* docs: prefer graphical setup and align bundled guides with runtime

* docs: lead provider setup with built-in endpoint defaults

* fix: preserve documentation packaging and lookup across install paths

* fix(skills): narrow documentation loading to relevant sections

* refactor(skills): keep documentation guidance concise

* fix(docs): complete first-use workflows and clarify runtime boundaries

* style(docs): remove manual paragraph wrapping

* docs: guide first-run users to conversational setup help

* docs: fold README installation alternatives and details

* docs: separate README alert marker from its body

* docs: clarify README onboarding and runtime boundaries
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-13 00:44:25 +08:00
1 parent 23941355a8
commit cd2a863710
61 files changed
+1729 -634

No files matched your search

+3 -1
View File
@@ -2,6 +2,8 @@
Start with [Install and Quick Start](../quick-start.md) and get one reply before using a guide below. Each guide targets one outcome; linked reference pages hold the complete option tables and edge cases.
You can ask nanobot to guide your next task using the built-in `nanobot-document` skill, or read a guide yourself. See [Continue with nanobot](../quick-start.md#continue-with-nanobot) for availability and examples. Each task guide describes its starting requirements, setup steps, and how to check the result; use the parts that match your current instance.
## Start and Use
| Goal | Guide |
@@ -14,7 +16,7 @@ Start with [Install and Quick Start](../quick-start.md) and get one reply before
## Connect a Chat App
Use **Settings → Channels** in the WebUI for guided setup. These guides explain the account, bot, token, permission, and test-message steps on each platform.
Use **Channels** in the WebUI for guided setup. These guides explain the account, bot, token, permission, and test-message steps on each platform.
| Goal | Guide |
|---|---|
+10 -16
View File
@@ -13,33 +13,27 @@ This guide explains how to use nanobot's long-term AI agent memory: session hist
Use memory when an agent should remember stable preferences, project facts, decisions, and recurring context across sessions. Do not use memory as a dumping ground for every raw transcript; nanobot separates short-term messages from curated durable knowledge.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Use an installation with a configured model that has already returned a reply. If this is your first setup, follow [Quick Start](../quick-start.md), then return here. Existing WebUI users can continue in the current instance.
## Minimal working example
Ask the agent to remember a stable fact in a normal session, then run Dream:
In your existing chat, send a specific preference, such as “For Acme release notes, use concise bullet points.” Then send these commands one at a time, waiting for each to finish:
```text
/compact
/dream
```
Inspect recent memory changes:
```text
/dream-log
```
The exact files live in the active workspace, usually under `~/.nanobot/workspace/`.
Compaction puts recent conversation into the archive Dream reads. Dream then decides what to save; inspect its changes to confirm the preference reached `USER.md` or `memory/MEMORY.md`. Ask the agent to read the saved preference, then check it in a new chat. For corrections and restoration, follow [Save and Check a Preference](../memory.md#save-and-check-a-preference).
The files live in the configured agent workspace, normally `~/.nanobot/workspace/`. Selecting a project or starting a new topic does not move or isolate this memory.
## Production notes
- Use one workspace per project or personal context.
- Use separate configured instances when projects or clients need separate memory.
- Keep durable facts concise; old session details belong in `history.jsonl`.
- Use `/dream-prompt init` when a workspace needs custom memory guidance.
- Review Git-backed memory changes when memory affects important workflows.
@@ -52,9 +46,9 @@ The exact files live in the active workspace, usually under `~/.nanobot/workspac
## Troubleshooting
- If memory feels stale, run `/dream` and inspect `/dream-log`.
- If a recent preference is missing, run `/compact`, wait for completion, then run `/dream` and inspect `/dream-log`.
- If memory changed incorrectly, use `/dream-restore` to inspect and restore previous versions.
- If a new session lacks context, confirm it uses the same workspace.
- If a new session lacks context, confirm the fact was saved and it uses the same configured agent workspace.
## Related nanobot docs
+2 -6
View File
@@ -13,13 +13,9 @@ nanobot includes a browser WebUI for persistent chat sessions, visible agent act
Use the WebUI when you want a local AI agent interface that is easier to operate than a terminal, especially for project work, file attachments, model switching, workspace selection, Apps, Skills, and scheduled automations.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
The published wheel already includes the WebUI bundle. You only need the `webui/` source directory when changing the frontend.
+3 -15
View File
@@ -19,23 +19,11 @@ Follow [Quick Start](../quick-start.md) to install nanobot using the recommended
## Minimal working example
First prove the runtime can answer:
```bash
nanobot agent -m "Hello!"
```
Then open the browser workbench:
```bash
nanobot webui
```
The WebUI starts the local gateway, opens a browser, and keeps persistent chat sessions for longer work.
Continue in the WebUI from Quick Start. Start a new topic, select a practice folder and **Restricted** access, and ask nanobot to summarize a file there. See [Your first file task](../start-without-technical-background.md#your-first-file-task) for a complete example. Reopen the same instance with `nanobot webui` if it is not running; the launcher starts or joins its gateway.
## Production notes
- Keep one workspace per project or personal context.
- Choose a project folder for file work. Use [separate instances](../multiple-instances.md) when identity or long-term memory must be isolated.
- Use `modelPresets` when you want stable names for fast, deep, local, or fallback models.
- Keep `nanobot gateway` running for WebUI, chat apps, automations, and the WebSocket channel.
- Use the Python SDK or OpenAI-compatible API when another program should call the agent.
@@ -50,7 +38,7 @@ The WebUI starts the local gateway, opens a browser, and keeps persistent chat s
## Troubleshooting
- `nanobot status` shows the config path, workspace path, and active model.
- If `nanobot agent -m "Hello!"` fails, fix provider setup before opening the WebUI or chat apps.
- If the model cannot reply, use **Settings → Models** to correct its connection before adding chat apps.
- If the WebUI opens but does not answer, check gateway logs and provider credentials.
## Related nanobot docs
+5 -9
View File
@@ -13,13 +13,9 @@ nanobot can run as a self-hosted chatbot or AI agent in Telegram, Discord, Slack
Use chat apps when the agent should live where users already communicate: private DMs, team channels, group chats, email threads, or bot workspaces.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot webui
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Send `Hello!` in the WebUI before adding a channel. Then choose one platform guide for the bot/account prerequisites:
@@ -38,14 +34,14 @@ Send `Hello!` in the WebUI before adding a channel. Then choose one platform gui
Use the guided channel setup:
1. Get the platform token, login state, webhook, or mailbox credentials.
2. Open **Settings → Channels** in the WebUI.
2. Open **Channels** in the WebUI.
3. Choose the platform and open its setup panel.
4. Complete the credential or QR flow and install optional support if prompted.
5. Restart when the WebUI requests it.
6. Send a private test message.
7. Approve the pairing request in the WebUI when a DM-capable channel asks for one.
If your installed release does not show **Settings → Channels**, use the full [Chat Apps reference](../chat-apps.md#manual-setup-pattern) to configure the channel manually.
If your installed release does not show **Channels**, use the full [Chat Apps reference](../chat-apps.md#manual-setup-pattern) to configure the channel manually.
Check status from the terminal when you need a lower-level confirmation:
@@ -78,7 +74,7 @@ Use the full [Chat Apps reference](../chat-apps.md) when you manage `config.json
- If `nanobot channels status` does not show the channel, the config key or optional dependency is likely missing.
- If the first DM returns a pairing code, approve the pending request in the WebUI or use `/pairing approve <code>` from an authorized chat.
- If messages do not arrive, run `nanobot gateway --verbose` and compare platform credentials, event permissions, and allow lists.
- If messages do not arrive, inspect the running gateway logs and compare platform credentials, event permissions, and allow lists. Use `--verbose` when restarting that gateway for diagnosis.
- If group replies are unexpected, review that channel's group policy.
## Related nanobot docs
@@ -14,13 +14,7 @@ Use Langfuse when you need observability for model requests, latency, errors, co
## Install
Install nanobot and prove the agent works:
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. Continue with the same working instance.
Install Langfuse:
+7 -6
View File
@@ -12,13 +12,9 @@ This guide adds an MCP server to nanobot so the agent can use external tools thr
Use MCP when the capability you need already exists as an MCP server, or when you want external tools to be managed outside nanobot core.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Install the MCP server runtime separately. Many examples use `npx`, `uvx`, or a remote HTTP endpoint.
@@ -32,6 +28,9 @@ For local interactive setup:
4. Save and restart when prompted.
5. Mention the connected MCP server with `@` in the next message and ask for a small test action.
<details>
<summary>Manual configuration</summary>
For manual or deployment-managed config, add this to `~/.nanobot/config.json`:
```json
@@ -50,6 +49,8 @@ For manual or deployment-managed config, add this to `~/.nanobot/config.json`:
Restart nanobot and ask a question that requires the MCP tool.
</details>
## Production notes
- Prefer `enabledTools` over exposing every tool by default.
+9 -6
View File
@@ -12,18 +12,19 @@ Model fallback lets nanobot try a primary model first, then fall back to one or
Use fallback when you want better reliability across rate limits, provider outages, local model downtime, or cost-sensitive routing.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Verify each provider works before adding it as a fallback.
## Minimal working example
In **Settings → Models**, create the primary and backup presets, then use **Enable preset** and arrange their order. The first enabled preset is primary; later entries are tried as fallbacks. Save and test each preset before relying on the chain.
<details>
<summary>Manual configuration</summary>
Merge this shape into `~/.nanobot/config.json` and replace provider/model names with ones you control:
```json
@@ -55,6 +56,8 @@ Merge this shape into `~/.nanobot/config.json` and replace provider/model names
String entries in `fallbackModels` are preset names, not raw model IDs. Replace the placeholder model IDs with currently supported model IDs from your provider. The [Provider Cookbook](../provider-cookbook.md) has concrete recipes for common providers.
</details>
## Production notes
- In the WebUI, a reply produced by a named fallback preset shows its provider logo and preset name next to the reply timestamp. Hover, focus, or click the badge for an explanation. The composer still shows your selected preset; primary replies have no fallback badge. Saved replies retain the name used for that invocation, even after a preset is renamed or deleted. Older replies without recorded attribution and unnamed inline fallback objects are not labeled.
+21 -3
View File
@@ -144,7 +144,14 @@ Ollama reuses the existing model layers. The new tag adds a small template and m
## Select the derived model in nanobot
Merge this preset into `~/.nanobot/config.json` and select it:
Open **Settings → Models → New preset**, select your Ollama connection, enter the derived model name, and save. Use **Enable preset** if it is disabled, then drag it to the first enabled position, marked **Primary**. This saves the default model used by sessions without their own model selection, including the fresh CLI session below.
Run the CLI commands with the same nanobot home as the WebUI. If the WebUI uses a custom home, add `--home <path>` before each subcommand.
<details>
<summary>Manual configuration</summary>
Merge this preset into your instance's `config.json` to make it the default:
```json
{
@@ -170,7 +177,9 @@ Merge this preset into `~/.nanobot/config.json` and select it:
}
```
Verify the selected model and repeat the two-turn check:
</details>
Run `nanobot status` and confirm that **Model** shows `llama3.1:8b-prefix-stable-v1`, then repeat the two-turn check. If `cli:ollama-stable-check` already exists with a saved model selection, use a new session name for both turns.
```bash
nanobot status
@@ -184,7 +193,16 @@ In one controlled test with Ollama 0.32.1, `llama3.1:8b`, and one slot, the seco
## Roll back
Switch `agents.defaults.modelPreset` back to the original preset. When no config uses the derived tag, remove it with:
In **Settings → Models**, move the original preset back to the first enabled position and disable the derived preset. For conversations with a saved model selection, select the original preset in the composer as well.
<details>
<summary>Manual configuration</summary>
Set `agents.defaults.modelPreset` back to the original preset in your instance's `config.json`.
</details>
When no configuration or session uses the derived tag, remove it with:
```bash
ollama rm llama3.1:8b-prefix-stable-v1
@@ -12,12 +12,9 @@ nanobot can call OpenAI-compatible model providers by configuring an `apiBase`,
Use this for local or hosted services that expose OpenAI-compatible endpoints, including internal gateways, local model servers, and provider proxies that are not already named in nanobot.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Verify the endpoint responds before debugging nanobot:
@@ -27,6 +24,14 @@ curl -sS https://api.example.com/v1/models
## Minimal working example
1. Open **Settings → Models → New preset**.
2. In **Provider**, choose **Add provider** and create a custom connection with your endpoint URL and credential.
3. Select the model served by that endpoint, name the preset, and save.
4. Select the preset in the chat composer and send `Hello!`.
<details>
<summary>Manual configuration</summary>
Merge this into `~/.nanobot/config.json`:
```json
@@ -54,11 +59,9 @@ Merge this into `~/.nanobot/config.json`:
}
```
Then run:
</details>
```bash
nanobot agent -m "Hello!"
```
Verify in the WebUI with the new preset selected. For the manual snippet above, which sets the global default, you can instead run `nanobot agent -m "Hello!"` from the same instance. A different CLI session does not inherit a WebUI topic's model selection.
## Production notes
+8 -7
View File
@@ -12,13 +12,9 @@ nanobot includes built-in web search and web fetch tools. Search uses DuckDuckGo
Configure web search when the agent needs current information, public web research, source discovery, or page fetching during a task.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Web tools are enabled by default. Configure them only when you want a specific provider, API key, proxy, fetch behavior, or SSRF allowlist.
@@ -27,11 +23,14 @@ Web tools are enabled by default. Configure them only when you want a specific p
For local interactive setup:
1. Run `nanobot webui`.
2. Open **Settings → Web**.
2. Open **Settings → Capabilities → Web access**.
3. Enable web search, choose a provider, and enter its API key if required.
4. Save and restart when prompted.
5. Ask a question that requires current information and inspect the cited sources.
<details>
<summary>Manual configuration</summary>
For manual or deployment-managed config, use the default search provider:
```json
@@ -64,6 +63,8 @@ Or use an API-backed provider:
Ask a question that requires current information and inspect the tool activity in the WebUI or logs.
</details>
## Production notes
- Keep API keys in environment variables.
+19 -19
View File
@@ -12,24 +12,9 @@ The nanobot gateway is the long-running self-hosted AI agent process that keeps
Use this when nanobot should keep running after a single CLI turn. Chat apps, browser sessions, background automations, local triggers, and server-side integrations all depend on a live gateway.
## Install
## Start from your current setup
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot status
nanobot agent -m "Hello!"
```
## Minimal working example
Run the gateway in the foreground:
```bash
nanobot gateway
```
For WebUI background usage:
If nanobot already replies in the WebUI, its gateway is already running. To keep it alive after closing the launcher, close the foreground launcher and start the same instance in background mode:
```bash
nanobot gateway --background
@@ -37,7 +22,22 @@ nanobot gateway status
nanobot gateway logs
```
Open the configured WebUI URL in a browser, or run `nanobot webui` as a foreground client.
Run `nanobot webui` when you need to return to the browser; it attaches to the running gateway. Do not run a second foreground gateway for the same instance.
For a new host, choose one setup path:
- **Docker:** follow [container initialization and verification](../deployment.md#docker-compose). It creates the config and checks the model inside the container; a host nanobot installation is unnecessary.
- **Host installation:** follow the [quick start](../quick-start.md). On a headless machine, use `nanobot onboard --wizard`, then `nanobot agent -m "Hello!"` to check the selected model.
## Keep the gateway running
Background mode keeps the current process alive; for automatic startup after reboot and restart on failure, choose [Docker Compose](../deployment.md#docker-compose), a [systemd user service](../deployment.md#linux-service), or a [macOS LaunchAgent](../deployment.md#macos-launchagent). Use the same config and workspace as the successful model check. Stop a manually managed gateway before starting a service for that instance.
For foreground diagnosis only:
```bash
nanobot gateway --verbose
```
## Production notes
@@ -50,7 +50,7 @@ Open the configured WebUI URL in a browser, or run `nanobot webui` as a foregrou
## Security notes
- Plan ports before exposing services. Gateway health defaults to `18790`, WebUI/WebSocket defaults to `8765`, and `nanobot serve` defaults to `8900`.
- Bind externally only when you have configured tokens or API keys.
- Protect WebUI and API network listeners with their respective token or key settings. The health endpoint has no authentication; keep its published port on loopback or behind a restricted monitoring interface.
- Keep chat access control intentional before deploying.
- Use Docker or Linux sandboxing when shell tools are enabled for unattended work.
+26 -16
View File
@@ -11,24 +11,24 @@ This guide connects nanobot to Discord so a Discord user or server channel can t
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- Access to the Discord Developer Portal.
- A Discord server where you can invite a bot.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the Discord channel
Create a Discord application and bot, enable **Message Content Intent**, and invite it with permission to read history and send messages. In **Channels → Discord**, enter the bot token, enable the channel, and save. Use **Advanced** for allowed channels and reply behavior; follow any restart prompt.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -60,21 +60,31 @@ Invite the bot with permissions to read history and send messages.
Set `replyToMessage` to `true` to make responses use Discord's native reply UI. It defaults to `false`, preserving the existing behavior.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
Send the bot a DM first. It should return a pairing code. Approve it from a trusted local surface:
Send the bot a DM first. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
After approval, mention it in an allowed server channel:
```text
+25 -16
View File
@@ -11,24 +11,24 @@ This guide turns nanobot into an email AI agent that polls IMAP for accepted mes
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A mailbox for the bot.
- IMAP and SMTP access. For Gmail, use an app password rather than your account password.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the Email channel
Prepare a dedicated mailbox and app password. In **Channels → Email**, grant mailbox access, enter IMAP and SMTP settings, and restrict allowed senders. Use **Advanced** for trusted authentication services and other mailbox options. Enable the channel, save, and follow any restart prompt.
<details>
<summary>Manual configuration</summary>
Merge this snippet into `~/.nanobot/config.json` and replace the addresses and passwords:
```json
@@ -54,12 +54,13 @@ Merge this snippet into `~/.nanobot/config.json` and replace the addresses and p
}
```
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
@@ -80,7 +81,12 @@ Email authentication now requires an explicit receiving-service trust anchor. Th
1. Back up your configuration and temporarily disable the Email channel while configuring the receiver. Do not turn off SPF/DKIM verification as an upgrade workaround.
2. Confirm with your receiving mail service or administrator which exact `authserv-id` it adds, and that it strips externally supplied headers claiming that identity. It must provide one consolidated `Authentication-Results` header. A name visible in a received email is not, by itself, proof of trust; do not infer it from your IMAP hostname or copy it from an arbitrary message.
3. In Email settings, open **Advanced** and set **Trusted authentication services**, or merge the following fields into `channels.email` in your existing config:
3. In **Channels → Email**, open **Advanced** and set **Trusted authentication services** to your confirmed receiver identity. Keep SPF/DKIM verification enabled.
<details>
<summary>Manual configuration</summary>
Merge these fields into `channels.email` in your existing config:
```json
{
@@ -91,6 +97,9 @@ Email authentication now requires an explicit receiving-service trust anchor. Th
```
The example is for a receiver using `mx.google.com`; use your confirmed receiver identity instead. JSON uses a list; the WebUI accepts comma-separated values. Wildcards and URLs are not accepted. Multiple configured identities are alternatives, not permission to combine multiple trusted result headers.
</details>
4. Check the IMAP/SMTP connection, re-enable Email, and restart the gateway after editing a configuration file. Send one ordinary message from an allowed address and confirm receipt and reply. A successful connection check verifies credentials and configuration, not your mail service's header-stripping policy.
Each enabled verification method must pass and identify the visible sender's domain, or a parent/subdomain of it. DKIM uses `header.d` when present, otherwise the domain of the receiver-reported `header.i`. This is not a full DMARC policy implementation, and domain authentication does not independently authenticate the mailbox local part. Forwarders, mailing lists, or receivers that emit separate SPF and DKIM result headers may need mail-service changes. Keep Email disabled if the receiver cannot meet the trust contract.
+26 -16
View File
@@ -11,24 +11,24 @@ This guide connects nanobot to Feishu or Lark through the `feishu` channel. The
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A Feishu or Lark account that can create or approve bot apps.
- Permission to run `nanobot gateway` continuously.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the Feishu channel
Open **Channels → Feishu** and follow the QR connection flow. Install support if prompted, then open the authorization link or scan the code. If using an existing app, enter its App ID and App Secret in the setup panel. Enable the channel, save, and follow any restart prompt.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -66,21 +66,31 @@ Omitting `allowFrom` enables pairing-only mode. A new user should DM the bot, ge
For manual apps, enable the Bot capability, receive-message events, and Long Connection mode. If your app cannot get the `cardkit:card:write` permission, set `"streaming": false`.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
DM the bot first. It should return a pairing code. Approve it from a trusted local surface:
DM the bot first. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
After approval, DM the bot again or mention it in a group chat:
```text
+8 -3
View File
@@ -104,7 +104,7 @@ Keep `nanobot webui` running throughout the setup.
### 1. Enter the public address
1. Open **Settings → Channels → Linear**.
1. Open **Channels → Linear**.
2. Enter your public origin in **Public HTTPS URL**, for example `https://nanobot.example.com`.
3. Leave the three credential fields empty for now.
4. Wait for **Settings saved.**, then select **Create Linear app**. Selecting it before entering an address shows a prompt and returns focus to the URL field.
@@ -141,7 +141,7 @@ In the new Linear app's settings, copy these values:
| Client Secret | **OAuth client secret** |
| Webhook signing secret | **Webhook signing secret** |
Return to **Settings → Channels → Linear** and paste all three values. Ordinary fields save automatically after a short pause. For each secret, select **Save** beside that field and wait for its **Saved** status. **Connect Linear** becomes available once the required settings are saved. Listener settings, callback paths, and allowed users are in **Advanced**; setup guides are in the dialog's **Help** menu.
Return to **Channels → Linear** and paste all three values. Ordinary fields save automatically after a short pause. For each secret, select **Save** beside that field and wait for its **Saved** status. **Connect Linear** becomes available once the required settings are saved. Listener settings, callback paths, and allowed users are in **Advanced**; setup guides are in the dialog's **Help** menu.
A masked value with **Saved** means this instance already has the secret; it is not an empty input. To change it, select **Replace**, enter the new secret, then **Save**. **Cancel** or Escape leaves the saved secret unchanged. Leaving the field or showing the newly typed value does not save it. A failed save retains the draft for retry; the old secret is never sent back to the browser.
@@ -223,7 +223,7 @@ Member switches are stored in the instance's `linear/state.sqlite3`, separately
The setup is complete when all of these checks pass:
- **Settings → Channels → Linear** shows the channel as on with no runtime error.
- **Channels → Linear** shows the channel as on with no runtime error.
- The Linear app's **Webhooks → Delivery status** is enabled, its URL uses the current public origin, and **Events** includes **Agent session events**.
- While the channel is running, opening `http://127.0.0.1:3979/linear/health` on the nanobot machine returns `{"ok":true}`. Use your configured host and port if you changed them.
- If your proxy also forwards `/linear/health`, its public URL returns `{"ok":true}`. This is optional: a proxy exposing only the callback and webhook can correctly return 404 for public health. Use successful OAuth and webhook delivery to verify those two routes; do not expose the admin UI for this check.
@@ -234,6 +234,9 @@ The setup is complete when all of these checks pass:
## Manual configuration
<details>
<summary>Manual configuration</summary>
Use this path when deployment tooling manages `~/.nanobot/config.json` directly. The WebUI path above is easier because it generates the Linear app definition and completes OAuth for you.
Merge this section into `~/.nanobot/config.json`:
@@ -267,6 +270,8 @@ Webhook: https://nanobot.example.com/linear/webhook
Subscribe the webhook to exactly `AgentSessionEvent`, `PermissionChange`, and `OAuthAuthorization` and enable webhook delivery in the Linear app's settings. Do not subscribe to `Comment`. The OAuth connection step in the WebUI is still required: it installs the app and stores the workspace-scoped access and refresh tokens.
</details>
## Security and reliability
- OAuth uses authorization code flow, PKCE, a short-lived CSRF state, and the Linear app actor.
+13 -14
View File
@@ -13,29 +13,28 @@ nanobot can keep agent work alive across turns through sustained goals, persiste
Use this when the task is not a one-shot answer: project work, recurring checks, scheduled summaries, file maintenance, multi-step research, or local triggers from scripts and build jobs.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Use an installation with a configured model that has already returned a reply. If this is your first setup, follow [Quick Start](../quick-start.md), then return here. Existing WebUI users can continue in the current instance.
## Minimal working example
Start a gateway:
```bash
nanobot gateway
```
From the WebUI or a chat session, start a sustained goal:
Your running WebUI or TUI already uses a gateway. In that chat, start a sustained goal:
```text
/goal Review this workspace, identify missing tests, and propose the smallest next fix.
```
For scheduled or trigger-based runs, create the automation from the target chat so nanobot can link it to the correct session and workspace.
For scheduled or trigger-based runs, create the automation from the target chat so nanobot can link it to the correct session and project context.
To keep work running after closing the interactive launcher, promote the existing gateway from a terminal:
```bash
nanobot gateway --background
nanobot gateway status
```
Use the same `--config` and explicit `--workspace` selectors as your instance. In the TUI, `/detach` also keeps the gateway running while closing the client. A background gateway does not survive a machine shutdown by itself; see [Deployment](../deployment.md) for service management. Review [schedule restart behavior](../automations.md#delivery-and-reliability) before relying on a timed task.
## Production notes
+28 -16
View File
@@ -11,24 +11,26 @@ This guide connects nanobot to Mattermost through the built-in Mattermost channe
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A Mattermost server URL.
- A bot token or personal access token for the bot account.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the Mattermost channel
Prepare the Mattermost bot token and team ID. In **Channels → Mattermost**, enter the server URL, token, and team ID. Use **Advanced** for group and thread policies; for DM pairing, choose **Allowlist** with an empty DM allowlist. Enable the channel, save, and follow any restart prompt.
DM approval does not restrict group access. With the mention policy below, any member can invoke the bot in a channel it can see. For DM-only access, set the group policy to **Allowlist** and leave the group allowlist empty. To allow selected channels, add their IDs; all members of those channels can then use the bot under the configured mention/thread rules.
<details>
<summary>Manual configuration</summary>
Merge this snippet into `~/.nanobot/config.json`:
```json
@@ -56,21 +58,31 @@ When `groupPolicy` is `"allowlist"`, `groupAllowFrom` remains the outer channel
Mattermost DMs are open by default. Setting `dm.policy` to `"allowlist"` with no `dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the code before using the bot normally.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
DM the bot account. It should return a pairing code. Approve it from a trusted local surface:
DM the bot account. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
Then DM the bot again, or mention it in a channel where the bot has access:
```text
+11 -8
View File
@@ -5,25 +5,26 @@ nanobot can connect MCP servers and expose their tools to the agent alongside bu
## What you will build
- a working nanobot agent
- one MCP server configured in `config.json`
- one MCP server connected through **Apps → MCP**
- a restricted set of tools available to the model
## When to use this
Use MCP when a tool already exists as an MCP server, when another application publishes an MCP adapter, or when you want a clean boundary between nanobot and external tool logic.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Complete [Quick Start](../quick-start.md) if nanobot is not installed or cannot reply yet. If you already have a working WebUI or CLI session, continue here using that instance; no reinstall or second gateway is needed.
Install the MCP server's own runtime separately. For example, many local MCP servers use `npx` or `uvx`.
## Minimal working example
Open **Apps → MCP**, choose a preset or add a custom server, configure its command or endpoint, limit its enabled tools, and save. Follow any connection or restart prompt, then mention the integration with `@` in chat and request a small test action.
<details>
<summary>Manual configuration</summary>
Add a stdio MCP server to `~/.nanobot/config.json`:
```json
@@ -40,6 +41,8 @@ Add a stdio MCP server to `~/.nanobot/config.json`:
}
```
</details>
Restart nanobot, then ask a question that needs the MCP tool.
## Production notes
@@ -58,7 +61,7 @@ Restart nanobot, then ask a question that needs the MCP tool.
## Troubleshooting
- Start `nanobot gateway --verbose` and check MCP startup logs.
- Check MCP startup logs on the running gateway; use `--verbose` when restarting it for diagnosis.
- Confirm the MCP command works by itself before debugging nanobot.
- If an HTTP MCP server is blocked, review the SSRF whitelist and use a narrow host CIDR.
+12 -13
View File
@@ -13,27 +13,25 @@ nanobot can expose a local OpenAI-compatible endpoint behind `/v1/chat/completio
Use this when an existing client, another language, or a separate process already knows how to call an OpenAI-compatible API. Use the Python SDK when you want in-process access to sessions, memory, runtime helpers, and hooks.
## Install
## Start from your current setup
If you already get replies in the WebUI, open **Settings → System**, configure the API service, and start it. Keep that gateway running; do not also start `nanobot serve` on the same port.
If nanobot is not configured yet, complete the [quick start](../quick-start.md) first. For a terminal-managed API using that existing config:
```bash
python -m pip install nanobot-ai
nanobot plugins enable api
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
## Minimal working example
Start the API server:
```bash
nanobot serve
```
Call the chat endpoint:
## Make a request
In another terminal, call the chat endpoint. If you configured an API key, set `NANOBOT_API_KEY` to it first:
```bash
curl http://127.0.0.1:8900/v1/chat/completions \
-H "Authorization: Bearer $NANOBOT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "hi"}],
@@ -43,8 +41,9 @@ curl http://127.0.0.1:8900/v1/chat/completions \
## Production notes
- Pass `session_id` to isolate users, jobs, or workflows.
- Streaming uses Server-Sent Events when `stream` is `true`.
- Pass `session_id` to separate conversation histories. Callers still share files, memory, and tool permissions; it is not a user authorization boundary.
- Streaming uses Server-Sent Events when `stream` is `true`. A stream without `[DONE]` is incomplete; retries can repeat tool actions. See [sessions, failures, and retries](../openai-api.md#sessions-failures-and-retries).
- The API service returns results to its HTTP client; it does not deliver `message` tool calls to chat apps. Forward results from your application when that is needed.
- `/v1/models` reports the fixed model surface expected by compatible clients.
- File uploads are supported through JSON base64 or multipart form data.
+4 -7
View File
@@ -14,13 +14,9 @@ Use the Python SDK for notebooks, evals, product backends, local scripts, workfl
Use the OpenAI-compatible API instead when another language or process should call nanobot over HTTP.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
Use an installation with a configured model that has already returned a reply. If this is your first setup, follow [Quick Start](../quick-start.md), then return here. Existing WebUI users can continue in the current instance.
## Minimal working example
@@ -42,9 +38,10 @@ asyncio.run(main())
## Production notes
- Reuse one `Nanobot` instance for related work.
- Pass `session_key` when a user, job, or eval case needs persistent history.
- Pass `session_key` when a job or eval case needs persistent history. Different keys share workspace files and long-term memory.
- Use `bot.stream(...)` when the caller needs live text, tool, or failure events.
- Use hooks for audit logs or custom observability.
- For short-lived scripts, see [Persist memory](../python-sdk.md#persist-memory-in-a-short-lived-script): closing the SDK does not run Dream.
## Security notes
+26 -16
View File
@@ -11,24 +11,24 @@ This guide connects nanobot to QQ through the official `qq` channel. The officia
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- Access to the QQ Open Platform.
- A QQ account added to the bot sandbox for testing.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the QQ channel
Create a QQ bot application, copy its AppID and AppSecret, and add your account to the sandbox members. In **Channels → QQ**, enter those credentials, enable the channel, and save. Follow any installation or restart prompt.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -52,21 +52,31 @@ In the QQ Open Platform, create a bot application and copy the AppID and AppSecr
Omitting `allowFrom` enables pairing-only mode. A new private sender should get a pairing code before normal agent access.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
Send the QQ bot a private message from a sandbox account. It should return a pairing code. Approve it from a trusted local surface:
Send the QQ bot a private message from a sandbox account. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
Send the message again after approval.
## Security notes
+15 -12
View File
@@ -13,16 +13,17 @@ This guide covers the practical controls to review before letting a nanobot agen
Use this before exposing nanobot to teammates, chat apps, public networks, broad web access, or unattended automations.
## Install
## Before you start
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
If nanobot is already open, continue in that WebUI. Otherwise follow the [first-run guide](../start-without-technical-background.md) to install it, configure a model, and send a test message.
## Minimal working example
Open **Settings → Advanced**. Enable workspace restriction, then choose the shell sandbox supported by your host (`bwrap` on Linux or `seatbelt` on macOS). Disable shell execution when the agent does not need it. Follow any restart prompt.
<details>
<summary>Manual configuration</summary>
Start with workspace restriction:
```json
@@ -37,22 +38,24 @@ Start with workspace restriction:
}
```
`bwrap` is Linux-only and requires bubblewrap. On macOS or Windows, keep `restrictToWorkspace` enabled and review shell access carefully.
`bwrap` is Linux-only and requires bubblewrap. On macOS, use `"sandbox": "seatbelt"`. Windows has no supported OS shell sandbox; disable shell execution if the application-level workspace guard is insufficient.
</details>
## Production notes
- Use environment variables for provider keys, bot tokens, and mailbox passwords.
- Keep one workspace per trust boundary.
- Prefer pairing for DM-capable chat apps, use narrow `allowFrom` lists only when static allowlists are intentional, and keep group policy mention-only at first.
- Bind WebUI, WebSocket, and API services to localhost unless remote access is intentional.
- Use [separate instances and workspaces](../multiple-instances.md) for data that must not share memory. Project selection inside one instance does not isolate memory. Use separate OS accounts or containers for mutually untrusted users.
- Prefer [pairing](../configuration.md#pairing) for DM-capable chat apps. Slack and Mattermost DMs default to open access: set `dm.policy` to `"allowlist"` to require approval. Configure group access separately; mention-only controls when the bot responds, not who is trusted.
- Bind WebUI, WebSocket, and API services to localhost unless remote access is intentional. Share [WebUI access](../webui.md#sharing-access) only with trusted administrators; it has no per-user roles or private topic ownership.
## Security notes
- `restrictToWorkspace` is an application-level guard, not an OS sandbox.
- `tools.exec.enable: false` removes shell execution entirely.
- HTTP web fetch and HTTP MCP use SSRF protections by default.
- HTTP web fetch and HTTP MCP use SSRF protections by default. Shell commands and stdio MCP processes are outside this guard. Neither shell sandbox blocks network access; use host or container egress controls for an offline deployment.
- Adding broad `tools.ssrfWhitelist` ranges increases exposure.
- `allowFrom: ["*"]` bypasses pairing and means anyone who can reach that channel can talk to the bot.
- On channels using the common sender allowlist, `allowFrom: ["*"]` bypasses pairing and allows every sender. Slack and Mattermost use the DM and group policies described above.
## Troubleshooting
+7 -19
View File
@@ -13,31 +13,19 @@ This guide sets up nanobot as a self-hosted AI agent runtime on your own machine
Use this path when you want local or server-side ownership of the agent process, workspace files, memory files, and provider keys. It is also the right path when the agent must keep running after one terminal command finishes.
## Install
## Choose your starting point
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
nanobot agent -m "Hello!"
```
**Already chatting in the WebUI:** you already have a self-hosted agent and a running gateway. Open **Channels** to connect a chat platform; use the same running gateway. If you want it to survive closing the launcher, follow [long-running gateway setup](./deploy-nanobot-gateway.md).
Complete the CLI check before deploying the gateway. A deployment problem is much easier to debug after the provider and model are known to work.
**New desktop installation:** follow the [quick start](../quick-start.md), configure a model in **Settings → Models**, and send `Hello!`. A normal browser reply confirms the setup; no additional CLI test or second gateway is required.
## Minimal working example
**New headless server:** follow the [Docker setup](../deployment.md#docker-compose), or install on the host using the [quick start's terminal setup](../quick-start.md). Verify the selected provider before installing a persistent service.
For chat apps, automations, and WebSocket delivery, start the gateway:
Self-hosting keeps the agent runtime and its state on your machine. A hosted model provider still receives prompts and any file content included in them. For local model inference, use the [Ollama setup](../provider-cookbook.md#recipe-ollama-local-model); local inference alone does not disable network-capable tools.
```bash
nanobot gateway
```
## Confirm the result
For the browser surface, use the WebUI launcher instead. It can start and manage the local gateway for you:
```bash
nanobot webui
```
Or connect a channel in `~/.nanobot/config.json`, then keep the same gateway process running for messages.
Send a message through the interface you intend to use. Check that it replies, then confirm the chosen gateway or service stays running after you close the setup terminal. Browser, chat channels, and automations use the gateway; the optional OpenAI-compatible API has its own [service setup](./openai-compatible-agent-api.md).
## Production notes
+28 -16
View File
@@ -11,23 +11,25 @@ This guide connects nanobot to Slack through Socket Mode. No public webhook URL
## Prerequisites
- A working nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- Permission to create a Slack app in a workspace.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the Slack channel
Create a Slack app with Socket Mode, a bot token, an app-level token with `connections:write`, and the required event subscriptions. In **Channels → Slack**, enter those tokens, enable the channel, and save. For pairing, expand **Advanced**, set the DM policy to **Allowlist**, and leave its allowlist empty; follow any restart prompt.
DM approval does not restrict group access. With the mention policy below, any member can invoke the bot in a channel it can see. For DM-only access, set the group policy to **Allowlist** and leave the group allowlist empty. To allow selected channels, add their IDs; all members of those channels can then use the bot under the configured mention/thread rules.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -56,21 +58,31 @@ Merge this snippet into `~/.nanobot/config.json`:
Slack DMs are open by default. Setting `dm.policy` to `"allowlist"` with no `dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the code before using the bot normally.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
DM the Slack bot directly. It should return a pairing code. Approve it from a trusted local surface:
DM the Slack bot directly. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
Then DM the bot again, or mention it in a channel:
```text
+28 -28
View File
@@ -11,36 +11,25 @@ This guide connects one Telegram bot to nanobot. Messages sent to that bot use y
## Prerequisites
- A working nanobot CLI reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A Telegram account.
- A bot token from `@BotFather`.
- A bot token: open Telegram, find `@BotFather`, send `/newbot`, follow its name/username prompts, and copy the returned token. Keep the token private.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Connect Telegram in the WebUI
Start the WebUI:
```bash
nanobot webui
```
Open **Settings → Channels → Telegram**:
Open **Channels → Telegram**:
1. If Telegram support is not installed, turn on its switch and confirm the installation.
2. Paste the token from BotFather.
3. If the gateway cannot reach Telegram directly, expand **Advanced** and enter an HTTP or SOCKS proxy such as `http://127.0.0.1:7890`.
4. Save and enable Telegram.
4. Save and enable Telegram. For a first private setup, leave the sender allowlist empty: new senders must pair before they can use the agent. Do not set it to `*`.
The configuration badge appears as soon as a bot token is saved. A connection check is separate: if Telegram is temporarily unreachable, the saved configuration remains valid and the bot can continue working in environments where the gateway has network access.
@@ -48,6 +37,9 @@ Saved tokens and proxy URLs are masked. A proxy entered here is used both for th
## Manual setup
<details>
<summary>Manual configuration</summary>
For a headless installation, install Telegram support:
```bash
@@ -74,14 +66,13 @@ Omitting `allowFrom` enables pairing-only mode. The first DM from a new user get
Telegram uses long polling by default. Webhook mode is available for public HTTPS deployments; start with long polling for the first test.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
Leave the gateway running while you test messages.
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
@@ -91,13 +82,22 @@ Open Telegram, DM the bot, and send:
Hello from Telegram
```
The bot should reply with a pairing code. Approve it from an already trusted surface, such as the local CLI:
The bot should reply with a pairing code. Return to the WebUI pairing prompt and enter the code from your own Telegram private chat. Do not approve codes from other people. An unapproved sender receives a code, not an agent reply.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Send the message again after approval. The reply should use the same model and workspace as your local CLI check.
Replace the example code with your actual code.
</details>
Send the message again after approval. Confirm that your private chat now receives a normal agent reply.
## Security notes
@@ -111,7 +111,7 @@ Send the message again after approval. The reply should use the same model and w
- If the channel is not listed, run `nanobot plugins enable telegram` again in the same Python environment.
- If the WebUI shows a saved configuration but the live check cannot reach Telegram, the token is still saved. Confirm the gateway can reach `api.telegram.org`, or open **Advanced → Network proxy** and enter a proxy.
- If Telegram rejects the token, copy the current token from BotFather or regenerate it.
- If messages do not arrive, run `nanobot gateway --verbose` and confirm the Telegram channel is enabled.
- If messages do not arrive, check the Telegram runtime status in **Channels** and the logs of the running gateway. Confirm it is enabled and can reach Telegram; do not start a second gateway to diagnose the first.
- If a first DM returns a pairing code, that is expected. Approve the code before testing normal agent replies.
- If Telegram Web shows unsupported rich messages, keep `richMessages` disabled.
+26 -16
View File
@@ -11,23 +11,23 @@ This guide connects nanobot to WeChat through the `weixin` channel. The channel
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A WeChat account that can complete QR-code login.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the WeChat channel
Open **Channels → WeChat (Weixin)**, install support if prompted, and follow the QR connection flow using your WeChat account. Enable the channel, save, and follow any restart prompt. New private senders receive a pairing code until approved.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -56,21 +56,31 @@ nanobot channels login weixin
Use `--force` if you need to discard saved login state and authenticate again.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
Send a private WeChat message to the bot. It should reply with a pairing code. Approve it from a trusted local surface:
Send a private WeChat message to the bot. It should reply with a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Replace the example code with your actual code.
</details>
Send the message again after approval and watch gateway logs for the sender ID and reply.
## Security notes
+27 -17
View File
@@ -11,24 +11,24 @@ This guide connects nanobot to WhatsApp through the `whatsapp` channel. The chan
## Prerequisites
- A working local nanobot reply:
```bash
nanobot agent -m "Hello!"
```
- A normal reply in your existing nanobot WebUI or CLI. If you have not reached that point, complete [Quick Start](../quick-start.md) first.
- A WhatsApp account that can link a new device.
- A machine that can keep `nanobot gateway` running.
## Install nanobot
## Continue from your running instance
```bash
python -m pip install nanobot-ai
nanobot onboard --wizard
```
If you are already chatting in the WebUI, keep it open and continue below. It has already started the gateway. To reopen it later, use the same installation's `nanobot webui` command; there is no need to install nanobot again.
For terminal or server setup, use the manual configuration section below. Reuse the config/home and executable from your working instance. Docker users should use the [container commands](../deployment.md#docker-compose).
## Enable the WhatsApp channel
Open **Channels → WhatsApp**, install support if prompted, and follow the QR connection flow. Scan the code from **WhatsApp → Settings → Linked Devices**. Enable the channel and save; choose mention-only group replies under **Advanced** for a first deployment. Follow any restart prompt.
<details>
<summary>Manual configuration</summary>
Install the optional channel dependency:
```bash
@@ -58,22 +58,32 @@ Merge this snippet into `~/.nanobot/config.json`:
Omitting `allowFrom` enables pairing-only mode for private chats. `groupPolicy` defaults to `"open"` in the channel, but `"mention"` is safer for a first deployment.
## Run nanobot gateway
</details>
```bash
nanobot channels status
nanobot gateway
```
## Apply the settings
In the WebUI, follow any restart prompt and keep the launcher running for the first test. You do not need to start another gateway. For unattended operation afterward, use [background or service mode](../cli-reference.md#gateway).
For manual config changes, restart the existing gateway through its owning terminal, `nanobot gateway restart` for background mode, or its service/container supervisor. If none is running, start `nanobot gateway` and leave it running. Run diagnostic CLI commands in a separate terminal using the same installation and config.
## Test a message
Send the bot a private WhatsApp message. It should return a pairing code. Approve it from a trusted local surface:
Send the bot a private WhatsApp message. It should return a pairing code. Return to the WebUI pairing prompt and enter the code from your own private chat. Only a matching pending code is approved; do not enter another person's code. Then send your message again.
<details>
<summary>Terminal-only pairing</summary>
In a separate local terminal, using the same instance:
```bash
nanobot agent -m "/pairing approve ABCD-EFGH"
```
Send the message again after approval. The reply should use the same model and workspace as your local CLI check.
Replace the example code with your actual code.
</details>
Send the message again after approval. Confirm that your private chat now receives a normal agent reply.
## Security notes