-
Notifications
You must be signed in to change notification settings - Fork 0
FAQ
Quick answers to common questions. For depth, each answer links to the canonical docs in the repository.
No — it's an unofficial, independent open-source client, not affiliated with or endorsed by Capital.com. It talks to Capital.com's public Open API using your own API key. It defaults to the demo environment and keeps trading disabled until you explicitly opt in, so you can explore risk-free. CFD trading carries a high risk of losing money; nothing here is financial advice. See the security & safety model.
pipx install capitalcom-cli # recommended
uv tool install capitalcom-cli # or with uv
brew install SimonTarara62/tap/capctl # macOS/Linux, Homebrew
pip install capitalcom-cli # into an active virtualenvMore options: installation channels.
In the Capital.com app: Settings → API integrations → generate an API key.
You'll set three values in a .env file: CAP_API_KEY, CAP_IDENTIFIER (your
login email), and CAP_API_PASSWORD. Full walkthrough:
getting started.
The most common cause: CAP_API_PASSWORD must be the custom password you set
when generating the API key — not your Capital.com account password. Also
check the key isn't expired/revoked and that a demo key is used with demo
(and a live key with --live). See
troubleshooting.
Trading is off by default. Enable it deliberately in .env:
CAP_ALLOW_TRADING=true and list the markets you allow in CAP_ALLOWED_EPICS
(e.g. GOLD,BTCUSD, or ALL). Every order is two-phase — trade preview-*
first, then trade execute-* with --yes. This friction is intentional. See
use cases.
capctl uses the demo environment by default (virtual money). Live requires
an explicit opt-in (a live API key and the --live flag). Keep everything on
demo until you know exactly what you're doing.
No. Your API key/password are never written to disk by capctl. It persists
only trade previews, the daily-order counter, and (by default) a short-lived
session token in ~/.config/capital-cli/state.json (mode 0600). Deleting that
file is safe. See
where is my state stored.
Capital.com limits how often you can create sessions. capctl caches the
short-lived session token by default (CAP_PERSIST_SESSION=true) so back-to-back
commands reuse one login — keep it enabled. Scripts firing many commands should
pause ~1s between them. Details:
troubleshooting.
Each failure class has its own exit code (2 = bad input, 3 = config, 4 = safety
policy, 5 = auth, 6 = local rate limit, 7 = broker/upstream, 8 = preview). Full
table: troubleshooting.
Every command also supports --json for machine-readable output.
capctl is the terminal/scripting surface. The same tested broker engine is also
importable as an async Python library (from capital_cli.sdk import CapitalComApp)
with a stable 0.x API — useful for dashboards, bots, or your own integrations.
See use as a library.
Yes. Every command emits JSON with --json and returns distinct exit codes, so
it drops cleanly into cron jobs, CI, and scripts. For programmatic use, prefer
the SDK over shelling out. See
scripting & automation.
Open an issue with the failing command, its output (it never contains your
secrets), and your OS/Python version. First-time contributors: see
CONTRIBUTING
and the good first issue label.
Unofficial project — not affiliated with, endorsed by, or sponsored by Capital.com. Nothing here is financial advice. Apache-2.0. · Repository · Issues
Docs (in repo)