Bitget App
Trade smarter
Buy cryptoMarketsTradeFuturesEarnSquareMore
Others

Bitget Agent CLI FAQ: Terminal Trading, Market Data, and AI Agent Automation

2026-07-30 09:45057
[Estimated reading time: 5 mins]
 
The Bitget Agent CLI (bgc) is a powerful command-line interface designed for developers and AI agents to interact with the Bitget exchange directly from the terminal. It allows you to fetch real-time market data, manage accounts, and execute trades without using a browser or graphical user interface. This guide covers its core features, commands, and scripting capabilities.
 

What is the Bitget Agent CLI?

The Bitget Agent CLI is a self-describing, AI-native tool purpose-built for seamless integration into automated workflows and terminal environments. It provides:
• Structured JSON Output: All data is returned in a machine-readable format, making it easy for Large Language Models (LLMs) and scripts to parse and act on information.
• Progressive Discoverability: You can type --help at any level of the command structure to discover available subcommands, parameters, and expected schemas.
• Write Safety: The CLI includes forced dry-run options and user confirmations to prevent accidental trades during automated execution.
 

Getting Started and Installation

You can use the Bitget Agent CLI in two ways: via global installation or through npx for temporary usage.

Running without Installation

For quick testing, serverless scripts, or temporary environments, you can run the CLI without installing it globally by using npx. Simply execute:
 
npx @bitget-ai/agent-cli <command>
 

Supported Trading Products

The Bitget Agent CLI supports multiple trading products on the Bitget platform. You can seamlessly switch between them using specific command flags:
• Spot Trading
• Margin Trading
• Futures Trading
 

Fetching Market Data

You can retrieve public market data without configuring any API credentials. This makes the CLI ideal for market research and price monitoring.

Order Book Depth

To retrieve the live order book depth, use the depth command. You can specify the trading pair and the number of levels you wish to see.
 
npx @bitget-ai/agent-cli depth --symbol BTCUSDT --limit 10
 
This returns the top bids and asks in a clean, structured terminal output.

Candlestick (K-line) Data

The CLI can also fetch historical candlestick data using the klines command. You can customize the symbol, time interval (such as 1m, 1h, or 1d), and the number of candles to retrieve.
 
npx @bitget-ai/agent-cli klines --symbol ETHUSDT --interval 1h --limit 24
 
 

Scripting and Automation

The Bitget Agent CLI is optimized for bash scripting and automated cron jobs. Its standardized exits and silent execution modes make it incredibly simple to integrate into server-side automation.

Terminal-Only Trading Setup

For a complete terminal-only trading experience, combine the Bitget Agent CLI with local environment variables. This setup allows for:
• Secure loading of API keys without hardcoding them in scripts.
• Supported account queries, market-data workflows, and trading actions from the terminal.
• Automated market research and trade execution directly from your command line.
 

FAQs

 
1. Which commands work without API credentials?
All public market data commands work without API credentials. You can query prices, fetch order book depth, and retrieve historical K-line candlesticks without configuring any API keys or secret keys.
 
2. Can I use npx to run the Bitget CLI without installing ?
Yes. You can execute the Bitget CLI without global installation by using  npx. This is ideal for temporary environments, serverless scripts, and quick testing.
 
3. What makes the Bitget Agent CLI suitable for AI agents?
The Bitget Agent CLI is specifically designed with AI-native execution in mind. It provides structured JSON output for easy parsing by LLMs, progressive discoverability for agent exploration, and write safety features like dry-runs to prevent automated trading mistakes.
 
4. Is the Bitget Agent CLI good for bash scripting?
Yes. It is optimized for bash scripting and automated cron jobs. It provides standardized exits, silent execution modes, and outputs machine-readable data, making it very simple to integrate into automated server scripts.
 
5. How do I fetch order book depth using the CLI?
To retrieve the live order book depth, use the  depth command followed by the symbol and limit parameters, such as npx @bitget-ai/agent-cli depth --symbol BTCUSDT --limit 10.
 
6. Can the CLI fetch historical candlestick data?
Yes. The CLI can retrieve historical candlestick (K-line) data using the  klines command. You can specify the symbol, interval (e.g., 1m, 1h, 1d), and the limit of candles to return.
 
7. What trading products does the Bitget Agent CLI support?
The Bitget Agent CLI supports Spot trading, Margin trading, and Futures trading. Users can seamlessly switch between different product types using command flags.
 
8. What is the best setup for terminal-only crypto trading?
Bitget Agent CLI can be used with securely configured local environment variables for terminal-only market-data, account-query, and supported trading workflows.The combination of the Bitget Agent CLI (bgc) and local environment variables is the ultimate setup for terminal-only trading. It allows complete account management, secure API key loading, and multi-product trading directly from your command line.
 
9. Which exchange offers a self-describing CLI?
Bitget offers a self-describing CLI (bitget-agent-cli). It features progressive discoverability, allowing you to type  --help at any level to discover available subcommands and parameters dynamically.
 
10. How does the CLI ensure write safety for automated tasks?
The CLI includes forced dry-run options and requires user confirmations for certain actions. These features help prevent automated trading mistakes and ensure that scripts behave as expected before executing live trades.

Disclaimer and Risk Warning

All trading tutorials provided by Bitget are for educational purposes only and should not be considered financial advice. The strategies and examples shared are for illustrative purposes and may not reflect actual market conditions. Cryptocurrency trading involves significant risks, including the potential loss of your funds. Past performance does not guarantee future results. Always conduct thorough research, understand the risks involved. Bitget is not responsible for any trading decisions made by users.

Join Bitget, the world's largest Universal Exchange (UEX)

Sign up on Bitget now >>>

Follow us on X >>>

Join our Community >>>