{"owner":"Wei-Shaw","repo":"sub2api","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["skills/sub2api-admin/SKILL.md"],"skills":{"skills/sub2api-admin/SKILL.md":"---\nname: sub2api-admin\ndescription: 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.\n---\n\n# Sub2API Admin\n\nUse the bundled CLI instead of ad hoc `curl`. Run examples from this skill directory.\n\n```bash\nexport SUB2API_BASE_URL='https://your-sub2api-host'\nexport SUB2API_ADMIN_API_KEY='<admin api key>'\n# Or, when the deployment uses admin JWT login instead of an admin API key:\n# export SUB2API_JWT='<admin access_token>'\nnode scripts/sub2api-admin.js accounts list\n```\n\nFor all commands and payload examples, read [references/admin-cli.md](references/admin-cli.md).\n\n## Workflow\n\n1. Reuse `SUB2API_BASE_URL` and either `SUB2API_ADMIN_API_KEY` or `SUB2API_JWT` from the environment.\n2. Run read-only commands first: `accounts list`, `accounts get <id>`, `groups all`, or `proxies all`.\n3. Before destructive or bulk writes, print the target account names and IDs.\n4. Execute the write command only after the target set is clear.\n5. Run a follow-up read command to verify the result.\n\n## Common Commands\n\n```bash\nnode scripts/sub2api-admin.js accounts list --page-size 20\nnode scripts/sub2api-admin.js accounts get 40\nnode scripts/sub2api-admin.js accounts usage 40\nnode scripts/sub2api-admin.js accounts set-schedulable 40 true\nnode scripts/sub2api-admin.js accounts bulk-update --ids 40,39 --json '{\"concurrency\":10}'\nnode scripts/sub2api-admin.js redeem-codes list --page-size 20\nnode scripts/sub2api-admin.js redeem-codes generate --json '{\"count\":1,\"type\":\"balance\",\"value\":10}' --idempotency-key redeem-$(date +%s)\nnode scripts/sub2api-admin.js redeem-codes create-and-redeem --json '{\"code\":\"order_123\",\"type\":\"balance\",\"value\":10,\"user_id\":123}' --idempotency-key order-123\nnode scripts/sub2api-admin.js error-rules list\nnode scripts/sub2api-admin.js tls-profiles list\n```\n\n## Safety Notes\n\n- Authentication uses `x-api-key` from `SUB2API_ADMIN_API_KEY` first, then falls back to `Authorization: Bearer <jwt>` from `SUB2API_JWT`.\n- 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`.\n- `accounts export` includes credentials and tokens. Prefer `--file` and avoid printing exports in chat.\n- Redeem code create/redeem commands should use `--idempotency-key` for payment or recharge workflows.\n- For uncertain or newly added backend APIs, use `api <METHOD> <admin-path>` after a read-only check.\n"},"files":{"skills/sub2api-admin/SKILL.md":"---\nname: sub2api-admin\ndescription: 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.\n---\n\n# Sub2API Admin\n\nUse the bundled CLI instead of ad hoc `curl`. Run examples from this skill directory.\n\n```bash\nexport SUB2API_BASE_URL='https://your-sub2api-host'\nexport SUB2API_ADMIN_API_KEY='<admin api key>'\n# Or, when the deployment uses admin JWT login instead of an admin API key:\n# export SUB2API_JWT='<admin access_token>'\nnode scripts/sub2api-admin.js accounts list\n```\n\nFor all commands and payload examples, read [references/admin-cli.md](references/admin-cli.md).\n\n## Workflow\n\n1. Reuse `SUB2API_BASE_URL` and either `SUB2API_ADMIN_API_KEY` or `SUB2API_JWT` from the environment.\n2. Run read-only commands first: `accounts list`, `accounts get <id>`, `groups all`, or `proxies all`.\n3. Before destructive or bulk writes, print the target account names and IDs.\n4. Execute the write command only after the target set is clear.\n5. Run a follow-up read command to verify the result.\n\n## Common Commands\n\n```bash\nnode scripts/sub2api-admin.js accounts list --page-size 20\nnode scripts/sub2api-admin.js accounts get 40\nnode scripts/sub2api-admin.js accounts usage 40\nnode scripts/sub2api-admin.js accounts set-schedulable 40 true\nnode scripts/sub2api-admin.js accounts bulk-update --ids 40,39 --json '{\"concurrency\":10}'\nnode scripts/sub2api-admin.js redeem-codes list --page-size 20\nnode scripts/sub2api-admin.js redeem-codes generate --json '{\"count\":1,\"type\":\"balance\",\"value\":10}' --idempotency-key redeem-$(date +%s)\nnode scripts/sub2api-admin.js redeem-codes create-and-redeem --json '{\"code\":\"order_123\",\"type\":\"balance\",\"value\":10,\"user_id\":123}' --idempotency-key order-123\nnode scripts/sub2api-admin.js error-rules list\nnode scripts/sub2api-admin.js tls-profiles list\n```\n\n## Safety Notes\n\n- Authentication uses `x-api-key` from `SUB2API_ADMIN_API_KEY` first, then falls back to `Authorization: Bearer <jwt>` from `SUB2API_JWT`.\n- 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`.\n- `accounts export` includes credentials and tokens. Prefer `--file` and avoid printing exports in chat.\n- Redeem code create/redeem commands should use `--idempotency-key` for payment or recharge workflows.\n- For uncertain or newly added backend APIs, use `api <METHOD> <admin-path>` after a read-only check.\n"},"items":[{"name":"SKILL.md","path":"skills/sub2api-admin/SKILL.md","title":"sub2api-admin Skill","content":"---\nname: sub2api-admin\ndescription: 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.\n---\n\n# Sub2API Admin\n\nUse the bundled CLI instead of ad hoc `curl`. Run examples from this skill directory.\n\n```bash\nexport SUB2API_BASE_URL='https://your-sub2api-host'\nexport SUB2API_ADMIN_API_KEY='<admin api key>'\n# Or, when the deployment uses admin JWT login instead of an admin API key:\n# export SUB2API_JWT='<admin access_token>'\nnode scripts/sub2api-admin.js accounts list\n```\n\nFor all commands and payload examples, read [references/admin-cli.md](references/admin-cli.md).\n\n## Workflow\n\n1. Reuse `SUB2API_BASE_URL` and either `SUB2API_ADMIN_API_KEY` or `SUB2API_JWT` from the environment.\n2. Run read-only commands first: `accounts list`, `accounts get <id>`, `groups all`, or `proxies all`.\n3. Before destructive or bulk writes, print the target account names and IDs.\n4. Execute the write command only after the target set is clear.\n5. Run a follow-up read command to verify the result.\n\n## Common Commands\n\n```bash\nnode scripts/sub2api-admin.js accounts list --page-size 20\nnode scripts/sub2api-admin.js accounts get 40\nnode scripts/sub2api-admin.js accounts usage 40\nnode scripts/sub2api-admin.js accounts set-schedulable 40 true\nnode scripts/sub2api-admin.js accounts bulk-update --ids 40,39 --json '{\"concurrency\":10}'\nnode scripts/sub2api-admin.js redeem-codes list --page-size 20\nnode scripts/sub2api-admin.js redeem-codes generate --json '{\"count\":1,\"type\":\"balance\",\"value\":10}' --idempotency-key redeem-$(date +%s)\nnode scripts/sub2api-admin.js redeem-codes create-and-redeem --json '{\"code\":\"order_123\",\"type\":\"balance\",\"value\":10,\"user_id\":123}' --idempotency-key order-123\nnode scripts/sub2api-admin.js error-rules list\nnode scripts/sub2api-admin.js tls-profiles list\n```\n\n## Safety Notes\n\n- Authentication uses `x-api-key` from `SUB2API_ADMIN_API_KEY` first, then falls back to `Authorization: Bearer <jwt>` from `SUB2API_JWT`.\n- 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`.\n- `accounts export` includes credentials and tokens. Prefer `--file` and avoid printing exports in chat.\n- Redeem code create/redeem commands should use `--idempotency-key` for payment or recharge workflows.\n- For uncertain or newly added backend APIs, use `api <METHOD> <admin-path>` after a read-only check.\n","category":"skills","tokens":717}]}