跳到正文
cccskills
免费在 GitHub 公开

sub2api-admin

Manage Sub2API through its administrator API using a bundled command-line tool. Inspect and update accounts, manage redeem codes, groups, and proxies, import or export accounts, and verify changes with follow-up reads.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

Manage Sub2API admin APIs for accounts, redeem codes, groups, proxies, error passthrough rules, TLS fingerprint profiles, imports, exports, batch updates, and raw administrator API calls. Use when the user mentions Sub2API, admin API keys, account management, redeem code management, recharge codes, invitation codes, bulk account import/export, keeping or deleting accounts, refreshing accounts, clearing errors, CRS sync, or managing Sub2API backend settings through the admin API.

查看安装方法

适用场景

  • Reviewing account details and usage before updating settings
  • Importing, exporting, or updating multiple accounts
  • Generating and redeeming recharge or balance codes
  • Managing proxies, error rules, and TLS fingerprint profiles

包含的文件(4)

  • SKILL.md2.8 KB
  • agents/openai.yaml246 B
  • references/admin-cli.md9.8 KB
  • scripts/sub2api-admin.js26.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Sub2API Admin

Use the bundled CLI instead of ad hoc curl. Run examples from this skill directory.

export SUB2API_BASE_URL='https://your-sub2api-host'
export SUB2API_ADMIN_API_KEY='<admin api key>'
# Or, when the deployment uses admin JWT login instead of an admin API key:
# export SUB2API_JWT='<admin access_token>'
node scripts/sub2api-admin.js accounts list

For all commands and payload examples, read references/admin-cli.md.

Workflow

  1. Reuse SUB2API_BASE_URL and either SUB2API_ADMIN_API_KEY or SUB2API_JWT from the environment.
  2. Run read-only commands first: accounts list, accounts get <id>, groups all, or proxies all.
  3. Before destructive or bulk writes, print the target account names and IDs.
  4. Execute the write command only after the target set is clear.
  5. Run a follow-up read command to verify the result.

Common Commands

node scripts/sub2api-admin.js accounts list --page-size 20
node scripts/sub2api-admin.js accounts get 40
node scripts/sub2api-admin.js accounts usage 40
node scripts/sub2api-admin.js accounts set-schedulable 40 true
node scripts/sub2api-admin.js accounts bulk-update --ids 40,39 --json '{"concurrency":10}'
node scripts/sub2api-admin.js redeem-codes list --page-size 20
node scripts/sub2api-admin.js redeem-codes generate --json '{"count":1,"type":"balance","value":10}' --idempotency-key redeem-$(date +%s)
node scripts/sub2api-admin.js redeem-codes create-and-redeem --json '{"code":"order_123","type":"balance","value":10,"user_id":123}' --idempotency-key order-123
node scripts/sub2api-admin.js error-rules list
node scripts/sub2api-admin.js tls-profiles list

Safety Notes

  • Authentication uses x-api-key from SUB2API_ADMIN_API_KEY first, then falls back to Authorization: Bearer <jwt> from SUB2API_JWT.
  • If the API returns INVALID_ADMIN_KEY, ask the user to regenerate the admin API key. If using JWT, log in as an admin user and copy the access_token from POST /api/v1/auth/login.
  • accounts export includes credentials and tokens. Prefer --file and avoid printing exports in chat.
  • Redeem code create/redeem commands should use --idempotency-key for payment or recharge workflows.
  • For uncertain or newly added backend APIs, use api <METHOD> <admin-path> after a read-only check.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

报告此技能的问题