@bitget-ai/bitget-agent-cli
v1.2.0
Published
bgc — the official Bitget shell CLI. Run any of 56+ Bitget API tools (spot, futures, margin, copy-trading, earn, broker, p2p, convert, account) from your terminal or shell-based AI assistant (Claude Code, Codex CLI, OpenClaw).
Maintainers
Readme
@bitget-ai/bitget-agent-cli — bgc
The shell surface of the Bitget Agent Hub — invoke any of 59 Bitget API tools straight from your terminal, or let your shell-based AI assistant (Claude Code, Codex CLI, OpenClaw) drive your Bitget account by writing bgc commands.
npm install -g @bitget-ai/bitget-agent-cliThe binary is bgc.
Why
npm install -gand notnpx?bgcis a persistent CLI — your AI assistant calls it dozens of times per session, so you want it on$PATHwith zero per-call overhead. The other Bitget AI packages (@bitget-ai/bitget-agent-skill,@bitget-ai/bitget-signal,@bitget-ai/bitget-agent-mcp,@bitget-ai/bitget-agent-installer) are one-shot or subprocess-launched, so they usenpx.
Prerequisites: Node.js ≥ 20. A Bitget API key, secret, and passphrase (create one).
Quick start
export BITGET_API_KEY=...
export BITGET_SECRET_KEY=...
export BITGET_PASSPHRASE=...
# Public market data — no auth needed
bgc spot spot_get_ticker --symbol BTCUSDT
# Authenticated read
bgc account account_get_balance
# Authenticated write — [CAUTION] real order
bgc spot spot_place_order --symbol BTCUSDT --side buy --orderType market --size 10
# Pretty-print JSON for human eyes
bgc --pretty futures futures_get_positionsUsage
Usage: bgc <module> <tool> [--param value ...]
Modules: spot, futures, account, margin, copytrading, convert, earn, p2p, broker
Options:
--read-only Only allow read/query tools (writes are stripped at load time)
--paper-trading Use Bitget Demo Trading environment (requires Demo API Key)
--pretty Pretty-print JSON output
--help Show this help
--version Show version
Auth (environment variables, required for private endpoints):
BITGET_API_KEY, BITGET_SECRET_KEY, BITGET_PASSPHRASERun bgc --help for the full list at any time.
Why a shell CLI?
bgc exists so AI assistants that already live in your shell — Claude Code, Codex CLI, OpenClaw — can drive Bitget without any extra integration wiring. The LLM writes a bgc ... command, the shell runs it, the JSON comes back. No MCP host, no plugin, no proxy.
If your assistant speaks MCP instead (Claude Desktop, Cursor, Continue, ChatGPT Desktop, Windsurf), use @bitget-ai/bitget-agent-mcp — same 59 tools, MCP-shaped.
If you want Claude Code / Codex / OpenClaw to know when and how to use bgc semantically (without you teaching it each command in chat), install @bitget-ai/bitget-agent-skill on top.
Demo Trading (paper trading)
bgc supports Bitget's Demo (paper-trading) environment. Use a Bitget Demo API Key for BITGET_API_KEY and friends, then add --paper-trading:
bgc --paper-trading spot spot_place_order \
--symbol BTCUSDT --side buy --orderType market --size 10Recommended for any first-time setup or when an AI is making decisions on your behalf.
Read-only mode
For maximum safety when handing the CLI to an AI, run with --read-only:
bgc --read-only spot spot_get_ticker --symbol BTCUSDT
# OK
bgc --read-only spot spot_place_order --symbol BTCUSDT --side buy ...
# Error: spot_place_order is unavailable in --read-only modeWrite tools are stripped from the registry before the call ever leaves the process — there is no way for the AI to invoke them.
Modules at a glance
| Module | Tools | Default | Requires API key |
|---|:---:|:---:|:---:|
| spot | 13 | ✅ | partial (writes only) |
| futures | 15 | ✅ | partial |
| account | 8 | ✅ | yes |
| margin | 7 | — | yes |
| copytrading | 5 | — | yes |
| convert | 3 | — | yes |
| earn | 3 | — | yes |
| p2p | 2 | — | yes |
| broker | 3 | — | yes |
The full tool catalog with every parameter lives at agent-hub/docs/tools-reference.md.
Pair with the skill for natural-language trading
Once bgc is on your $PATH, install the Bitget Agent Skill so Claude Code / Codex / OpenClaw learns when to use it:
npx @bitget-ai/bitget-agent-skillThen in your AI tool you can say things like "buy 0.1 BTC at market on Bitget" or "show my open futures positions" and it will compose the right bgc invocation.
How bgc is built
bgc is a thin shell wrapper around the Bitget Agent SDK:
bgc CLI
│
▼
@bitget-ai/bitget-agent-sdk (59 tools, REST client, signing, rate limiting)
│
▼
Bitget REST APIEvery command translates into a single signed HTTPS request. No telemetry, no proxy, no remote dependencies. Credentials live in your environment only.
Security
- Credentials are read from environment variables only — never logged, never written to disk.
- All authenticated requests are signed with HMAC-SHA256 in-process.
- Client-side rate limiting protects against accidental AI loops hitting Bitget's API limits.
- Write tools carry an explicit
[CAUTION]flag in their description so AI assistants surface them clearly before executing. --read-onlyand--paper-tradingprovide layered safety nets.
License
Part of the Bitget Agent Hub ecosystem · Trading Stack · Surface. Foundation: agent-sdk · Other surfaces: agent-mcp · agent-skill · Market signals: bitget-signal
