@bitget-ai/bitget-agent-skill 1.2.0 → 3.1.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/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to `bitget-agent-skill` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.0.0] - 2026-06-18
9
+
10
+ Full rewrite for the **Bitget Unified Trading Account (UTA / v3)** API. The version
11
+ jumps from 1.2.0 to 3.0.0 to track the major of `@bitget-ai/bitget-agent-cli` and
12
+ `@bitget-ai/bitget-agent-sdk` (there is no 2.x skill release).
13
+
14
+ ### Changed (BREAKING)
15
+ - **New CLI grammar.** `SKILL.md` now teaches `bgc <tool> [--action <name>] [--<param> <value> ...]`, replacing the v2 `bgc <module> <tool_name>` form. There are no separate spot/futures modules — one `--category` (`SPOT`, `MARGIN`, `USDT-FUTURES`, `COIN-FUTURES`, `USDC-FUTURES`) selects the market.
16
+ - **16 intent verbs** across 9 domains (market, trade, account, funds, subaccount, loan, tax, plus hidden to-B broker/inst_loan) replace the old 59 flat tools.
17
+ - **`references/commands.md` is regenerated from the SDK's own `discover` surface** — every domain, verb, action, and parameter (with enums and doc-grounded descriptions) for 109 operations, guaranteed not to drift from what `bgc` exposes.
18
+ - **Error docs** rewritten for the v3 semantic error model: a `{ ok, error: { type, category, message, suggestion, retryable }, timestamp }` payload with category-driven recovery.
19
+
20
+ ### Added
21
+ - **`references/discover-guide.md`** — the discover-first workflow (`bgc discover` → `--domain` → `--tool` → `--action`), keyword search, the `raw` escape hatch, and opting into hidden modules.
22
+ - **`references/trading-safety.md`** — close-direction rules (one-way vs hedge), TP/SL presets, `qty` unit gotchas (spot market-buy is quote-coin), cancel-all scoping, and withdrawal chain-address safety.
23
+ - **Write-safety model** documented end to end: operations graded read < write < high; `--dry-run` previews, `--confirm` gates high-risk ops (`closeAllPositions`, `cancelAllOrders`, `withdrawal`, `brokerSubaccountWithdrawal`), `--read-only` and `--paper-trading` modes.
24
+
25
+ ### Removed
26
+ - **`references/trading/`** (12 v2-grammar trading docs) — superseded by `references/trading-safety.md` and the regenerated catalog.
27
+
28
+ ### Dependencies
29
+ - Targets `@bitget-ai/bitget-agent-cli` v3 (the `bgc` binary) and `@bitget-ai/bitget-agent-sdk` v3.
30
+
8
31
  ## [1.2.0] - 2026-05-29
9
32
 
10
33
  ### Added
package/README.md CHANGED
@@ -1,54 +1,125 @@
1
- # @bitget-ai/bitget-agent-skill
1
+ <p align="center">
2
+ <img src="assets/logo.png" alt="Bitget Agent Skill — AI reasoning guide for Claude Code, Codex and terminal crypto trading" width="120" />
3
+ </p>
4
+
5
+ <h1 align="center">bitget-agent-skill — Official Bitget AI Trading Skill</h1>
6
+
7
+ <p align="center">
8
+ <strong>Give Claude Code, Codex, and OpenClaw the judgment to understand your trading instructions — when to call Bitget, how to build the right command, and what to do when something goes wrong.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/@bitget-ai/bitget-agent-skill"><img src="https://img.shields.io/npm/v/%40bitget-ai%2Fbitget-agent-skill.svg?style=flat-square&color=28a745" alt="npm version" /></a>
13
+ <a href="https://www.npmjs.com/package/@bitget-ai/bitget-agent-skill"><img src="https://img.shields.io/npm/dm/%40bitget-ai%2Fbitget-agent-skill.svg?style=flat-square&color=026e00" alt="npm downloads" /></a>
14
+ <img src="https://img.shields.io/badge/Node.js-%E2%89%A520-026e00?style=flat-square" alt="Node.js ≥ 20" />
15
+ <a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square" alt="MIT License" /></a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <a href="#quick-start">Quick Start</a> ·
20
+ <a href="#what-changes-after-installing">What Changes</a> ·
21
+ <a href="#why-a-skill-vs-just-installing-bgc">Why a Skill</a> ·
22
+ <a href="#installation">Installation</a> ·
23
+ <a href="#security">Security</a> ·
24
+ <a href="#troubleshooting">Troubleshooting</a> ·
25
+ <a href="#faq">FAQ</a>
26
+ </p>
2
27
 
