# DingTalk Source: https://docs.cowagent.ai/channels/dingtalk Integrate CowAgent into DingTalk application Integrate CowAgent into DingTalk by creating an intelligent robot app on the DingTalk Open Platform. ## 1. Create App 1. Go to [DingTalk Developer Console](https://open-dev.dingtalk.com/fe/app#/corp/app), log in and click **Create App**, fill in the app information: 2. Click **Add App Capability**, select **Robot** capability and click **Add**: 3. Configure the robot information and click **Publish**. After publishing, click "**Debug**" to automatically create a test group chat, which can be viewed in the client: 4. Click **Version Management & Release**, create a new version and publish: ## 2. Project Configuration 1. Click **Credentials & Basic Info**, get the `Client ID` and `Client Secret`: 2. Add the following configuration to `config.json` in the project root: ```json theme={null} { "channel_type": "dingtalk", "dingtalk_client_id": "YOUR_CLIENT_ID", "dingtalk_client_secret": "YOUR_CLIENT_SECRET" } ``` 3. Install the dependency: ```bash theme={null} pip3 install dingtalk_stream ``` 4. After starting the project, go to the DingTalk Developer Console, click **Event Subscription**, then click **Connection verified, verify channel**. When "**Connection successful**" is displayed, the configuration is complete: ## 3. Usage Chat privately with the robot or add it to an enterprise group to start a conversation: # Discord Source: https://docs.cowagent.ai/channels/discord Integrate CowAgent with a Discord Bot > Integrate CowAgent into Discord via a Discord Bot using the **Gateway** (persistent WebSocket). Supports direct messages (DM) and server channels (triggered by @mention or replying to the bot). The Gateway uses a persistent WebSocket connection — no public IP or callback URL required, works out of the box. ## 1. Setup ### Step 1: Create a Discord Application and Bot 1. Open the [Discord Developer Portal](https://discord.com/developers/applications), click **New Application**, enter a name (e.g. `CowAgent`), and create it. 2. Go to the **Bot** page in the left sidebar, click **Reset Token** to generate a Bot Token, then copy and store it safely (shown only once). This token is your bot's password — keep it secret. If it leaks, click **Reset Token** again on the Bot page to regenerate it. ### Step 2: Enable the Message Content Intent Reading message text in both DMs and channels depends on this privileged intent. 1. On the **Bot** page, find **Privileged Gateway Intents**. 2. Turn on **Message Content Intent** and save. Without this intent enabled, incoming message content will be empty and the bot will not respond. ### Step 3: Invite the Bot to a Server 1. Go to **OAuth2 → URL Generator** in the left sidebar. 2. Under **Scopes**, check `bot`. 3. Under **Bot Permissions**, check at least: `Send Messages`, `Read Message History`, `Attach Files`, `View Channels`. 4. Copy the generated authorization URL at the bottom, open it in a browser, and authorize it for your target server. You can skip this step if you only need DMs, but you still need a DM channel with the bot (e.g. the user messages the bot directly). ### Step 4: Connect to CowAgent Open the Web Console (default `http://127.0.0.1:9899`), go to **Channels**, click **Add Channel**, choose **Discord**, paste the Bot Token, and click connect. Add the following to `config.json` and start Cow: ```json theme={null} { "channel_type": "discord", "discord_token": "your-discord-bot-token", "discord_group_trigger": "mention_or_reply" } ``` | Key | Description | Default | | ----------------------- | -------------------------------------------------------------------------------------------------------- | ------------------ | | `discord_token` | Bot Token generated on the Bot page of the Developer Portal | - | | `discord_group_trigger` | Channel trigger: `mention_or_reply` (@ or reply to bot) / `mention_only` (@ only) / `all` (all messages) | `mention_or_reply` | The integration is ready when you see logs like: ``` [Discord] Bot logged in as CowAgent#1234 (id=123456789) [Discord] ✅ Discord bot ready, listening for messages ``` ## 2. Capabilities | Feature | Support | | ------------------------------------ | ------------------------------------------- | | Direct message (DM) | ✅ | | Server channel (@bot / reply to bot) | ✅ | | Text messages | ✅ send / receive | | Image messages | ✅ send / receive | | File messages | ✅ send / receive (PDF / Word / Excel, etc.) | A single Discord message is capped at 2000 characters; long replies are automatically split across multiple messages by line breaks. ## 3. Usage Once connected: * **Direct message (DM)**: find your bot in the server member list, click its avatar, and message it directly. * **Channel**: in a channel where the bot is invited, trigger it with `@your-bot hello` or by **replying to one of the bot's messages**. When sending an image or file, you can **add a text caption** (description / question) in the attachment input — the bot will answer based on both. Sending an attachment first and then a follow-up question also works; the two messages are merged automatically. # Feishu (Lark) Source: https://docs.cowagent.ai/channels/feishu Integrate CowAgent into Feishu via a custom enterprise app > Integrate CowAgent into Feishu via a custom enterprise app. Supports p2p chat and group chat (@bot), uses WebSocket long connection (no public IP needed), supports streaming typewriter replies and voice messages. You need to be a Feishu enterprise user with admin privileges. ## 1. Setup ### Option 1: One-click Scan to Create (Recommended) No need to manually create an app on the Feishu Developer Platform. Start the Cow project, open the web console (default `http://127.0.0.1:9899/`), go to **Channels**, click **Add Channel**, choose **Feishu**, then under the **Scan QR** tab click **One-click Create Feishu App** and scan with the **Feishu App** to complete app creation and connection automatically. 1. Requires `lark-oapi` ≥ 1.5.5. 2. The created app comes with all required permissions (messaging, card read/write, group events, etc.) and event subscriptions pre-configured — no manual setup on the developer console needed. Currently only the Feishu mainland version is supported (Lark international not yet supported). When starting from CLI without `feishu_app_id` configured, the QR code is also printed to the terminal. ### Option 2: Manual Setup Manually create a custom app on the Feishu Developer Platform, then connect via Web Console or config file. **Step 1: Create the App** 1. Go to [Feishu Developer Platform](https://open.feishu.cn/app/), click **Create Enterprise Custom App**: 2. In **Add App Capabilities**, add the **Bot** capability: 3. In **Permission Management**, paste the following permissions and **Batch Enable** all: ``` im:message,im:message.group_at_msg,im:message.group_at_msg:readonly,im:message.p2p_msg,im:message.p2p_msg:readonly,im:message:send_as_bot,im:resource,cardkit:card:write ``` 4. Get `App ID` and `App Secret` from **Credentials & Basic Info**: **Step 2: Connect to CowAgent** Open the web console, go to **Channels**, click **Add Channel**, choose **Feishu**, switch to the **Manual** tab, enter App ID and App Secret, then click connect. Add the following to `config.json` and start the program: ```json theme={null} { "channel_type": "feishu", "feishu_app_id": "YOUR_APP_ID", "feishu_app_secret": "YOUR_APP_SECRET", "feishu_stream_reply": true } ``` | Parameter | Description | Default | | ---------------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- | | `feishu_app_id` | Feishu app App ID | - | | `feishu_app_secret` | Feishu app App Secret | - | | `feishu_stream_reply` | Enable streaming typewriter reply | `true` | | `feishu_detailed_card` | Use a detailed card (tool calls, thinking process, elapsed time) for streaming replies; off keeps the plain typewriter card | `true` | **Step 3: Publish the App** 1. After Cow is running, go to **Events & Callbacks** in the Feishu Developer Platform, choose **Long Connection** mode and save: 2. Click **Add Event**, search for "Receive Message" and choose **Receive Message v2.0**. 3. (Optional) Under **Callbacks**, add **Card Action Trigger** (`card.action.trigger`) to enable `/tasks` scheduler commands; add the **Message Recalled** (`im.message.recalled_v1`) event to cancel a task by recalling its message. 4. Click **Version Management & Release**, create a version and apply for **Production Release**. Approve the request in the Feishu client: ## 2. Features | Feature | Status | | ------------------ | ----------------------------------------------------------------------------------------------------- | | P2P chat | ✅ | | Group chat (@bot) | ✅ | | Text messages | ✅ send/receive | | Image messages | ✅ send/receive | | Voice messages | ✅ send/receive | | Quoted replies | ✅ quoted text and rich-post context | | Streaming reply | ✅ (powered by Feishu cardkit streaming card) | | Markdown card | ✅ remote images are uploaded to Feishu for static and final streaming cards | | Detailed card | ✅ tool calls, thinking process and elapsed time (controlled by `feishu_detailed_card`, on by default) | | Scheduler controls | ✅ `/tasks` list with enable, disable and delete buttons | Streaming reply requires the `cardkit:card:write` permission (already enabled by one-click creation) and Feishu client version ≥ 7.20. Older clients see an upgrade prompt; if the permission or version is not satisfied, replies fall back to plain text automatically. ## 3. Usage After connection, search for the bot name in Feishu to start a chat. To use in groups, add the bot to a group and @-mention it. Send `/tasks` in a private chat, or @-mention the bot with `/tasks` in a group, to manage tasks belonging to that chat. # Channels Overview Source: https://docs.cowagent.ai/channels/index Channels supported by CowAgent and their capability matrix CowAgent supports multiple chat channels. Switch between them at startup via `channel_type`. The Web Console is enabled by default and can run in parallel with other channels. ## Capability Matrix The table below summarizes the inbound message types, bot reply types, and group chat capabilities supported by each channel, making it easy to choose by scenario. | Channel | Text | Image | File | Voice | Group Chat | | ---------------------------------------------- | :--: | :---: | :--: | :---: | :--------: | | [WeChat](/channels/weixin) | ✅ | ✅ | ✅ | ✅ | | | [Web Console](/channels/web) | ✅ | ✅ | ✅ | ✅ | | | [Feishu](/channels/feishu) | ✅ | ✅ | ✅ | ✅ | ✅ | | [DingTalk](/channels/dingtalk) | ✅ | ✅ | ✅ | ✅ | ✅ | | [WeCom Bot](/channels/wecom-bot) | ✅ | ✅ | ✅ | ✅ | ✅ | | [QQ](/channels/qq) | ✅ | ✅ | ✅ | | ✅ | | [WeCom App](/channels/wecom) | ✅ | ✅ | ✅ | ✅ | | | [Official Account](/channels/wechatmp) | ✅ | ✅ | | ✅ | | | [WeChat Customer Service](/channels/wechat-kf) | ✅ | ✅ | ✅ | ✅ | | | [Telegram](/channels/telegram) | ✅ | ✅ | ✅ | ✅ | ✅ | | [Slack](/channels/slack) | ✅ | ✅ | ✅ | | ✅ | | [Discord](/channels/discord) | ✅ | ✅ | ✅ | | ✅ | * The **Image / File / Voice** columns indicate that the channel can send and receive the corresponding message types; see each channel's docs for details * The **Group Chat** column indicates the ability to recognize and respond to group messages The voice / image capabilities of each channel depend on the configuration of the corresponding model provider. See [Models Overview](/models/index) for details. ## Channel List * [Web Console](/channels/web) — built-in browser-based chat and management panel, enabled by default * [WeChat](/channels/weixin) — log in via personal WeChat QR scan * [Feishu](/channels/feishu) — Feishu custom bot * [DingTalk](/channels/dingtalk) — DingTalk custom bot * [WeCom Bot](/channels/wecom-bot) — WeCom AI Bot via WebSocket long connection * [QQ](/channels/qq) — QQ Official Bot open platform * [WeCom App](/channels/wecom) — WeCom custom app integration * [Official Account](/channels/wechatmp) — WeChat Official Account (subscription / service) * [Telegram](/channels/telegram) — global IM, 5-minute setup, no public IP needed * [Slack](/channels/slack) — team collaboration IM, Socket Mode integration, no public IP needed * [Discord](/channels/discord) — community IM, Gateway connection, no public IP needed # QQ Bot Source: https://docs.cowagent.ai/channels/qq Connect CowAgent to QQ Bot (WebSocket long connection) > Connect CowAgent via QQ Open Platform's bot API, supporting QQ direct messages, group chats (@bot), guild channel messages, and guild DMs. No public IP required — uses WebSocket long connection. QQ Bot is created through the QQ Open Platform. It uses WebSocket long connection to receive messages and OpenAPI to send messages. No public IP or domain is required. ## 1. Create a QQ Bot > Visit the [QQ Open Platform](https://q.qq.com), sign in with QQ. If you haven't registered, please complete [account registration](https://q.qq.com/#/register) first. 1.Go to the [QQ Open Platform - Bot List](https://q.qq.com/#/apps), and click **Create Bot**: 2.Fill in the bot name, avatar, and other basic information to complete the creation: 3.Enter the bot configuration page, go to **Development Management**, and complete the following steps: * Copy and save the **AppID** (Bot ID) * Generate and save the **AppSecret** (Bot Secret) ## 2. Configuration and Running ### Option A: Web Console Start the program and open the Web console (local access: [http://127.0.0.1:9899/](http://127.0.0.1:9899/)). Go to the **Channels** tab, click **Connect Channel**, select **QQ Bot**, fill in the AppID and AppSecret from the previous step, and click Connect. ### Option B: Config File Add the following to your `config.json`: ```json theme={null} { "channel_type": "qq", "qq_app_id": "YOUR_APP_ID", "qq_app_secret": "YOUR_APP_SECRET" } ``` | Parameter | Description | | --------------- | ----------------------------------------------------------------------------- | | `qq_app_id` | AppID of the QQ Bot, found in Development Management on the open platform | | `qq_app_secret` | AppSecret of the QQ Bot, found in Development Management on the open platform | After configuration, start the program. The log message `[QQ] ✅ Connected successfully` indicates a successful connection. ## 3. Usage In the QQ Open Platform, go to **Management → Usage Scope & Members**, scan the "Add to group and message list" QR code with your QQ client to start chatting with the bot: Chat example: ## 4. Supported Features > Note: To use the QQ bot in group chats and guild channels, you need to complete the publishing review and configure usage scope permissions. | Feature | Status | | -------------------- | ------------------------------------ | | QQ Direct Messages | ✅ | | QQ Group Chat (@bot) | ✅ | | Guild Channel (@bot) | ✅ | | Guild DM | ✅ | | Text Messages | ✅ Send & Receive | | Image Messages | ✅ Send & Receive (group & direct) | | File Messages | ✅ Send (group & direct) | | Scheduled Tasks | ✅ Active push (4 per user per month) | ## 5. Notes * **Passive message limits**: QQ direct message replies are valid for 60 minutes (max 5 replies per message); group chat replies are valid for 5 minutes. * **Active message limits**: Both direct and group chats have a monthly limit of 4 active messages. Keep this in mind when using the scheduled tasks feature. * **Event permissions**: By default, `GROUP_AND_C2C_EVENT` (QQ group/direct) and `PUBLIC_GUILD_MESSAGES` (guild public messages) are subscribed. Apply for additional permissions on the open platform if needed. # Slack Source: https://docs.cowagent.ai/channels/slack Integrate CowAgent with a Slack App > Integrate CowAgent into Slack via a Slack App in **Socket Mode**. Supports direct messages (DM) and channels (triggered by @mention or replying within a thread). Socket Mode uses a persistent WebSocket connection — no public IP or callback URL required, works out of the box. ## 1. Setup ### Step 1: Create a Slack App 1. Open the [Slack API apps page](https://api.slack.com/apps), click **Create New App** → **From scratch**. 2. Enter an **App Name** (e.g. `CowAgent`), pick the **Workspace** to install into, and create it. ### Step 2: Enable Socket Mode and get the App Token 1. In the left sidebar go to **Settings → Socket Mode** and turn on **Enable Socket Mode**. 2. You will be prompted to generate an **App-Level Token** with the `connections:write` scope. Save this token starting with `xapp-`. Socket Mode receives events over a WebSocket connection, so you don't need to expose a public callback URL — ideal for local or intranet deployments. ### Step 3: Configure bot scopes and install 1. Go to **Features → OAuth & Permissions**, click **Add an OAuth Scope** under **Bot Token Scopes**, and add the following scopes one by one: ``` app_mentions:read channels:history chat:write commands files:read files:write groups:history im:history mpim:history users:read ``` `files:read` / `files:write` are used for sending/receiving images and files; omit them if you only need text conversations. 2. Go to **Features → Event Subscriptions**, turn on **Enable Events**, and under **Subscribe to bot events** click **Add Bot User Event** to add: ``` app_mention message.im message.channels ``` Add `message.groups` if you need to use the bot in private channels. 3. Go to **Features → App Home**, enable **Messages Tab** under **Show Tabs**, and check **Allow users to send Slash commands and messages from the messages tab**. Otherwise the DM input box is disabled and users cannot message the bot. 4. Back in **OAuth & Permissions**, click **Install to Workspace**. After installing, copy the **Bot User OAuth Token** starting with `xoxb-`. If the Slack client still shows "Sending messages to this app has been turned off", make sure you completed the App Home step above, then refresh or restart the Slack client (remove the app from your conversations and reopen it if needed). ### Step 4: Connect to CowAgent Open the Web Console (default `http://127.0.0.1:9899`), go to **Channels**, click **Add Channel**, choose **Slack**, paste the Bot Token (`xoxb-`) and App Token (`xapp-`), and click connect. Add the following to `config.json` and start Cow: ```json theme={null} { "channel_type": "slack", "slack_bot_token": "xoxb-xxxxxxxxxxxx", "slack_app_token": "xapp-xxxxxxxxxxxx", "slack_group_trigger": "mention_or_reply" } ``` | Key | Description | Default | | --------------------- | ----------------------------------------------------------------------------------------------------------- | ------------------ | | `slack_bot_token` | Bot User OAuth Token, like `xoxb-...` | - | | `slack_app_token` | App-Level Token (generated after enabling Socket Mode), like `xapp-...` | - | | `slack_group_trigger` | Channel trigger: `mention_or_reply` (@ or reply in thread) / `mention_only` (@ only) / `all` (all messages) | `mention_or_reply` | The integration is ready when you see logs like: ``` [Slack] Bot logged in as user_id=U0XXXXXXX, team=Txxxxxxxx [Slack] ✅ Slack bot ready, listening for events ``` ## 2. Capabilities | Feature | Support | | -------------------------------- | ------------------------------------------------------------ | | Direct message (DM) | ✅ | | Channel (@bot / reply in thread) | ✅ | | Text messages | ✅ send / receive | | Image messages | ✅ send / receive | | File messages | ✅ send / receive (PDF / Word / Excel, etc.) | | Thread replies | ✅ replies are posted to the thread of the triggering message | Slack organizes conversations into threads. The bot posts replies into the thread of the triggering message, keeping channels tidy. ## 3. Usage Once connected: * **Direct message (DM)**: find your App under **Apps** in the Slack sidebar and message it directly. * **Channel**: invite the App into a channel (`/invite @your-app`), then trigger it with `@your-app hello`; continue the conversation by replying within the same thread. When sending an image or file, you can **add a text caption** (description / question) in the attachment input — the bot will answer based on both. Sending an attachment first and then a follow-up question also works; the two messages are merged automatically. # Telegram Source: https://docs.cowagent.ai/channels/telegram Integrate CowAgent with Telegram via the Bot API > Integrate CowAgent into Telegram via the official Bot API. Supports private chat and group chat (triggered by @mention or replying to the bot). Uses Long Polling — no public IP required, works out of the box. ## 1. Setup ### Step 1: Create a Bot via BotFather 1. Open the official account [@BotFather](https://t.me/BotFather) in Telegram. 2. Send `/newbot` and follow the prompts: * **Bot name** (display name, e.g. `My CowAgent Bot`) * **Bot username** (must end with `bot`, e.g. `my_cowagent_bot`) 3. Once created, BotFather returns an **HTTP API Token** (e.g. `123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ`). Keep it safe. The token is the password of your bot — never share it. If it leaks, send `/revoke` to `@BotFather` to reset it. ### Step 2: (Group chat only) Disable Privacy Mode Skip this step if you only use private chat. Telegram bots run in **Privacy Mode** by default — in groups they can only see commands suffixed with `@bot` (e.g. `/start@your_bot`) and replies to bot messages; **plain `@bot hello` text messages are not delivered**, so the bot will appear unresponsive in groups. Send the following to `@BotFather`: 1. `/setprivacy` 2. Pick the bot you just created 3. Choose `Disable` If the bot is still silent in groups after this, try removing it from the group and adding it back. ### Step 3: Connect to CowAgent Open the Web Console (default `http://127.0.0.1:9899`), go to **Channels**, click **Add Channel**, choose **Telegram**, paste the Bot Token, and click connect. Add the following to `config.json` and start Cow: ```json theme={null} { "channel_type": "telegram", "telegram_token": "123456789:ABCdefGhIJKlmNoPQRsTUVwxyZ", "telegram_group_trigger": "mention_or_reply" } ``` | Key | Description | Default | | ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------ | | `telegram_token` | HTTP API Token returned by BotFather | - | | `telegram_group_trigger` | Group trigger: `mention_or_reply` (@ or reply) / `mention_only` (@ only) / `all` (all messages) | `mention_or_reply` | | `telegram_register_commands` | Whether to register the command menu with BotFather on startup | `true` | The integration is ready when you see logs like: ``` [Telegram] Bot logged in as @my_cowagent_bot (id=123456789) [Telegram] Registered 10 bot commands [Telegram] ✅ Telegram bot ready, polling for updates ``` ## 2. Capabilities | Feature | Support | | -------------------------------- | ------------------------------------------- | | Private chat | ✅ | | Group chat (@bot / reply to bot) | ✅ | | Text messages | ✅ send / receive | | Image messages | ✅ send / receive | | Voice messages | ✅ send / receive (OGG/Opus) | | Video messages | ✅ send / receive | | File messages | ✅ send / receive (PDF / Word / Excel, etc.) | | Command menu | ✅ aligned with Web Console slash commands | ### Command Menu On startup, the channel registers a command menu with BotFather. Typing `/` in Telegram shows a dropdown: | Command | Description | | ------------ | ------------------------------------------------------- | | `/help` | Show command help | | `/status` | View runtime status | | `/context` | View conversation context (`/context clear` to clear) | | `/skill` | Skill management (`/skill list`, `/skill install`, ...) | | `/memory` | Memory management (`/memory dream`) | | `/knowledge` | Knowledge base (`/knowledge list` / `on` / `off`) | | `/config` | View current config | | `/cancel` | Cancel the running Agent task | | `/steer` | Guide the running Agent task (`/steer `) | | `/logs` | View recent logs | | `/version` | Show version | Telegram's command menu only displays top-level commands; subcommands are entered with a space, e.g. `/skill list`, `/context clear`. ## 3. Usage Once connected: * **Private chat**: search for your bot username (e.g. `@my_cowagent_bot`) in Telegram, click `Start` and chat away. * **Group chat**: add the bot to a group, then trigger it with `@bot hello` or by **replying to one of the bot's messages**. If the bot doesn't respond in groups, double-check Privacy Mode in [Step 2](#step-2-group-chat-only-disable-privacy-mode). When sending an image or file, you can **add a caption** (description / question) directly in the attachment input — the bot will answer based on both. Sending an attachment first and then a follow-up question also works; the two messages are merged automatically. # Web Console Source: https://docs.cowagent.ai/channels/web Use CowAgent through the Web Console The Web Console is CowAgent's default channel. It runs automatically once started, letting you chat with the Agent in a browser and manage models, skills, memory, channels, and other configuration online. ## Configuration ```json theme={null} { "channel_type": "web", "web_host": "0.0.0.0", "web_port": 9899, "web_password": "", "external_api_token": "", "enable_thinking": false } ``` | Parameter | Description | Default | | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | | `channel_type` | Set to `web` | `web` | | `web_host` | Web service listen address. Defaults to `127.0.0.1` (local only); set to `0.0.0.0` for public access and configure a password | `""` | | `web_port` | Web service listen port | `9899` | | `web_password` | Access password. Leave empty to disable password protection; recommended when listening on `0.0.0.0` | `""` | | `external_api_token` | Independent Bearer token for the OpenAI-compatible API. Leave empty to disable the API | `""` | | `web_session_expire_days` | Login session validity in days | `30` | | `web_file_serve_root` | Root directory the web console can directly read/send files from. Defaults to the user home dir and agent workspace only; set to `/` to allow the whole filesystem | `"~"` | | `enable_thinking` | Whether to enable deep thinking mode | `false` | Once a password is configured, you must enter it to log in when accessing the console. The login session is kept for 30 days by default, so restarting the service during that period does not require re-login. The password can also be changed online from the "Configuration" page in the console. ## Access URL After starting the project, visit: * Local: `http://localhost:9899` * Server: `http://:9899` Ensure the server firewall and security group allow the corresponding port. ## OpenAI-Compatible API Set `external_api_token` to enable `POST /v1/chat/completions`. This token is independent from `web_password` and Web Console login sessions. The first release accepts text messages and uses CowAgent's configured Agent and model. The request `model` is required for OpenAI client compatibility and is echoed in the response; it does not select a CowAgent model. The latest non-empty user message is submitted to the Agent. Set `conversation_id`, or `user` as a fallback, to reuse a stable CowAgent session across requests. Requests without either field use an isolated session. Non-streaming request: ```bash theme={null} curl http://localhost:9899/v1/chat/completions \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "cowagent", "conversation_id": "example-conversation", "messages": [{"role": "user", "content": "Summarize this workspace."}] }' ``` The standard response is returned in `choices[0].message.content`. CowAgent adds `reasoning_content` and `tool_trace` to the message when those traces are available. Streaming request: ```bash theme={null} curl -N http://localhost:9899/v1/chat/completions \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "cowagent", "stream": true, "user": "example-user", "messages": [{"role": "user", "content": "Inspect the workspace."}] }' ``` Streaming content uses standard `chat.completion.chunk` objects and `choices[0].delta.content`. Reasoning uses the additive `choices[0].delta.reasoning_content` field. Reasoning and tool-process chunks also include a top-level `cow_event` object. The stream ends with `data: [DONE]`. OpenAI Python clients can use the endpoint by setting the base URL: ```python theme={null} from openai import OpenAI client = OpenAI( base_url="http://localhost:9899/v1", api_key="your-external-api-token", ) response = client.chat.completions.create( model="cowagent", messages=[{"role": "user", "content": "Hello from Python."}], extra_body={"conversation_id": "python-example"}, ) print(response.choices[0].message.content) ``` The API returns `400` for invalid requests, `401` for invalid credentials, and `503` when `external_api_token` is not configured. Non-streaming Agent failures return a structured JSON `500` response. For streaming requests, CowAgent waits up to 30 seconds for the Agent to produce the first event. An Agent failure before the first event returns a structured JSON `500` response because the SSE response has not started. If no first event arrives within 30 seconds, the API cancels only that request's in-flight Agent and returns the same JSON `500` shape with error code `timeout`. After the SSE response has started, its HTTP status can no longer change. A later Agent failure is therefore emitted as a `cow_event.type=error` chunk, followed by a terminal chunk with `finish_reason=error` and then `data: [DONE]`. ## Features ### Chat Interface Supports streaming output with real-time display of the Agent's reasoning process and tool calls, providing intuitive observation of the Agent's decision-making. Deep thinking can be toggled via configuration or the "Agent Configuration" switch in the console. #### Multi-Session Management The chat interface supports multi-session management. All session records are persistently stored in the database: * **Session List**: Click the history icon on the left to expand/collapse the session list panel, with scroll-to-load support for all historical sessions * **AI-Generated Titles**: After the first exchange in a new session, the model is automatically called to generate a short summary title * **New Session**: Click the "New Chat" button at the top of the session list or the `+` button in the input area to create a new session * **Delete Session**: Click the delete button on a session item and confirm to permanently delete the session and all its messages * **Clear Context**: Click the clear button in the input area to insert a divider in the current session. Messages above the divider are still displayed but no longer included as context for the model * **Workspace / Model / Permission**: Set a workspace, model, and permission mode for the current session below the input box. When you work across several projects, past sessions are grouped by project automatically. See [Architecture - Project Workspace](/intro/architecture#project-workspace) #### Permission Modes Each session can run under its own permission mode, controlling how far the Agent can reach into files and commands: read-only, workspace-write, or full-access. When a tool call is blocked, the hint is clickable so you can adjust the permission on the spot. ### Model Management Manage text, image, voice, and embedding model configurations for different providers online — no need to edit config files manually: ### Skill Management View and manage Agent skills (Skills) online: ### Memory Management View and manage Agent memory online: ### Channel Management Manage connected channels online with real-time connect/disconnect operations: ### Scheduled Tasks View and manage scheduled tasks online, including one-time tasks, fixed intervals, and Cron expressions: ### Logs View Agent runtime logs in real time for monitoring and troubleshooting: # WeChat Customer Service Source: https://docs.cowagent.ai/channels/wechat-kf Integrate CowAgent into WeChat Customer Service By binding a WeCom custom enterprise app to a WeChat Customer Service account, CowAgent can take over inbound inquiries from external WeChat users and serve them through links or QR codes embedded in WeChat Mini Programs, Official Accounts, Video Channels, and Video Channel stores. WeChat Customer Service only supports Docker deployment or server Python deployment. A publicly reachable callback URL is required; local run mode is not supported. ## 1. Prerequisites Required resources: 1. A server with a public IP 2. A registered and verified WeCom account 3. WeChat Customer Service capability enabled It is recommended to create a **dedicated** WeCom custom app for Customer Service rather than reusing the existing `wechatcom_app` one — otherwise the two channels will compete for the same callback URL. ## 2. Create a WeCom Custom App 1. In the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#apps), go to **Application Management → Create Application**: 2. Click **My Enterprise** and find the **Corp ID** at the bottom of the page (it goes into `wechat_kf_corp_id`): 3. Open the app you just created and click **"View"** next to Secret. The Secret will be pushed to the admin's phone via the WeCom app, where it can be viewed: 4. Open the app's **Receive Messages → Set API Reception** page, click **"Random Generate"** to generate the **Token** and **EncodingAESKey**, and save them: Saving the API reception configuration will fail at this point because the program has not started yet. Come back to save it after the project is running. ## 3. Configuration and Run Fill in the 4 fields collected from the previous step (Corp ID / Secret / Token / EncodingAESKey): Start the Cow project and open the Web Console. Go to the **Channels** menu, click **Connect**, choose **WeChat Customer Service**, fill in Corp ID / Secret / Token / AES Key (port defaults to 9888, configurable), and click Connect. Add the following configuration to `config.json` (each parameter maps to a field shown in the screenshots above): ```json theme={null} { "channel_type": "wechat_kf", "wechat_kf_corp_id": "YOUR_CORP_ID", "wechat_kf_secret": "YOUR_SECRET", "wechat_kf_token": "YOUR_TOKEN", "wechat_kf_aes_key": "YOUR_AES_KEY", "wechat_kf_port": 9888 } ``` | Parameter | Description | | ------------------- | -------------------------------------------------------- | | `wechat_kf_corp_id` | Corp ID | | `wechat_kf_secret` | Secret of the WeCom custom app bound to Customer Service | | `wechat_kf_token` | Token from the API reception config | | `wechat_kf_aes_key` | EncodingAESKey from the API reception config | | `wechat_kf_port` | Listening port, default 9888 | After connecting, start the program (the Web Console method restarts the channel automatically). When the log shows `Listening on http://0.0.0.0:9888/wxkf/`, the program is running successfully. You need to open this port externally (e.g., allow it in the cloud server security group). Then go back to **Receive Messages → Set API Reception** in the WeCom console and set the callback URL to `http://:9888/wxkf/`, then click Save. After saving successfully, you also need to add the server IP to **Enterprise Trusted IPs**, otherwise messages cannot be sent or received: If URL verification fails or the configuration is unsuccessful: 1. Ensure the server firewall is disabled and the security group allows the listening port (default 9888) 2. Carefully check that Token, Secret, EncodingAESKey and other parameters are consistent, and the URL format is correct 3. Verified WeCom accounts must use a filed domain matching the entity ## 4. Bind a WeChat Customer Service Account In the WeCom Admin Console, go to **WeChat Customer Service**, create a customer service account, and bind it to the custom app you created above: After binding, go to **WeChat Customer Service → Account Details**, and under **"Access Link"**: * Click **"Copy Link"** to get an access link like `https://work.weixin.qq.com/kfid/kfcd83e5896b9ba07be` * Click **"Generate QR Code"** to get the corresponding QR code Distribute the link or QR code to your WeChat customers: ## 5. Usage After WeChat users enter the customer service conversation via the link or QR code, they can chat with the AI across multiple turns, with support for text, image, and voice messages: Beyond that, leveraging the official WeChat ecosystem, WeChat Customer Service can also be embedded into Official Accounts, Mini Programs, Video Channels and more. See the **WeChat Customer Service → Access Scenarios** section in the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#/app/servicer) for details: ## FAQ Make sure the following dependencies are installed: ```bash theme={null} pip install websocket-client pycryptodome ``` # WeChat Official Account Source: https://docs.cowagent.ai/channels/wechatmp Integrate CowAgent with WeChat Official Accounts CowAgent supports both personal subscription accounts and enterprise service accounts. | Type | Requirements | Features | | ------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------- | | **Personal Subscription** | Available to individuals | Sends a placeholder reply first; users must send a message to retrieve the full response | | **Enterprise Service** | Enterprise with verified customer service API | Can proactively push replies to users | Official Accounts only support server and Docker deployment, not local run mode. Install extended dependencies: `pip3 install -r requirements-optional.txt` ## 1. Personal Subscription Account Add the following configuration to `config.json`: ```json theme={null} { "channel_type": "wechatmp", "single_chat_prefix": [""], "wechatmp_app_id": "wx73f9******d1e48", "wechatmp_app_secret": "YOUR_APP_SECRET", "wechatmp_aes_key": "", "wechatmp_token": "YOUR_TOKEN", "wechatmp_port": 80 } ``` ### Setup Steps These configurations must be consistent with the [WeChat Official Account Platform](https://mp.weixin.qq.com/advanced/advanced?action=dev\&t=advanced/dev). Navigate to **Settings & Development → Basic Configuration → Server Configuration** and configure as shown below: 1. Enable the developer secret on the platform (corresponds to `wechatmp_app_secret`), and add the server IP to the whitelist 2. Fill in the `config.json` with the official account parameters matching the platform configuration 3. Start the program, which listens on port 80 (use `sudo` if you don't have permission; stop any process occupying port 80) 4. **Enable server configuration** on the official account platform and submit. A successful save means the configuration is complete. Note that the **"Server URL"** must be in the format `http://{HOST}/wx`, where `{HOST}` can be the server IP or domain After following the account and sending a message, you should see the following result: Due to subscription account limitations, short replies (within 15s) can be returned immediately, but longer replies will first send a "Thinking..." placeholder, requiring users to send any text to retrieve the answer. Enterprise service accounts can solve this with the customer service API. **Voice Recognition**: You can use WeChat's built-in voice recognition. Enable "Receive Voice Recognition Results" under "Settings & Development → API Permissions" on the official account management page. ## 2. Enterprise Service Account The setup process for enterprise service accounts is essentially the same as personal subscription accounts, with the following differences: 1. Register an enterprise service account on the platform and complete WeChat certification. Confirm that the **Customer Service API** permission has been granted 2. Set `"channel_type": "wechatmp_service"` in `config.json`; other configurations remain the same 3. Even for longer replies, they can be proactively pushed to users without requiring manual retrieval ```json theme={null} { "channel_type": "wechatmp_service", "single_chat_prefix": [""], "wechatmp_app_id": "YOUR_APP_ID", "wechatmp_app_secret": "YOUR_APP_SECRET", "wechatmp_aes_key": "", "wechatmp_token": "YOUR_TOKEN", "wechatmp_port": 80 } ``` # WeCom Source: https://docs.cowagent.ai/channels/wecom Integrate CowAgent into WeCom enterprise app Integrate CowAgent into WeCom through a custom enterprise app, supporting one-on-one chat for internal employees. WeCom only supports Docker deployment or server Python deployment. Local run mode is not supported. ## 1. Prerequisites Required resources: 1. A server with public IP (overseas server, or domestic server with a proxy for international API access) 2. A registered WeCom account (individual registration is possible but cannot be certified) 3. Certified WeCom accounts additionally require a domain filed under the corresponding entity ## 2. Create WeCom App 1. In the [WeCom Admin Console](https://work.weixin.qq.com/wework_admin/frame#profile), click **My Enterprise** and find the **Corp ID** at the bottom of the page. Save this ID for the `wechatcom_corp_id` configuration field. 2. Switch to **Application Management** and click Create Application: 3. On the application creation page, record the `AgentId` and `Secret`: 4. Click **Set API Reception** to configure the application interface: * URL format: `http://ip:port/wxcomapp` (certified enterprises must use a filed domain) * Generate random `Token` and `EncodingAESKey` and save them for the configuration file The API reception configuration cannot be saved at this point because the program hasn't started yet. Come back to save it after the project is running. ## 3. Configuration and Run Add the following configuration to `config.json` (the mapping between each parameter and the WeCom console is shown in the screenshots above): ```json theme={null} { "channel_type": "wechatcom_app", "single_chat_prefix": [""], "wechatcom_corp_id": "YOUR_CORP_ID", "wechatcomapp_token": "YOUR_TOKEN", "wechatcomapp_secret": "YOUR_SECRET", "wechatcomapp_agent_id": "YOUR_AGENT_ID", "wechatcomapp_aes_key": "YOUR_AES_KEY", "wechatcomapp_port": 9898 } ``` | Parameter | Description | | ----------------------- | ---------------------------------------- | | `wechatcom_corp_id` | Corp ID | | `wechatcomapp_token` | Token from API reception config | | `wechatcomapp_secret` | App Secret | | `wechatcomapp_agent_id` | App AgentId | | `wechatcomapp_aes_key` | EncodingAESKey from API reception config | | `wechatcomapp_port` | Listen port, default 9898 | After configuration, start the program. When the log shows `http://0.0.0.0:9898/`, the program is running successfully. You need to open this port externally (e.g., allow it in the cloud server security group). After the program starts, return to the WeCom Admin Console to save the **Message Server Configuration**. After saving successfully, you also need to add the server IP to **Enterprise Trusted IPs**, otherwise messages cannot be sent or received: If the URL configuration callback fails or the configuration is unsuccessful: 1. Ensure the server firewall is disabled and the security group allows the listening port 2. Carefully check that Token, Secret Key and other parameter configurations are consistent, and that the URL format is correct 3. Certified WeCom accounts must configure a filed domain matching the entity ## 4. Usage Search for the app name you just created in WeCom to start chatting directly. You can run multiple instances listening on different ports to create multiple WeCom apps: To allow external personal WeChat users to use the app, go to **My Enterprise → WeChat Plugin**, share the invite QR code. After scanning and following, personal WeChat users can join and chat with the app: ## FAQ Make sure the following dependencies are installed: ```bash theme={null} pip install websocket-client pycryptodome ``` # WeCom Bot Source: https://docs.cowagent.ai/channels/wecom-bot Connect CowAgent to WeCom AI Bot (WebSocket long connection) > Connect CowAgent via WeCom AI Bot, supporting both internal direct messages and group chats. No public IP required — uses a WebSocket long connection, with Markdown rendering and streaming output. WeCom Bot and WeCom App are two different integration methods. WeCom Bot uses a WebSocket long connection and requires no public IP or domain, making setup much simpler. ## 1. Connection methods ### Option A: One-click QR scan (recommended) No need to create the bot ahead of time. Start CowAgent and open the Web console (local URL: [http://127.0.0.1:9899/](http://127.0.0.1:9899/)), go to the **Channels** tab, click **Connect Channel**, choose **WeCom Bot**, switch to **QR scan** mode, and scan the QR code with **WeCom** — bot creation and connection complete automatically. After a successful scan, you can further configure the bot (name, avatar, visibility scope, etc.) in **WeCom Workbench → AI Bot**. ### Option B: Manual creation Create the AI Bot in WeCom and obtain the Bot ID and Secret, then connect via the Web console or config file. **Step 1: Create the AI Bot** 1. Open the WeCom client, go to **Workbench**, and click **AI Bot**: 2. Click **Create Bot → Manual Creation**: 3. Scroll to the bottom of the right panel and select **API Mode**: 4. Set the bot name, avatar, and visibility scope. Choose **Long Connection** mode, save the **Bot ID** and **Secret**, then click Save. **Step 2: Connect to CowAgent** Open the Web console, go to the **Channels** tab, click **Connect Channel**, choose **WeCom Bot**, switch to **Manual** mode, enter the Bot ID and Secret, and click Connect. Add the following to `config.json`, then start CowAgent: ```json theme={null} { "channel_type": "wecom_bot", "wecom_bot_id": "YOUR_BOT_ID", "wecom_bot_secret": "YOUR_SECRET" } ``` | Parameter | Description | | ------------------ | -------------------- | | `wecom_bot_id` | Bot ID of the AI Bot | | `wecom_bot_secret` | Secret of the AI Bot | The log line `[WecomBot] Subscribe success` confirms the connection is established. A **webhook (HTTP callback) mode** is also supported: when creating the bot, choose **Use URL callback**, set the receive-message URL to `http(s)://:9892/wecombot`, and copy the Token and EncodingAESKey from that page. This mode needs a publicly reachable address and does not support file sending or scheduled push, so the long connection is generally recommended. The corresponding `config.json`: ```json theme={null} { "channel_type": "wecom_bot", "wecom_bot_mode": "webhook", "wecom_bot_token": "YOUR_TOKEN", "wecom_bot_encoding_aes_key": "YOUR_ENCODING_AES_KEY", "wecom_bot_port": 9892 } ``` ## 2. Supported features | Feature | Status | | ----------------------- | ---------------- | | Direct chat | ✅ | | Group chat (@bot) | ✅ | | Text messages | ✅ Send / Receive | | Image messages | ✅ Send / Receive | | File messages | ✅ Send / Receive | | Streaming replies | ✅ | | Scheduled push messages | ✅ | ## 3. Usage Search for the bot's name inside WeCom to start a direct chat. To use the bot in an internal group chat, add it to the group and @-mention it. # WeChat Source: https://docs.cowagent.ai/channels/weixin Connect CowAgent to personal WeChat (via the official API) > Connect CowAgent to your personal WeChat — scan to log in, no public IP required. Supports text, image, voice, file, and video messages in 1-on-1 chats. Backed by WeChat's official API; safe to use. After connecting, a bot assistant is added to your conversation list without affecting normal account usage. ## 1. Setup and run ### Option A: Web console Start CowAgent and open the Web console (local URL: [http://127.0.0.1:9899/](http://127.0.0.1:9899/)). Go to the **Channels** tab, click **Connect Channel**, select **WeChat**, and follow the prompts to scan in. ### Option B: Config file Set `channel_type` to `weixin` in `config.json`: ```json theme={null} { "channel_type": "weixin" } ``` After starting CowAgent, a QR code is displayed in the terminal. Scan it with WeChat to complete login. 1. For backward compatibility, setting `channel_type` to `wx` also activates the WeChat channel. 2. The WeChat client must be on version **8.0.69** or higher. ## 2. Usage Once authorized, the integration completes and you can start chatting. A bot assistant is created in your WeChat conversation list, leaving normal account usage unaffected. > You can find the bot at any time by searching for **"微信ClawBot"**. You may also rename it, change its avatar, pin it to the top of your conversation list, and so on. ## 3. Login ### QR code login On first startup, a QR code appears in the terminal (valid for around 2 minutes). Scan it with WeChat and confirm on your phone to log in. * The QR code refreshes automatically when it expires * The `qrcode` dependency is already included in `requirements.txt`, so the QR code renders directly in the terminal after install ### Credential persistence After a successful login, credentials are saved to `~/.weixin_cow_credentials.json`. Subsequent startups reuse the saved credentials with no need to re-scan. To force a re-login, delete the credentials file and restart. ### Session expiry When the WeChat session expires (errcode `-14`), CowAgent automatically clears old credentials and initiates a new QR login — no manual intervention required. ## 4. Supported features | Feature | Status | | --------------- | --------------------------------------- | | Direct messages | ✅ | | Text messages | ✅ Send & Receive | | Image messages | ✅ Send & Receive | | File messages | ✅ Send & Receive | | Video messages | ✅ Send & Receive | | Voice messages | ✅ Receive (built-in speech recognition) | # Backup and Restore Source: https://docs.cowagent.ai/cli/backup Export and restore CowAgent configuration and agent workspace data CowAgent can create a portable local archive for migration or disaster recovery. ## Create a backup ```bash theme={null} cow backup cow backup --output /safe/location/cow-backup.zip ``` The archive contains: * `config.json` * Agent persona and user files such as `AGENT.md`, `USER.md`, and `MEMORY.md` * Daily memory, session history, knowledge, custom skills, and scheduled tasks in the configured workspace * The Agent registry, channel bindings, and every configured Agent workspace when multi-Agent mode is configured * Legacy `user_datas.pkl`, when present Transient `tmp/` data, caches, Git metadata, and symbolic links are skipped. The archive is written with owner-only permissions where the operating system supports them. A backup may contain API keys, conversation history, and other personal data. Store and transfer it as a secret. The ZIP file is not encrypted. ## Restore a backup Stop CowAgent before restoring: ```bash theme={null} cow stop cow restore /safe/location/cow-backup.zip ``` Use `--workspace` to migrate workspace files to a different location: ```bash theme={null} cow restore cow-backup.zip --workspace ~/cow-restored ``` For a multi-Agent archive, `--workspace` is the instance root. CowAgent restores the default Agent into that root and every other Agent into `/agents/`, the same layout the Agent registry derives on its own. Without the option, Agent IDs that already exist locally keep their current workspace, and the rest are placed under the instance root this machine already uses. Restore validates the archive format and paths before writing anything. It overwrites matching files but does not delete unrelated files already present at the destination. When current CowAgent data exists, the command first creates a `cow-pre-restore-*.zip` rollback archive beside the selected backup. For unattended scripts, pass `--yes` to acknowledge overwrites. # General Commands Source: https://docs.cowagent.ai/cli/general View status, manage config, and control context with commonly used commands The following commands can be used in chat with the `/` prefix or in the terminal with the `cow` prefix (some are chat-only). In the Web console, typing `/` brings up an autocomplete menu with keyboard navigation and Tab completion. ## help Show help information for all available commands. ```text theme={null} /help ``` ## status View current session and service status, including process info, model configuration, message count, and loaded skills. ```text theme={null} /status ``` ## cancel Abort the agent task currently running in this session. When the agent is busy with a long task (e.g. multi-turn tool calls or a long streaming response), send `/cancel` and the agent will stop before the next tool execution. Available across all channels — Web, WeChat, WeCom, Feishu, etc. ```text theme={null} /cancel ``` ## steer Redirect the Agent task currently running in this session without cancelling it. The instruction is injected at the next safe checkpoint; a tool that is already running may finish, while tools that have not started are skipped. If no task is active, `/steer` does not start or queue a new one. Available across all chat channels. ```text theme={null} /steer focus on the failing tests first ``` In the Web console, enter an instruction while a reply is running and click **Steer active task**. Sending an ordinary message still uses the session queue. ## config View or modify runtime configuration. Changes take effect immediately without restarting. **View all configurable items:** ```text theme={null} /config ``` **View a single item:** ```text theme={null} /config model ``` **Modify a config item:** ```text theme={null} /config model deepseek-v4-flash ``` **Configurable items:** | Item | Description | Example | | -------------------------- | --------------------------- | ------------------- | | `model` | AI model name | `deepseek-v4-flash` | | `agent_max_context_tokens` | Max context tokens | `40000` | | `agent_max_context_turns` | Max context memory turns | `30` | | `agent_max_steps` | Max decision steps per task | `15` | | `enable_thinking` | Enable deep thinking mode | `true` / `false` | When changing `model`, the system automatically matches the corresponding model API. Configuration is persisted to `config.json`. ## context View current session context statistics, including message count and content length. ```text theme={null} /context ``` **Clear current session context:** ```text theme={null} /clear ``` Clearing context makes the Agent "forget" previous conversation, useful for switching topics or freeing context space. `/context clear` still works as an alias. ## compact Summarize older turns to free up context while keeping recent turns intact. Unlike automatic trimming, this runs immediately regardless of current token usage. ```text theme={null} /compact ``` Use `/compact` before a long task to reclaim context space without fully clearing the conversation. Recent turns and an LLM summary of older turns are retained. ## logs View recent service logs. Shows the last 20 lines by default, up to 50. ```text theme={null} /logs ``` **Specify line count:** ```text theme={null} /logs 50 ``` ## version Show the current CowAgent version. ```text theme={null} /version ``` # Commands Overview Source: https://docs.cowagent.ai/cli/index CowAgent command system — Terminal CLI and chat commands CowAgent provides two ways to interact via commands: * **Terminal CLI** — Run `cow ` in your system terminal for service management, skill management, and other operations * **Chat Commands** — Type `/` or `cow ` in any conversation to check status, manage skills, adjust configuration, etc. ## Cow CLI After deploying with the one-click install script, the `cow` command is automatically available. For manual installations, run: ```bash theme={null} pip install -e . ``` Then use the `cow` command from anywhere: ```bash theme={null} cow help ``` Example output: ``` 🐮 CowAgent CLI Usage: cow Service: start Start the CowAgent service stop Stop the CowAgent service restart Restart the CowAgent service update Update code and restart service status Show service status logs View service logs Skills: skill Manage skills (list / search / install / uninstall ...) Memory & Knowledge: memory Memory distillation (dream) knowledge View knowledge base stats and structure Data portability: backup Back up config and agent workspace restore Restore a CowAgent backup Others: help Show this help message version Show version ``` ## Chat Commands In the Web console or any connected channel, type `/` to see command suggestions. Supported commands: | Command | Description | | ---------------------- | ------------------------------------------------------------------ | | `/help` | Show command help | | `/status` | View service status and configuration | | `/cancel` | Abort the currently running agent task | | `/steer ` | Guide the currently running agent task without queueing a new turn | | `/config` | View or modify runtime configuration | | `/skill` | Manage skills (install, uninstall, enable, disable, etc.) | | `/memory dream [N]` | Manually trigger memory distillation (default 3 days, max 30) | | `/knowledge` | View knowledge base statistics | | `/knowledge list` | View knowledge base directory structure | | `/knowledge on\|off` | Enable or disable knowledge base | | `/context` | View current session context info | | `/context clear` | Clear current session context | | `/logs` | View recent logs | | `/version` | Show version number | Service management commands like `/start`, `/stop`, `/restart` will prompt you to use them in the terminal instead, as they involve process operations. ## Command Availability | Command | Terminal (`cow`) | Chat (`/`) | | ----------------------- | :--------------: | :--------: | | help | ✓ | ✓ | | version | ✓ | ✓ | | status | ✓ | ✓ | | logs | ✓ | ✓ | | cancel | ✗ | ✓ | | config | ✗ | ✓ | | context | — | ✓ | | memory (subcommands) | ✗ | ✓ | | knowledge (subcommands) | ✓ | ✓ | | skill (subcommands) | ✓ | ✓ | | start / stop / restart | ✓ | ✗ | | update | ✓ | ✗ | | install-browser | ✓ | ✗ | | backup / restore | ✓ | ✗ | `context` only shows a hint in the terminal to use it in chat. `config` is only available in chat. # Memory & Knowledge Source: https://docs.cowagent.ai/cli/memory-knowledge Memory distillation and knowledge base management commands ## memory Manage the Agent's long-term memory system. ### memory dream Manually trigger memory distillation (Deep Dream) — consolidate recent daily memories into MEMORY.md and generate a dream diary. ```text theme={null} /memory dream [N] ``` * `N`: Consolidate the last N days of memory (default 3, max 30) * Runs asynchronously in the background; you'll be notified in chat when complete * Works without Agent initialization — can be used before the first conversation **Examples:** ```text theme={null} /memory dream # Consolidate last 3 days /memory dream 7 # Consolidate last 7 days /memory dream 30 # Consolidate last 30 days (full) ``` On the Web console, the completion notification includes clickable links to view the updated MEMORY.md and dream diary. The system automatically runs distillation daily at 23:55 (lookback 1 day). Manual trigger is useful for consolidating historical memories after first deployment, or when you need an immediate memory update. ## knowledge View and manage the personal knowledge base. Shows statistics by default. ```text theme={null} /knowledge ``` ### knowledge list View the knowledge base directory tree. ```text theme={null} /knowledge list ``` ### knowledge on / off Enable or disable the knowledge base. When disabled, knowledge prompts and file indexing are not injected. ```text theme={null} /knowledge on /knowledge off ``` In the terminal CLI, `cow knowledge` and `cow knowledge list` are available, but `on|off` is only supported in chat (requires runtime effect). # Process Management Source: https://docs.cowagent.ai/cli/process Manage CowAgent process lifecycle with cow commands Process management commands control the CowAgent background process. These commands are only available in the terminal. ## start Start the CowAgent service. Runs as a background daemon by default and automatically tails logs. ```bash theme={null} cow start ``` **Options:** | Option | Description | | -------------------- | --------------------------------------------- | | `-f`, `--foreground` | Run in foreground, not as a background daemon | | `--no-logs` | Don't tail logs after starting | ## stop Stop the running CowAgent service. ```bash theme={null} cow stop ``` ## restart Restart the CowAgent service (stop then start). ```bash theme={null} cow restart ``` **Options:** | Option | Description | | ----------- | ----------------------------- | | `--no-logs` | Don't tail logs after restart | ## update Update code and restart the service. Automatically performs: 1. Pull latest code (`git pull`) 2. Stop current service 3. Update Python dependencies 4. Reinstall CLI 5. Start service ```bash theme={null} cow update ``` If `git pull` fails (e.g., uncommitted local changes), the update aborts and the service remains unaffected. ## status Check CowAgent service status, including process info, version, and current model/channel configuration. ```bash theme={null} cow status ``` ## logs View service logs. ```bash theme={null} cow logs ``` **Options:** | Option | Description | Default | | ---------------- | ---------------------------- | ------- | | `-f`, `--follow` | Continuously tail log output | No | | `-n`, `--lines` | Show last N lines | 50 | Examples: ```bash theme={null} # View last 100 lines cow logs -n 100 # Continuously tail logs cow logs -f ``` ## install-browser Install Playwright and Chromium browser for the [browser tool](/tools/browser). ```bash theme={null} cow install-browser ``` Only needed when using browser tools (web browsing, screenshots, etc.). ## run.sh Compatibility If Cow CLI is not installed, you can use `run.sh` to manage the service: | cow command | run.sh equivalent | | ------------- | ------------------ | | `cow start` | `./run.sh start` | | `cow stop` | `./run.sh stop` | | `cow restart` | `./run.sh restart` | | `cow update` | `./run.sh update` | | `cow status` | `./run.sh status` | | `cow logs` | `./run.sh logs` | The `cow` command is recommended — it provides cleaner syntax and richer features. It is automatically installed via the one-click install script. # Skill Management Source: https://docs.cowagent.ai/cli/skill Install, uninstall, enable, disable, and manage skills via commands Skill management commands are used to install, query, and manage CowAgent skills. Use `/skill ` in chat or `cow skill ` in the terminal. ## list List installed skills and their status. ```text Chat theme={null} /skill list ``` ```bash Terminal theme={null} cow skill list ``` Example output: ``` 📦 Installed skills (3/4) ✅ pptx Use this skill any time a .pptx file is involved… Source: cowhub ✅ skill-creator Create, install, or update skills… Source: builtin ⏸️ image-vision (disabled) Image understanding and visual analysis Source: builtin ``` **Browse the Skill Hub** (view all available skills): ```text Chat theme={null} /skill list --remote ``` ```bash Terminal theme={null} cow skill list --remote ``` **Options:** | Option | Description | Default | | ---------------- | ---------------------------------- | ------- | | `--remote`, `-r` | Browse Skill Hub remote skill list | No | | `--page` | Page number for remote listing | 1 | ## search Search for skills on the Skill Hub. ```text Chat theme={null} /skill search pptx ``` ```bash Terminal theme={null} cow skill search pptx ``` ## install Install skills with a single `install` command from Cow Skill Hub, GitHub, ClawHub, or any URL (zip archives, SKILL.md links) — no manual download or configuration required. **From Skill Hub (recommended):** ```text Chat theme={null} /skill install pptx ``` ```bash Terminal theme={null} cow skill install pptx ``` **From GitHub:** ```text Chat theme={null} # Install all skills in a repo (auto-discovers subdirectories with SKILL.md) /skill install larksuite/cli # Specify a subdirectory to install a single skill /skill install https://github.com/larksuite/cli/tree/main/skills/lark-im # Use # to specify a subdirectory /skill install larksuite/cli#skills/lark-minutes ``` ```bash Terminal theme={null} # Install all skills in a repo (auto-discovers subdirectories with SKILL.md) cow skill install larksuite/cli # Specify a subdirectory to install a single skill cow skill install https://github.com/larksuite/cli/tree/main/skills/lark-im # Use # to specify a subdirectory cow skill install larksuite/cli#skills/lark-minutes ``` Supports full GitHub URLs and `owner/repo` shorthand. For mono-repos (multiple skills in one repository), omitting the subdirectory auto-discovers and batch-installs all skills; specifying a subdirectory installs only that skill. **From ClawHub:** ```text Chat theme={null} /skill install clawhub:baidu-search ``` ```bash Terminal theme={null} cow skill install clawhub:baidu-search ``` **From URL:** ```text Chat theme={null} # Install from a zip archive (single or batch) /skill install https://cdn.link-ai.tech/skills/pptx.zip # Install from a SKILL.md link /skill install https://example.com/path/to/SKILL.md ``` ```bash Terminal theme={null} # Install from a zip archive (single or batch) cow skill install https://cdn.link-ai.tech/skills/pptx.zip # Install from a SKILL.md link cow skill install https://example.com/path/to/SKILL.md ``` Supports installing from zip / tar.gz archive URLs — automatically extracts and discovers directories containing `SKILL.md`, with support for single or batch install. Also supports installing directly from a `SKILL.md` file URL, automatically parsing the skill name and description. ## uninstall Uninstall an installed skill. ```text Chat theme={null} /skill uninstall pptx ``` ```bash Terminal theme={null} cow skill uninstall pptx ``` Uninstalling deletes all files in the skill directory. This action cannot be undone. ## enable / disable Enable or disable a skill. Disabled skills will not be invoked by the Agent. ```text Chat theme={null} /skill enable pptx /skill disable pptx ``` ```bash Terminal theme={null} cow skill enable pptx cow skill disable pptx ``` ## info View details of an installed skill, including a preview of its `SKILL.md`. ```text Chat theme={null} /skill info pptx ``` ```bash Terminal theme={null} cow skill info pptx ``` ## Skill Sources Installed skills track their origin, viewable via `/skill list`: | Source | Description | | --------- | ------------------------------------ | | `builtin` | Built-in project skills | | `cowhub` | Installed from CowAgent Skill Hub | | `github` | Installed directly from a GitHub URL | | `clawhub` | Installed from ClawHub | | `url` | Installed from a SKILL.md URL | | `local` | Locally created skills | # Desktop Client Source: https://docs.cowagent.ai/guide/desktop Download and use the CowAgent desktop client (macOS / Windows) CowAgent ships a ready-to-use desktop client with the Agent runtime bundled in — **no need to install Python or dependencies manually**. Just download, install, and run your local super AI assistant.