Skip to content

CLI flags

Full flag list. You can also run --help on each binary:

futu-opend --help
futu-mcp --help
futucli --help

futu-opend

Flag Default Description
--login-account <id> Futu account (one of account/pwd is required)
--login-pwd <pwd> Plain-text login password (v1.4.18+ prints deprecation WARN; prefer keychain)
--login-pwd-md5 <hex> MD5 (same argv exposure as plaintext; same WARN)
--login-pwd-file <path> v1.4.18+: read password from file (friendly for Docker secrets / systemd LoadCredential)
--login-region <gz/sh/hk> Backend region (v1.4+)
--config <path> TOML config file (v1.4.2+); fields mirror CLI flags, CLI wins
--cfg-file <path> XML config, compatible with C++ FutuOpenD.xml
--ip <addr> 0.0.0.0 Listen IP
--port <n> 11111 FTAPI TCP port
--rest-port <n> REST port (also serves /ws)
--rest-keys-file <path> REST Bearer Token keys.json
--grpc-port <n> gRPC port
--grpc-keys-file <path> gRPC Bearer Token keys.json
--websocket-port <n> Core WS port (Futu SDK)
--ws-keys-file <path> Core WS handshake auth keys.json (v1.0+)
--telnet-port <n> Admin telnet
--lang <chs/cht/en> chs UI language
--log-level <level> info trace/debug/info/warn/error
--json-log false stdout JSON logs
--audit-log <path> Audit JSONL file or directory (v1.4.87+ dir 0700 / file 0600 on Unix)
--tz <IANA> v1.4.87+: Timezone override (e.g. Asia/Hong_Kong / America/New_York), affects hours_window limit checks
--rsa-private-key <path> RSA private key PEM (for RSA-encrypted clients)
--platform <futunn/moomoo> futunn Account platform (v1.4.14+). futunn = Futubull (CN/HK), moomoo = US/SG/AU/JP/CA
--auth-server <url> derived from --platform Custom auth server URL; overrides --platform
--device-id <hex> auto-generated Device ID (16 hex chars, v1.4.16+). Overrides and updates ~/.futu-opend-rs/device-<hash>.dat
--reset-device false v1.4.17+: delete device + credentials files before starting, forces full first-login (SMS) on next run
--setup-only false v1.4.17+: finish auth + credentials cache, then exit without starting any server (systemd / Docker workflow)

futu-mcp

Flag Default Description
--gateway <addr> 127.0.0.1:11111 Gateway TCP address
--keys-file <path> keys.json (scope mode)
--api-key <plaintext> / env FUTU_MCP_API_KEY Plain-text key bound at startup
--enable-trading false (legacy) allow trade-write tools; ignored when keys-file is set
--allow-real-trading false (legacy) allow the real environment; ignored when keys-file is set
--audit-log <path> Audit JSONL
--http-listen <addr> HTTP transport (v1.0+); if unset, stdio is used
-v, --verbose false Debug logs

futucli

CLI vs REST/MCP flag naming (added in v1.4.84)

CLI historically used positional args (<OWNER> / <SYMBOLS> / <GROUP>) while REST/MCP users expect named flags (--code / --owner / --acc-id). As of v1.4.84, CLI adds REST/MCP-style aliases alongside the positional args (backward compatible).

Command Positional v1.4.84+ alias Example
option-chain <OWNER> --owner / --code futucli option-chain --owner US.AAPL --begin 2026-05-15 --end 2026-06-20
option-expiration-date <OWNER> --owner futucli option-expiration-date --owner HK.800000
suspend <SYMBOLS> --code / --symbols futucli suspend --code HK.00700 --begin 2026-04-01 --end 2026-04-15
margin-ratio <SYMBOLS> --code / --symbols futucli margin-ratio --code HK.00700 --market HK --acc-id <acc>
user-security <GROUP> --group futucli user-security --group MyList
plate-stocks <PLATE> --plate futucli plate-stocks --plate HK.BK1001
acc-cash-flow <ACC_ID> --acc-id futucli acc-cash-flow --acc-id <acc> --date 2026-04-15
plate-list --set <SET> --plate-type futucli plate-list -m HK --plate-type industry
daemon-status --rest-url <URL> --rest-port <PORT> futucli daemon-status --rest-port 22222

Either style works. Positionals are handy for quick shell use; --owner / --code flags feel natural when copy-pasting field names from REST/MCP docs.

Global

Flag Default Description
-g, --gateway <addr> / env FUTU_GATEWAY 127.0.0.1:11111 Gateway address
-o, --output <format> table table / json / jsonl (jsonl = one JSON per line, pipe-friendly)
-v, --verbose false Debug logs
--audit-log <path> Audit JSONL (v1.2+)

Subcommands