3
- [![npm](https://img.shields.io/npm/v/%40bitget-ai%2Fbitget-agent-skill.svg?style=flat-square&color=28a745)](https://www.npmjs.com/package/@bitget-ai/bitget-agent-skill)
4
- [![Node.js](https://img.shields.io/badge/Node.js-%E2%89%A520-026e00?style=flat-square)](https://nodejs.org)
5
- [![License](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](LICENSE)
28
+ ---
6
29
 
7
- The **skill surface** of the [Bitget Agent Hub](https://github.com/Bitget-AI/agent-hub) — installs an AI skill that teaches Claude Code, Codex, and OpenClaw **when and how** to use [`bgc`](https://github.com/Bitget-AI/agent-cli) for natural-language Bitget trading. Pure markdown, runtime-free.
30
+ > **Bitget Agent Hub** is Bitget's official open-source AI Agent ecosystem. This repository is `bitget-agent-skill` — the **skill surface** that teaches terminal AI agents when and how to correctly invoke Bitget tools. Ecosystem packages: [agent-skill](https://github.com/Bitget-AI/agent-skill) (this repo), [agent-cli](https://github.com/Bitget-AI/agent-cli), [agent-mcp](https://github.com/Bitget-AI/agent-mcp), [agent-sdk](https://github.com/Bitget-AI/agent-sdk), [bitget-signal](https://github.com/Bitget-AI/bitget-signal), [agent_hub](https://github.com/Bitget-AI/agent_hub).
8
31
 
9
- ```bash
10
- npm install -g @bitget-ai/bitget-agent-cli # the bgc CLI this skill drives
11
- npx @bitget-ai/bitget-agent-skill # one-shot: deploys SKILL.md into your AI tool
32
+ `@bitget-ai/bitget-agent-skill` is Bitget's official AI trading skill file, giving Claude Code, Codex, and OpenClaw the judgment to use Bitget tools correctly — knowing when to invoke Bitget, how to break your intent into the right multi-step operations, how to handle confirmation before write actions, and what to do when something goes wrong. Pure markdown, runtime-free.
33
+
34
+ **Is this for you?** You're already using Claude Code, Codex, or OpenClaw and want it to actually understand your trading instructions — not just have the tool but lack the reasoning to use it — install this.
35
+
36
+ ---
37
+
38
+ ## Quick Start
39
+
40
+ Paste the block below into your AI agent — it will handle the entire setup (requires Node.js 20+):
41
+
42
+ ```prompt
43
+ Please help me install the Bitget trading skill (requires Node.js 20+): 1. Run npx @bitget-ai/bitget-agent-skill --target all to deploy the skill files to my AI tool; 2. Run npm install -g @bitget-ai/bitget-agent-cli to install the bgc CLI globally. Tell me the result when done.
12
44
  ```
13
45
 
14
- > Why one is `-g` and the other is `npx`? `bgc` is a persistent CLI your AI calls dozens of times per session — it goes on `$PATH`. This skill, by contrast, is a one-shot deploy: it copies markdown into your AI tool's skill directory and exits, then is never used again until you upgrade. `npx` always pulls the latest version, so subsequent runs auto-upgrade you.
46
+ > Both must be installed together: the skill file is the AI's instruction manual, `bgc` is the execution tool — the skill teaches the AI when to call it and how to build commands, `bgc` actually makes the API requests. Without either one, the full flow is incomplete.
15
47
 
16
- > **Prerequisites:** Node.js ≥ 20. The `bgc` CLI ([`@bitget-ai/bitget-agent-cli`](https://github.com/Bitget-AI/agent-cli)) installed and on `$PATH`. A Bitget API key, secret, and passphrase ([create one](https://www.bitget.com/api-doc/common/intro)).
48
+ **Verify it worked.** Ask your AI: *"What trading modules does Bitget support?"* If it returns the correct module list (market, trade, account, etc.), the skill is loaded and active.
17
49
 
18
- > Installation is a separate, explicit step (no postinstall side effects). By default it deploys to Claude Code at `~/.claude/skills/bitget-agent-skill/`.
50
+ ---
51
+
52
+ ## What Changes After Installing
53
+
54
+ ```mermaid
55
+ graph LR
56
+ A[You<br/>Natural Language] --> B[Claude Code / Codex<br/>with bitget-agent-skill]
57
+ B -->|Generates v3 Command| C[bgc CLI<br/>bitget-agent-cli]
58
+ C -->|HMAC-SHA256 Signed| D[Bitget REST API]
59
+ style B fill:#28a745,stroke:#333,stroke-width:2px,color:#fff
60
+ ```
61
+
62
+ Without the skill, `bgc` executes one command at a time. With the skill loaded, the AI can chain your intent into a sequence of operations across modules — check positions, evaluate conditions, place the order, handle the result — all in one go.
63
+
64
+ - **Trigger recognition in English and Chinese**: whether you say "buy BTC at market" or「帮我买 BTC」, the AI recognizes it as a Bitget trading instruction and calls the right tool automatically — no need to specify command syntax
65
+ - **v3 grammar and full reference**: the skill file includes the `bgc` v3 grammar (`bgc <tool> --action <name>`) and an auto-generated catalog of every operation — the AI knows which intent verb maps to which operation and how to fill in the parameters
66
+ - **Multi-step workflow**: "check my positions, and if I have no BTC open a 10x long" — the AI queries first, reasons, then places the order, showing `[CAUTION]` before every write operation and waiting for your confirmation
67
+ - **Paper trading and error handling**: tell the AI "use demo account" to switch to Bitget's sandbox automatically; when API errors occur, the AI knows whether to retry or surface the issue to you — instead of getting stuck
19
68
 
20
69
  ---
21
70
 
22
- ## Why a skill (vs. just installing `bgc`)
71
+ ## Why a Skill (vs. just installing `bgc`)
23
72
 
24
- The CLI alone gives the AI 59 commands but no semantics — the assistant doesn't know **when** to reach for Bitget, or **how** to compose the right tool.
73
+ The CLI alone gives the AI 14 intent verbs over the Unified Trading Account (89 operations) but no semantics — the assistant doesn't know **when** to reach for Bitget, **which** verb to use, or **how** to drive it safely.
25
74
 
26
75
  The skill adds:
27
76
 
28
77
  - A **trigger description** so Claude Code / Codex / OpenClaw automatically invokes the skill on any Bitget-relevant request — including casual phrasings (*"buy 0.1 BTC at market"*) and Chinese (*"查看我的持仓"*).
29
- - A **reference catalog** of every command with parameters and examples, auto-generated from the SDK's tool definitions.
30
- - **Operational guidance** for write operations, demo trading, error codes, auth setup, and safety patterns.
78
+ - The **v3 grammar** (`bgc <tool> --action <name> --<param> <value>`) and a **discover-first** workflow, plus a complete catalog of every verb, action, and parameter.
79
+ - **Operational guidance** for write-safety (`--dry-run` / `--confirm`), close-direction rules, demo trading, error categories, and auth setup.
31
80
 
32
- Result: you say *"buy 0.1 BTC at market on Bitget"* and it actually works — the assistant knows to compose `bgc spot spot_place_order --symbol BTCUSDT --side buy --orderType market --size 0.1`, surfaces a `[CAUTION]` confirmation, and runs it.
81
+ Result: you say *"buy 0.1 BTC at market on Bitget"* and it actually works — the assistant composes `bgc order --action place --category SPOT --symbol BTCUSDT --side buy --orderType market --qty 0.1`, previews it with `--dry-run`, confirms with you, then runs it.
33
82
 
34
83
  ---
35
84
 
36
- ## Targets
85
+ ## What Ships in the Skill
86
+
87
+ | File | Purpose |
88
+ |---|---|
89
+ | `SKILL.md` | Top-level skill definition with trigger phrases (English + Chinese) so the AI knows when to invoke, plus the v3 grammar, the 14-verb map, and the write-safety workflow. |
90
+ | `references/commands.md` | Auto-generated static catalog — every domain, verb, action, and parameter (with enums + descriptions), from the SDK's own `discover` surface. |
91
+ | `references/discover-guide.md` | How to navigate the live surface with `bgc discover` (the four rungs, search, `raw`). |
92
+ | `references/trading-safety.md` | Close-direction rules (one-way/hedge), TP/SL, `qty` units, cancel-all, and withdrawal safety. |
93
+ | `references/auth-setup.md` | How to create a Bitget API key and configure environment variables. |
94
+ | `references/demo-trading.md` | How to use `--paper-trading` for safe rehearsal. |
95
+ | `references/error-codes.md` | The v3 error payload, category-driven recovery, and the curated Bitget code table. |
96
+
97
+ ---
98
+
99
+ ## Installation
100
+
101
+ ### Step 1: Install the CLI
102
+
103
+ ```bash
104
+ npm install -g @bitget-ai/bitget-agent-cli
105
+ ```
106
+
107
+ > Why `-g`? `bgc` is a persistent CLI your AI calls dozens of times per session — it must be on `$PATH`. This skill, by contrast, is a one-shot deploy: `npx` copies markdown into your AI tool's skill directory and exits. `npx` always pulls the latest version, so subsequent runs auto-upgrade you.
108
+
109
+ ### Step 2: Deploy the Skill File
37
110
 
38
111
  ```bash
39
- # Default — Claude Code
112
+ # Default — Claude Code only
40
113
  npx @bitget-ai/bitget-agent-skill
41
114
 
42
- # Pick targets explicitly
43
- npx @bitget-ai/bitget-agent-skill --target claude
44
- npx @bitget-ai/bitget-agent-skill --target claude,codex
115
+ # All supported AI tools
45
116
  npx @bitget-ai/bitget-agent-skill --target all
46
117
 
47
- # Pick interactively
118
+ # Choose interactively
48
119
  npx @bitget-ai/bitget-agent-skill --interactive
49
120
  ```
50
121
 
51
- Currently supported skill destinations:
122
+ `--target all` deploys to Claude Code, Codex, and OpenClaw simultaneously.
52
123
 
53
124
  | Target | Skill location |
54
125
  |---|---|
@@ -56,68 +127,129 @@ Currently supported skill destinations:
56
127
  | Codex | `~/.codex/skills/bitget-agent-skill/` |
57
128
  | OpenClaw | `~/.openclaw/skills/bitget-agent-skill/` |
58
129
 
59
- After installing, restart your AI host so the new skill is picked up.
130
+ ### Step 3: Set Up Credentials
60
131
 
61
- ---
132
+ ```bash
133
+ export BITGET_API_KEY="your-api-key"
134
+ export BITGET_SECRET_KEY="your-secret-key"
135
+ export BITGET_PASSPHRASE="your-passphrase"
136
+ ```
62
137
 
63
- ## How it fits together
138
+ [Create an API key](https://www.bitget.com/api-doc/common/intro) if you don't have one. For demo trading, use a [Demo API Key](https://www.bitget.com/account/demo) instead:
64
139
 
65
- ```
66
- You → Claude Code / Codex / OpenClaw (with this skill loaded)
67
- │
68
- │ "buy 0.1 BTC at market on Bitget"
69
- ▼
70
- bgc CLI (@bitget-ai/bitget-agent-cli)
71
- │
72
- ▼
73
- Bitget REST API
140
+ ```bash
141
+ export BITGET_DEMO_API_KEY="your-demo-key"
142
+ export BITGET_DEMO_SECRET_KEY="your-demo-secret"
143
+ export BITGET_DEMO_PASSPHRASE="your-demo-passphrase"
74
144
  ```
75
145
 
76
- `bitget-agent-skill` ships **pure markdown** — no daemon, no runtime, no MCP server. The actual API calls go through `bgc`, which the skill teaches the AI to invoke correctly.
146
+ ### Step 4: Restart and Verify
147
+
148
+ Close and reopen your AI tool, then ask: *"What Bitget trading capabilities do you have?"*
77
149
 
78
150
  ---
79
151
 
80
- ## What ships in the skill
152
+ ## Related Tools
81
153
 
82
- | File | Purpose |
154
+ | Tool | Relationship |
83
155
  |---|---|
84
- | `SKILL.md` | Top-level skill definition with trigger phrases (English + Chinese) so the AI knows when to invoke. |
85
- | `references/commands.md` | Auto-generated catalog of all 59 tools — names, parameters, defaults, auth requirements. |
86
- | `references/auth-setup.md` | How to create a Bitget API key and configure environment variables. |
87
- | `references/demo-trading.md` | How to use `--paper-trading` for safe rehearsal. |
88
- | `references/error-codes.md` | Bitget API error codes and recommended AI responses. |
156
+ | [`@bitget-ai/bitget-agent-cli`](https://github.com/Bitget-AI/agent-cli) | Must be installed together: `bgc` is the execution tool, the skill file is the AI's instruction manual — neither works without the other |
157
+ | [`@bitget-ai/bitget-agent-mcp`](https://github.com/Bitget-AI/agent-mcp) | Alternative for desktop AI (Claude Desktop, Cursor) — no `bgc` required |
158
+ | [`@bitget-ai/bitget-signal`](https://github.com/Bitget-AI/bitget-signal) | Market analysis skills — no API key needed. This skill handles trading execution; `bitget-signal` handles market analysis. Complementary, can be installed side by side |
89
159
 
90
160
  ---
91
161
 
92
- ## Pair with market signals
162
+ ## Security
93
163
 
94
- For market analysis (no API key needed), pair this skill with [`@bitget-ai/bitget-signal`](https://github.com/Bitget-AI/bitget-signal):
164
+ The skill files themselves:
165
+ - No API key required — pure Markdown
166
+ - No network access — no runtime process
167
+ - No credential storage — keys are passed via environment variables to `bgc`
95
168
 
96
- ```bash
97
- npx @bitget-ai/bitget-signal
98
- ```
99
-
100
- Five additional skills get installed (macro / market-intel / sentiment / technical / news) and Bitget's public market-data MCP server is registered. The two products are complementary — one trades, the other analyses.
169
+ All actual API calls go through `bgc`, which provides:
170
+ - Credentials live only in environment variables (no `.env` file parsing)
171
+ - `--read-only` strips all write tools
172
+ - `--paper-trading` switches to the demo environment
173
+ - Local HMAC-SHA256 request signing
101
174
 
102
175
  ---
103
176
 
104
- ## Manage everything with the meta installer
177
+ ## Troubleshooting
178
+
179
+ ### "Skill not recognized by AI"
180
+
181
+ **Cause:** Skill file not deployed or AI tool not restarted.
182
+
183
+ **Fix:**
184
+ 1. Re-deploy: `npx @bitget-ai/bitget-agent-skill --target all`
185
+ 2. Restart your AI tool completely
186
+ 3. Verify: ask *"What Bitget trading modules are available?"*
187
+
188
+ ### "AI has bgc but doesn't understand trading commands"
189
+
190
+ **Cause:** The skill file is missing — `bgc` is installed but the AI has no instruction manual.
191
+
192
+ **Fix:** Deploy the skill and verify the files landed in the correct location:
193
+
194
+ | AI Tool | Expected Location |
195
+ |---|---|
196
+ | Claude Code | `~/.claude/skills/bitget-agent-skill/SKILL.md` |
197
+ | Codex | `~/.codex/skills/bitget-agent-skill/SKILL.md` |
198
+ | OpenClaw | `~/.openclaw/skills/bitget-agent-skill/SKILL.md` |
199
+
200
+ ### "bgc: command not found"
105
201
 
106
- If you're using more than one Bitget AI package, the meta installer can install / upgrade / rollback the lot:
202
+ **Cause:** `bitget-agent-cli` not installed or not on `$PATH`.
203
+
204
+ **Fix:** `npm install -g @bitget-ai/bitget-agent-cli` then restart your terminal.
205
+
206
+ ---
207
+
208
+ ## Updates
107
209
 
108
210
  ```bash
109
- npx @bitget-ai/bitget-agent-installer
211
+ # Update all Bitget AI packages
212
+ npx @bitget-ai/bitget-agent-installer upgrade-all --target all
213
+
214
+ # Or update just this skill
215
+ npx @bitget-ai/bitget-agent-skill@latest
110
216
  ```
111
217
 
112
- See [agent-hub](https://github.com/Bitget-AI/agent-hub) for the full installer feature list.
218
+ ---
219
+
220
+ ## FAQ
221
+
222
+ **Will the AI automatically place orders after the skill is installed?**
223
+ No. For write operations like placing orders or transferring funds, the AI displays a `[CAUTION]` annotation and waits for your confirmation before executing.
224
+
225
+ **How do I trade without real money?**
226
+ Tell your AI "use demo account" or "use paper trading" — it will switch to Bitget's Demo Trading environment automatically. Requires a [Demo API Key](https://www.bitget.com/account/demo).
227
+
228
+ **What's the difference between this and the MCP server?**
229
+ Terminal AI (Claude Code, Codex) → install `bitget-agent-skill` + `bgc`. Desktop AI (Claude Desktop, Cursor) → install `bitget-agent-mcp`. Both enable natural language Bitget trading — they adapt to different AI environments.
230
+
231
+ **Does the skill file require an API key or network access?**
232
+ No. Pure Markdown files with no runtime process. All API calls happen at execution time through `bgc`.
233
+
234
+ **Is it free?**
235
+ MIT-licensed and free to use.
236
+
237
+ ---
238
+
239
+ ## Contributing
240
+
241
+ - **Bug reports & feature requests:** [GitHub Issues](https://github.com/Bitget-AI/agent-skill/issues)
242
+ - **Discussions:** [GitHub Discussions](https://github.com/Bitget-AI/agent-skill/discussions)
243
+ - **Security concerns:** security@bitget.com
113
244
 
114
245
  ---
115
246
 
116
247
  ## License
117
248
 
118
- [MIT](LICENSE)
249
+ [MIT](LICENSE) — Free for personal and commercial use.
119
250
 
120
251
  ---
121
252
 
122
- <sub>Part of the **[Bitget Agent Hub](https://github.com/Bitget-AI/agent-hub)** ecosystem · Trading Stack · Surface.<br/>
123
- Foundation: [agent-sdk](https://github.com/Bitget-AI/agent-sdk) · Other surfaces: [agent-cli](https://github.com/Bitget-AI/agent-cli) · [agent-mcp](https://github.com/Bitget-AI/agent-mcp) · Market signals: [bitget-signal](https://github.com/Bitget-AI/bitget-signal)</sub>
253
+ <sub>Part of the **[Bitget Agent Hub](https://github.com/Bitget-AI/agent_hub)** ecosystem — the official open-source AI Agent ecosystem from Bitget.<br/>
254
+ Trading Stack · Skill Surface. ⚠️ Trading cryptocurrency carries risk; you are responsible for any orders your AI agent places. Use demo account to practice safely before trading with real funds.<br/>
255
+ Foundation: [agent-sdk](https://github.com/Bitget-AI/agent-sdk) · Execution: [agent-cli](https://github.com/Bitget-AI/agent-cli) · Desktop: [agent-mcp](https://github.com/Bitget-AI/agent-mcp) · Market signals: [bitget-signal](https://github.com/Bitget-AI/bitget-signal)</sub>
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 3.1.0
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@bitget-ai/bitget-agent-skill",
3
- "version": "1.2.0",
3
+ "version": "3.1.0",
4
4
  "packageManager": "pnpm@8.14.1",
5
- "description": "Official Bitget AI skill — teaches Claude Code, Codex, and OpenClaw how to drive the Bitget API via the bgc CLI for natural-language trading. Run `npx bitget-agent-skill` to deploy into your AI tool's skill directory.",
5
+ "description": "Official Bitget AI skill — teaches Claude Code, Codex, and OpenClaw when and how to drive the Bitget Unified Trading Account (UTA / v3) API through the `bgc` CLI from natural language. Run `npx @bitget-ai/bitget-agent-skill` to deploy into your AI tool's skill directory.",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "bin": {
@@ -20,6 +20,8 @@
20
20
  "scripts": {
21
21
  "gen-references": "node scripts/gen-references.js",
22
22
  "install-skill": "node scripts/install.js",
23
+ "e2e:real": "node e2e/run.mjs",
24
+ "e2e:agent": "node e2e/agent/run.mjs",
23
25
  "prepublishOnly": "node scripts/gen-references.js"
24
26
  },
25
27
  "engines": {
@@ -42,6 +44,6 @@
42
44
  "registry": "https://registry.npmjs.org/"
43
45
  },
44
46
  "devDependencies": {
45
- "@bitget-ai/bitget-agent-sdk": "^1.2.0"
47
+ "@bitget-ai/bitget-agent-sdk": "^3.0.0"
46
48
  }
47
49
  }
@@ -1,8 +1,12 @@
1
1
  # Bitget API Authentication Setup
2
2
 
3
- ## Environment Variables (recommended)
3
+ Public market data (`bgc market ...`, `bgc discover`) needs no credentials.
4
+ Account, trading, transfer, and withdrawal operations are private and require
5
+ API credentials.
4
6
 
5
- Set these before running bgc:
7
+ ## Environment variables (recommended)
8
+
9
+ Set all three before running `bgc` — they must be provided together:
6
10
 
7
11
  ```bash
8
12
  export BITGET_API_KEY="your-api-key"
@@ -10,17 +14,41 @@ export BITGET_SECRET_KEY="your-secret-key"
10
14
  export BITGET_PASSPHRASE="your-passphrase"
11
15
  ```
12
16
 
13
- ## Get API Credentials
17
+ Providing only some of them is an error (`Partial API credentials detected`).
18
+
19
+ ## Optional environment variables
20
+
21
+ ```bash
22
+ export BITGET_API_BASE_URL="https://api.bitget.com" # override the API host
23
+ export BITGET_TIMEOUT_MS="15000" # per-request timeout (default 15000)
24
+ export BITGET_MAX_RETRIES="3" # transient-error retries
25
+ ```
26
+
27
+ ## Get API credentials
14
28
 
15
29
  1. Log in to https://www.bitget.com
16
- 2. Go to Settings → API Management
30
+ 2. Go to **Settings → API Management**
17
31
  3. Create a new API key with the permissions you need:
18
- - Read Only: for market data and account queries
19
- - Trade: for placing/cancelling orders
32
+ - **Read Only** — market data and account queries
33
+ - **Trade** — placing/cancelling orders, transfers
34
+ - **Withdraw** — only if you intend to withdraw (and whitelist your IP)
20
35
 
21
- ## Read-Only Mode
36
+ ## Verify
22
37
 
23
- To prevent any write operations:
24
38
  ```bash
25
- bgc --read-only spot spot_get_ticker --symbol BTCUSDT
39
+ bgc account_overview # private — confirms credentials work
40
+ bgc market --action tickers --category SPOT --symbol BTCUSDT # public — no creds needed
26
41
  ```
42
+
43
+ If credentials are missing or wrong, the error payload's `error.category` is `auth`
44
+ and `error.suggestion` tells you which credential to fix.
45
+
46
+ ## Read-only mode
47
+
48
+ To block every write for a session (reads still work):
49
+
50
+ ```bash
51
+ bgc --read-only order --action open --category SPOT --symbol BTCUSDT
52
+ ```
53
+
54
+ `--read-only` is mutually exclusive with `--paper-trading`.