-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
zh use cli
github-actions[bot] edited this page Jun 16, 2026
·
1 revision
AstrBot CLI 用于初始化实例、启动 AstrBot、修改常用配置和管理插件。
如果你使用 uv 安装:
uv tool install astrbot --python 3.12uv 会生成 astrbot 可执行文件,并把它放到 PATH 中。可以用下面的命令确认路径:
::: code-group
which astrbotwhere.exe astrbot:::
Tip
下面的命令都需要在 AstrBot 工作目录中执行。
第一次部署时先初始化目录,再启动 AstrBot:
astrbot init
astrbot runastrbot init 会在当前目录创建 AstrBot 所需的数据目录和配置文件。初始化完成后,后续启动只需要执行 astrbot run。
| 指令 | 用途 |
|---|---|
astrbot init |
初始化当前目录为 AstrBot 工作目录。 |
astrbot run |
在前台启动 AstrBot。 |
astrbot conf |
查看或修改常用配置项。 |
astrbot password |
交互式修改 WebUI 登录密码。 |
astrbot plug |
创建、安装、更新、删除或搜索插件。 |
astrbot help |
查看 CLI 帮助。 |
astrbot --version |
查看 AstrBot CLI 版本。 |
astrbot run常用选项:
| 选项 | 用途 |
|---|---|
-p, --port <PORT> |
指定 WebUI 端口。 |
-r, --reload |
启用插件自动重载,适合插件开发调试。 |
--reset-password |
启动时重置 WebUI 初始密码,并在启动日志中打印新密码。 |
示例:
astrbot run --port 6185
astrbot run --reload
astrbot run --reset-password如果你忘记了 WebUI 登录密码,可以在 AstrBot 工作目录中执行:
astrbot run --reset-passwordAstrBot 会在启动时重新生成初始密码,并在启动日志中打印。登录后请立即在 WebUI 中修改密码。
使用源码方式直接启动时,也可以执行:
python main.py --reset-passwordastrbot conf 用于查看和修改常用配置项。
astrbot conf get
astrbot conf get dashboard.port
astrbot conf set dashboard.port 6185支持的配置项:
| 配置项 | 说明 |
|---|---|
timezone |
时区,例如 Asia/Shanghai。 |
log_level |
日志等级:DEBUG、INFO、WARNING、ERROR、CRITICAL。 |
dashboard.port |
WebUI 端口。 |
dashboard.username |
WebUI 用户名。 |
dashboard.password |
WebUI 密码。 |
callback_api_base |
回调 API 基础地址,需要以 http:// 或 https:// 开头。 |
修改密码时会自动写入新版密码哈希:
astrbot conf set dashboard.password "new-password"也可以使用专门的交互式密码指令:
astrbot password
astrbot password --username adminastrbot plug 用于管理 data/plugins 下的插件。
| 指令 | 用途 |
|---|---|
astrbot plug list |
查看已安装插件。 |
astrbot plug list --all |
同时显示未安装插件。 |
astrbot plug search <QUERY> |
搜索插件。 |
astrbot plug install <NAME> |
安装插件。 |
astrbot plug update [NAME] |
更新指定插件;不传名称时更新所有可更新插件。 |
astrbot plug remove <NAME> |
删除已安装插件。 |
astrbot plug new <NAME> |
基于模板创建新插件。 |
安装或更新插件时可以使用 GitHub 代理:
astrbot plug install example-plugin --proxy https://gh-proxy.example.com/
astrbot plug update --proxy https://gh-proxy.example.com/创建新插件会交互式询问作者、描述、版本和仓库地址:
astrbot plug new my-plugin查看全部 CLI 帮助:
astrbot help查看指定指令帮助:
astrbot help run
astrbot run --help
astrbot help conf
astrbot plug --help查看版本:
astrbot --version- 首页
- 文档入口
- Top Level
- community events
- deploy
- dev
- others
- platform
- 接入 OneBot v11 协议实现
- 接入钉钉 DingTalk
- 接入 Discord
- 接入 Kook
- 接入飞书
- 接入 LINE
- 接入 Matrix
- 接入 Mattermost
- 接入 Misskey 平台
- 接入 QQ 官方机器人平台
- 通过 QQ官方机器人 接入 QQ (Webhook)
- 通过 QQ官方机器人 接入 QQ (Websockets)
- 接入 Satori 协议
- 接入 server-satori (基于 Koishi)
- 接入 Slack
- 接入消息平台
- 接入 Telegram
- 接入 VoceChat
- AstrBot 接入企业微信
- 接入企业微信智能机器人平台
- AstrBot 接入微信公众平台
- 接入个人微信
- providers
- use
- Home
- Docs Entry
- Top Level
- config
- deploy
- Deploy AstrBot on 1Panel
- Deploy AstrBot on BT Panel
- Deploy AstrBot on CasaOS
- Deploy AstrBot from Source Code
- Community-Provided Deployment Methods
- Deploy via Compshare
- Deploy with AstrBot Desktop Client
- Deploy AstrBot with Docker
- Deploy AstrBot with Kubernetes
- Deploy AstrBot with AstrBot Launcher
- Other Deployments
- Package Manager Deployment (uv)
- Installation via System Package Manager
- Preface
- dev
- AstrBot Configuration File
- AstrBot HTTP API
- Developing a Platform Adapter
- plugin
- AI
- Text to Image
- Handling Message Events
- Plugin Configuration
- Plugin Internationalization
- Plugin Pages
- Sending Messages
- Session Control
- Minimal Example
- Plugin Storage
- AstrBot Plugin Development Guide 🌠
- Publishing Plugins to the Plugin Marketplace
- ospp
- others
- platform
- Connect OneBot v11 Protocol Implementations
- Connect to DingTalk
- Connecting to Discord
- Connect to KOOK
- Connecting to Lark
- Connecting to LINE
- Connecting to Matrix
- Connecting to Mattermost
- Connecting to Misskey Platform
- Connect QQ Official Bot
- Connect QQ via QQ Official Bot (Webhook)
- Connect QQ via QQ Official Bot (Websockets)
- Connect to Satori Protocol
- Connect server-satori (Koishi)
- Connecting to Slack
- Messaging Platforms
- Connecting to Telegram
- Connect to VoceChat
- Connect AstrBot to WeCom
- Connect to WeCom AI Bot Platform
- Connect AstrBot to WeChat Official Account Platform
- Connect Personal WeChat
- providers
- Connect 302.AI
- Agent Runners
- Built-in Agent Runner
- Connect to Coze
- Connect to Alibaba Cloud Bailian Application
- Connect to DeerFlow
- Connect to Dify
- Connect AIHubMix
- coze
- dashscope
- dify
- 大语言模型提供商
- NewAPI
- Connect PPIO Cloud
- Connect LM Studio to Use DeepSeek-R1 and Other Models
- Integrating Ollama
- Connecting to SiliconFlow
- Connecting Model Services
- Connecting to TokenPony
- use
- Agent Runner
- Agent Sandbox Environment ⛵️
- astrbot sandbox
- CLI Commands
- Docker-based Code Interpreter
- Built-in Commands
- Computer Use
- Context Compression
- Custom Rules
- Function Calling
- AstrBot Knowledge Base
- MCP
- AstrBot Star
- Proactive Capabilities
- Anthropic Skills
- Agent Handoff and SubAgent
- Unified Webhook Mode
- Web Search
- WebUI