Installation
AI Agent Setup
Run this once to configure QFEX CLI for agent workflows:qfex agents init updates Claude Code and Codex so qfex can be used without repeated permission prompts. The global setup writes to ~/.claude/ and ~/.codex/. The --local mode writes CLAUDE.md and AGENTS.md into the current project, which is useful when you want project-specific agent instructions.
Quick Start
Why Use The CLI
- Built for both humans and AI agents.
- All command output is JSON, which makes it easy to pipe into
jqor parse in code. - The daemon keeps persistent connections to market data and trade WebSockets, so your scripts do not need to manage subscriptions, authentication, or socket lifecycle directly.
- Market data commands work without credentials.
- Trading commands use the same API keys described in the API introduction.
Agentic Trading Workflow
For an automated or agentic trading setup, the normal flow is:- Run
qfex agents initonce so your agent can callqfexcleanly. - Start the daemon with
qfex daemon start. - Use market data commands immediately, or generate API keys and run
qfex loginfor trading. - Run
qfex daemon restartafter login so credentials are applied. - Confirm readiness with
qfex daemon status. - Issue market data, order, position, and account commands as needed.
Common Commands
Environments
The CLI supports both QFEX production and UAT environments:prod: Connects toqfex.comwith real funds.uat: Connects toqfex.iofor testing strategies and integrations without real funds.
qfex login or by editing ~/.config/qfex/config.yaml, then restarting the daemon.