一键导入
add-keysdiscord
Set up Discord credentials for Corsair. Use when the user wants to connect Discord to their agent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Set up Discord credentials for Corsair. Use when the user wants to connect Discord to their agent.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Set up Google OAuth credentials for Corsair. Use when the user wants to connect Google Calendar or Google Drive. Both plugins share the same OAuth app and credentials.
Explains Corsair's key management model. Read this before running any plugin key setup skill. Understand the two-level key system before writing any setup scripts.
Run initial Corsair setup. Use when a user wants to install, configure, or get started with their Corsair agent for the first time. Triggers on "setup", "install", "get started", or first-time setup requests.
Set up endpoint permission guards for the Corsair agent. Use when the user wants to control which agent actions require manual approval, add safeguards, restrict endpoints, or configure protections.
Add Telegram as a messaging channel to the Corsair agent. Use when the user wants to chat with their agent via a Telegram bot instead of or alongside WhatsApp.
Set up WhatsApp for the Corsair agent. Use when the user wants to connect WhatsApp, authenticate with a pairing code, configure the bot trigger, run the DB migration, or start receiving WhatsApp messages.
| name | add-keys/discord |
| description | Set up Discord credentials for Corsair. Use when the user wants to connect Discord to their agent. |
Read /add-keys first if you haven't — it explains the key model.
Auth type: api_key
api_key (bot token), webhook_signature (public key for verifying interactions)api_key)webhook_signature)botAsk the user to provide both values, then write scripts/setup-discord.ts:
import 'dotenv/config';
import { and, eq } from 'drizzle-orm';
import { corsair } from '../server/corsair';
import { db } from '../server/db';
import { corsairAccounts, corsairIntegrations } from '../server/db/schema';
const PLUGIN = 'discord';
const TENANT_ID = 'default';
const BOT_TOKEN = '...'; // fill in
const PUBLIC_KEY = '...'; // fill in
async function main() {
let [integration] = await db
.select()
.from(corsairIntegrations)
.where(eq(corsairIntegrations.name, PLUGIN));
if (!integration) {
[integration] = await db
.insert(corsairIntegrations)
.values({ id: crypto.randomUUID(), name: PLUGIN })
.returning();
console.log(`✓ Created integration: ${PLUGIN}`);
}
await corsair.keys.discord.issue_new_dek();
console.log('✓ Integration DEK ready');
const [existing] = await db
.select()
.from(corsairAccounts)
.where(
and(
eq(corsairAccounts.tenantId, TENANT_ID),
eq(corsairAccounts.integrationId, integration!.id),
),
);
if (!existing) {
await db.insert(corsairAccounts).values({
id: crypto.randomUUID(),
tenantId: TENANT_ID,
integrationId: integration!.id,
});
console.log('✓ Created account');
}
await corsair.discord.keys.issue_new_dek();
console.log('✓ Account DEK ready');
await corsair.discord.keys.set_api_key(BOT_TOKEN);
await corsair.discord.keys.set_webhook_signature(PUBLIC_KEY);
const stored = await corsair.discord.keys.get_api_key();
console.log(`✓ Discord configured. Token starts with: ${stored?.slice(0, 8)}...`);
process.exit(0);
}
main().catch((e) => { console.error(e); process.exit(1); });
Run it:
docker compose exec agent pnpm tsx scripts/setup-discord.ts
Then delete the script:
rm scripts/setup-discord.ts