apero-kit-cli 2.2.5 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +262 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/templates/discord/README.md +150 -0
- package/templates/discord/config.json5 +87 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apero-kit-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "CLI tool to scaffold AI agent projects with pre-configured kits (Claude, OpenCode, Codex)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"agent",
|
|
36
36
|
"claude",
|
|
37
37
|
"claude-code",
|
|
38
|
+
"gemini",
|
|
39
|
+
"discord",
|
|
40
|
+
"clawbot",
|
|
38
41
|
"opencode",
|
|
39
42
|
"codex",
|
|
40
43
|
"cli",
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Discord + Clawbot Setup Guide
|
|
2
|
+
|
|
3
|
+
This directory contains configuration for running your AI agent on Discord via [Clawbot/OpenClaw](https://docs.openclaw.ai).
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### 1. Install OpenClaw CLI
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g openclaw
|
|
11
|
+
# or
|
|
12
|
+
npx openclaw
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Create Discord Bot
|
|
16
|
+
|
|
17
|
+
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
|
|
18
|
+
2. Click "New Application" and name your bot
|
|
19
|
+
3. Go to "Bot" section and click "Add Bot"
|
|
20
|
+
4. Enable these Intents:
|
|
21
|
+
- **Message Content Intent** (required)
|
|
22
|
+
- **Server Members Intent** (recommended)
|
|
23
|
+
5. Click "Reset Token" to get your bot token
|
|
24
|
+
|
|
25
|
+
### 3. Configure Bot Token
|
|
26
|
+
|
|
27
|
+
**Option A: Environment Variable (Recommended)**
|
|
28
|
+
```bash
|
|
29
|
+
export DISCORD_BOT_TOKEN="your-bot-token-here"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Option B: Direct Configuration**
|
|
33
|
+
```bash
|
|
34
|
+
openclaw config set channels.discord.token '"your-bot-token-here"' --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 4. Enable Discord Channel
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
openclaw config set channels.discord.enabled true --json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 5. Start Gateway
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
openclaw gateway
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 6. Invite Bot to Server
|
|
50
|
+
|
|
51
|
+
1. Go to OAuth2 > URL Generator in Discord Developer Portal
|
|
52
|
+
2. Select scopes: `bot`, `applications.commands`
|
|
53
|
+
3. Select permissions:
|
|
54
|
+
- View Channels
|
|
55
|
+
- Send Messages
|
|
56
|
+
- Read Message History
|
|
57
|
+
- Embed Links
|
|
58
|
+
- Attach Files
|
|
59
|
+
- Add Reactions
|
|
60
|
+
4. Copy the generated URL and open it to invite the bot
|
|
61
|
+
|
|
62
|
+
### 7. Pairing (First-time Setup)
|
|
63
|
+
|
|
64
|
+
1. Send a DM to your bot in Discord
|
|
65
|
+
2. Bot responds with a pairing code
|
|
66
|
+
3. Approve the pairing:
|
|
67
|
+
```bash
|
|
68
|
+
openclaw pairing approve discord <CODE>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Using Commands
|
|
72
|
+
|
|
73
|
+
Your commands are available in two ways:
|
|
74
|
+
|
|
75
|
+
### As Slash Commands
|
|
76
|
+
Discord will automatically register your commands as slash commands.
|
|
77
|
+
Type `/` in Discord to see available commands.
|
|
78
|
+
|
|
79
|
+
Example:
|
|
80
|
+
- `/plan create a login feature`
|
|
81
|
+
- `/brainstorm how to optimize database queries`
|
|
82
|
+
|
|
83
|
+
### As Message Commands
|
|
84
|
+
Mention the bot with a command:
|
|
85
|
+
```
|
|
86
|
+
@YourBot /plan create a login feature
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
Edit `config.json5` to customize:
|
|
92
|
+
|
|
93
|
+
- **dmPolicy**: Control who can DM the bot
|
|
94
|
+
- **groupPolicy**: Control which servers can use the bot
|
|
95
|
+
- **guilds**: Configure per-server settings
|
|
96
|
+
- **streaming**: Enable live typing preview
|
|
97
|
+
- **bindings**: Route different users to different agents
|
|
98
|
+
|
|
99
|
+
## Commands Available
|
|
100
|
+
|
|
101
|
+
Your commands are defined in the `commands/` directory:
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
|---------|-------------|
|
|
105
|
+
| `/plan` | Create implementation plans |
|
|
106
|
+
| `/brainstorm` | Brainstorm solutions |
|
|
107
|
+
| `/fix` | Fix code issues |
|
|
108
|
+
| `/code` | Write code |
|
|
109
|
+
| `/review` | Review code changes |
|
|
110
|
+
| ... | See `commands/` for full list |
|
|
111
|
+
|
|
112
|
+
## Useful OpenClaw Commands
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Check status
|
|
116
|
+
openclaw channels status --probe
|
|
117
|
+
|
|
118
|
+
# View logs
|
|
119
|
+
openclaw logs --follow
|
|
120
|
+
|
|
121
|
+
# List pairings
|
|
122
|
+
openclaw pairing list discord
|
|
123
|
+
|
|
124
|
+
# Restart gateway
|
|
125
|
+
openclaw gateway restart
|
|
126
|
+
|
|
127
|
+
# Health check
|
|
128
|
+
openclaw doctor
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Troubleshooting
|
|
132
|
+
|
|
133
|
+
**Bot not responding?**
|
|
134
|
+
- Check Message Content Intent is enabled
|
|
135
|
+
- Verify bot token is correct
|
|
136
|
+
- Run `openclaw doctor` for diagnostics
|
|
137
|
+
|
|
138
|
+
**Commands not showing?**
|
|
139
|
+
- Wait a few minutes for Discord to sync
|
|
140
|
+
- Check `commands.native` is set to `"auto"`
|
|
141
|
+
|
|
142
|
+
**Permission errors?**
|
|
143
|
+
- Verify bot has required permissions
|
|
144
|
+
- Check guild configuration in `config.json5`
|
|
145
|
+
|
|
146
|
+
## Resources
|
|
147
|
+
|
|
148
|
+
- [OpenClaw Documentation](https://docs.openclaw.ai)
|
|
149
|
+
- [Discord Channel Guide](https://docs.openclaw.ai/channels/discord)
|
|
150
|
+
- [Slash Commands](https://docs.openclaw.ai/tools/slash-commands)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Clawbot Discord Configuration
|
|
2
|
+
// Generated by Apero Kit CLI
|
|
3
|
+
// Documentation: https://docs.openclaw.ai/channels/discord
|
|
4
|
+
{
|
|
5
|
+
// Discord Channel Settings
|
|
6
|
+
"channels": {
|
|
7
|
+
"discord": {
|
|
8
|
+
// Bot token - set via environment variable or here
|
|
9
|
+
// Recommended: Use DISCORD_BOT_TOKEN environment variable
|
|
10
|
+
"token": "${DISCORD_BOT_TOKEN}",
|
|
11
|
+
|
|
12
|
+
// Enable Discord channel
|
|
13
|
+
"enabled": true,
|
|
14
|
+
|
|
15
|
+
// Direct Message Policy
|
|
16
|
+
// "pairing" - Require pairing approval (recommended)
|
|
17
|
+
// "allowlist" - Only allow specific users
|
|
18
|
+
// "open" - Allow all DMs
|
|
19
|
+
// "disabled" - Disable DMs
|
|
20
|
+
"dmPolicy": "pairing",
|
|
21
|
+
|
|
22
|
+
// Guild (Server) Policy
|
|
23
|
+
// "open" - Allow all guilds
|
|
24
|
+
// "allowlist" - Only allow specific guilds
|
|
25
|
+
// "disabled" - Disable guild messages
|
|
26
|
+
"groupPolicy": "allowlist",
|
|
27
|
+
|
|
28
|
+
// Message History Limit (for context)
|
|
29
|
+
"historyLimit": 20,
|
|
30
|
+
"dmHistoryLimit": 50,
|
|
31
|
+
|
|
32
|
+
// Reply Mode
|
|
33
|
+
// "off" - No reply threading
|
|
34
|
+
// "first" - Reply to first message only
|
|
35
|
+
// "all" - Reply to all messages
|
|
36
|
+
"replyToMode": "first",
|
|
37
|
+
|
|
38
|
+
// Streaming Mode (live typing preview)
|
|
39
|
+
// "off" - No streaming
|
|
40
|
+
// "partial" - Partial updates
|
|
41
|
+
// "block" - Block updates
|
|
42
|
+
// "progress" - Progress indicator
|
|
43
|
+
"streaming": "partial",
|
|
44
|
+
|
|
45
|
+
// Guild Configurations
|
|
46
|
+
// Add your server(s) here
|
|
47
|
+
"guilds": {
|
|
48
|
+
// Example guild configuration
|
|
49
|
+
// Replace YOUR_SERVER_ID with actual Discord server ID
|
|
50
|
+
// "YOUR_SERVER_ID": {
|
|
51
|
+
// "requireMention": true,
|
|
52
|
+
// "users": ["YOUR_USER_ID"],
|
|
53
|
+
// "roles": ["ALLOWED_ROLE_ID"],
|
|
54
|
+
// "channels": {
|
|
55
|
+
// "general": { "allow": true },
|
|
56
|
+
// "bot-commands": { "allow": true }
|
|
57
|
+
// }
|
|
58
|
+
// }
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// Bot Presence
|
|
62
|
+
"status": "online",
|
|
63
|
+
"activity": "Ready to assist",
|
|
64
|
+
"activityType": 4 // 0=Playing, 1=Streaming, 2=Listening, 3=Watching, 4=Custom
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
// Commands Configuration
|
|
69
|
+
"commands": {
|
|
70
|
+
// Enable native Discord slash commands
|
|
71
|
+
"native": "auto"
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// Agent Bindings (optional)
|
|
75
|
+
// Route different users/roles to different agents
|
|
76
|
+
"bindings": [
|
|
77
|
+
// Example: Route users with specific role to opus agent
|
|
78
|
+
// {
|
|
79
|
+
// "agentId": "opus",
|
|
80
|
+
// "match": {
|
|
81
|
+
// "channel": "discord",
|
|
82
|
+
// "guildId": "YOUR_SERVER_ID",
|
|
83
|
+
// "roles": ["PREMIUM_ROLE_ID"]
|
|
84
|
+
// }
|
|
85
|
+
// }
|
|
86
|
+
]
|
|
87
|
+
}
|