Command Description
ping Ping the gateway
quote <symbols...> Real-time quotes
snapshot <symbols...> Snapshot
kline <symbol> [--type day] [--count 100] Candles
orderbook <symbol> [--depth 10] Level-2 book
ticker <symbol> [--count 100] Tick-by-tick
rt <symbol> Intraday time-series
static <symbols...> Static security info
broker <symbol> Broker queue
plate-list <market> Plate/sector list
plate-stocks <plate-id> Stocks in a plate
sub <symbols...> -t <types> Subscribe (types: basic/orderbook/ticker/broker/rt/kline)
account List accounts
funds <acc-id> --market HK Funds
position <acc-id> --market HK Positions
order <acc-id> --market HK Orders of the day
deal <acc-id> --market HK Fills of the day
unlock-trade --env real [--otp <code>] [--security-firm <FIRM>] [--acc-ids <CSV>] Unlock trading (prompts for password); v1.4.31+ --otp for 2FA token; v1.4.33+ --security-firm restricts to one broker (1-7 digit / official name FutuHK..FutuJP / alias hk..jp), omit = all brokers; v1.4.34+ --acc-ids comma-separated acc_id list (intersects with --security-firm, resolves shadow sub-account blocking main account)
set-trade-pwd Save trade password into the OS keychain (read by futu-mcp's futu_unlock_trade tool; v1.4+)
clear-trade-pwd Remove trade password from the OS keychain (v1.4+)
set-login-pwd --account <id> v1.4.18+: store an account's login password in the OS keychain (futu-opend reads it automatically)
clear-login-pwd --account <id> v1.4.18+: remove the stored login password for an account
gen-key --id <n> --scopes <list> Generate a key
list-keys List all keys
revoke-key <id> Revoke a key
bind-key <id> --this-machine / --replace / --clear / --freeze Edit machine binding in place
machine-id [--for-key <id>] Show this machine's fingerprint
repl Interactive REPL (shared long connection + live push display)
history-orders / history-deals v1.4.25+: historical orders / fills query
max-qtys v1.4.25+: pre-trade max buy/sell qty
place-order / modify-order / cancel-order v1.4.25+: place / modify / cancel (real env requires --confirm, default env=simulate)
capital-flow <symbol> v1.4.26+: capital flow time series
capital-distribution <symbol> v1.4.26+: capital distribution (super/large/medium/small order flow)
market-state <symbols> v1.4.26+: market state (open / closed / lunch / after-hours)
owner-plate <symbols> v1.4.26+: plates containing the stock
option-chain <owner> --begin --end [--delta-min/--iv-max/...] v1.4.26+: option chain (call/put list by expiry; supports Greek server-side filters)
trading-days --market --begin --end v1.4.30+: trading day list
rehab <symbol> v1.4.30+: rehab factors (long-term K-line alignment / backtest)
suspend <symbols> --begin --end v1.4.30+: suspension days
user-security <group> v1.4.30+: securities in a watchlist group
user-security-groups [--group-type] v1.4.30+: list watchlist groups
warrant [--owner] [--num] v1.4.30+: warrant list (volume desc)
ipo-list --market <HK/US/CN> v1.4.30+: IPO list
future-info <symbols> v1.4.30+: futures contract info
stock-filter --market [--begin --num] v1.4.30+: stock scanner (minimal; advanced filters via REST)
cancel-all-order <acc-id> [--market] [--confirm] v1.4.30+: cancel all pending orders (real requires --confirm)
global-state v1.4.30+: gateway global state (market open/close, server version, login status)
user-info v1.4.30+: user info (nickname / permissions / quota)
delay-statistics v1.4.30+: delay-statistics summary
query-subscription [--all-conn] v1.4.30+: query current subscriptions
used-quota v1.4.110+: query current used subscription and historical K-line quota
unsubscribe [--symbols --sub-types] [--all] v1.4.30+: unsubscribe market data
history-kl-quota [--detail] v1.4.30+: historical K-line download quota
holding-change <symbol> --category v1.4.30+: shareholder changes (executive / institution / fund)
modify-user-security <group> --op <symbols> v1.4.30+: modify a watchlist group
code-change <symbols> v1.4.30+: security code changes / temporary tickers (HK for now)
set-price-reminder <symbol> --op v1.4.30+: set price reminder
price-reminder [--symbol/--market] v1.4.30+: query price reminders
option-expiration-date <owner> v1.4.30+: option expiry date list
sub-acc-push <acc-ids> v1.4.30+: subscribe order/deal push for accounts
acc-cash-flow <acc-id> --date / --date-range v1.4.30+: account cash flow statement (v1.4.32+ adds date range with 31-day cap, auto-skips weekends)
daemon-status [--rest-url --api-key] v1.4.32+: daemon health snapshot (login / broker channels / cipher readiness)
daemon-reload [--rest-url --api-key] v1.4.32+: drop cipher cache + v1.4.47 refresh on-disk credentials (remember-login)
daemon-shutdown [--rest-url --api-key] v1.4.32+: graceful daemon exit (within 1s); systemd / Docker decides restart