README
FTX CLI">
đą The power of FTX meets the power of the command line.
Contents
Why FTX CLI?
đ Free: no ads, no trackers, no paid licences, no subscriptions, no added fees.
đ Open source: 'not your (API) keys, not your coins'.
đ Self-hosted: no intermediary servers and no extra downtime; you're in control.
⥠Fast: place complex orders in the heat of the moment.
đ Powerful: try scheduled commands, new advanced orders, auto-compounding lending, and more.
đ¨ Customisable: configure the UI and collate exchange data to create custom interfaces.
đ¨âđģ Extensible: combine input, output, or behaviour with other CLIs or custom scripts.
đ Global: FTX, with or without the US.
đ¤ Multiple accounts: switch account and subaccount on the fly.
Installation
Node.js v14.13.0+ is required. Run the following command to display your installed Node.js version:
node --version
If you are running Node.js v14.13.0 or later, run the following command to install FTX CLI:
npm install -g ftx-cli
If you are running an older version of Node.js, or don't have it installed, please follow the instructions for your operating system.
Once you have installed FTX CLI, run the following command to verify:
ftx --version
Linux and macOS
âšī¸ Please follow these instructions if you are running any Unix-like environment (e.g. Linux, macOS, Windows Subsystem for Linux, Git Bash, Cygwin).
Run the following command block to install nvm, latest Node.js LTS, and FTX CLI:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash &&
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" &&
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" &&
nvm install --lts &&
npm install -g ftx-cli
Windows
Download and follow the latest Node.js LTS Windows installer and then run the following command to install FTX CLI:
npm install -g ftx-cli
Alternative methods
Advanced users may want to try one of the alternative installation methods.
Getting started
âšī¸ Planning on using FTX CLI purely for displaying exchange data? You can ignore this section for now; API credentials (key and secret) are only required for authenticated, account-related parts of the platform, such as trading and lending.
Create API credentials
- If you don't have an FTX account yet, create one (click here for FTX US)
- Select 'Main Account' (account-wide) or the specific subaccount that FTX CLI can access:
- Subaccounts â 'CREATE SUBACCOUNT' or 'Select Account'
- If you want to margin trade or lend, make sure to enable spot margin trading:
- Settings â Margin â 'ENABLE SPOT MARGIN TRADING'
- Create your API key and secret:
- Settings â Api â 'CREATE API KEY'
Save API credentials
â ī¸ If your machine is shared or unsecure, it is recommended that you save your API credentials elsewhere instead of using the
login
command.âšī¸ API credentials and subaccount names are case-sensitive, as they are used to authenticate with the FTX platform. API credentials can be copy and pasted after you create them, and subaccount names from the subaccounts page.
# Account-wide access (requires API credentials not linked to a specific subaccount).
ftx login --key YOUR_API_KEY --secret YOUR_API_SECRET
# Subaccount-only access.
ftx login --key YOUR_API_KEY --secret YOUR_API_SECRET --subaccount YOUR_SUBACCOUNT
Secure API credentials
Here are some best practices for keeping your API credentials secure:
- Edit API key permissions to the minimum required for FTX CLI to function properly:
- Disable 'Read-only'
- Disable 'Withdrawals enabled'
- Disable 'Internal transfers enabled'
- If you know the static IP address(es) you will be using, you can further improve security by whitelisting them:
- 'WHITELIST IP'
Usage
Global options
You can include these options with any command to modify its behaviour.
-v, --version Output the version number.
-h, --help Display help for command.
-e, --exchange (ftx | ftx-us) FTX exchange platform [default: ftx].
-k, --key <key> FTX API key.
-x, --secret <secret> FTX API secret.
-a, --subaccount (<subaccount> | main) FTX subaccount name [default: main].
--schedule <schedule> Schedule command to run at a future date and time or periodically, according to a given interval, until manually aborted.
--[no-]colour Toggle coloured output [default: enabled].
--[no-]update-notifications Toggle update notifications. When enabled and an update is available, a notification will appear after command execution at most once a day [default: enabled].
âšī¸ Inline options take priority over saved credentials (via
login
) and configuration (viaconfig
), meaning you can set your defaults and then override them on a per-command basis where necessary.
Topics
Visit the documentation for a topic to learn more about related commands:
âšī¸ You can utilise subaccounts to isolate margin and manage risk.
Guides
- Power users: features aimed at increasing efficiency.
- Scheduled commands: for when now is not the time.
FAQ
How are my API credentials used?
See for yourself! TL;DR: FTX CLI only communicates with FTX or FTX US, and your API credentials will be stored on your machine if you decide to login
.
Why did I get rate-limited?
It is possible to hit the rate limits set out by FTX if you attempt to execute large amounts of commands in a short period of time. Slow down!
What's the screenshot setup?
We use a custom theme on Carbon to replicate our favourite terminal: Hyper with Fira Code (font ligatures enabled).
Support the project
Contribute
Please feel free to create a GitHub issue or join our Discord server to report bugs, suggest features, or ask questions.
Share
Share the project with your friends and followers (here's a free tweet!).
Referral
Create an FTX or FTX US account using our referral links â as a bonus, you will receive 5% off your trading fees.
Donate
BTC: bc1q5f323q4399s3plle9t33j7czv5knj90ujyg3ys
ETH/ERC-20: 0x07324D924CA0C9Fbe933AE7E958e47Dd7d040C4d
SOL/SPL: 32Jwe936XEN5NEvbWusapYeqwFcuPQkSgCuzduQEkfCV
Contact
Disclaimer
FTX CLI is not affiliated with FTX. Your account(s) and funds are your responsibility. Trading involves a high degree of risk and is not suitable for all persons. FTX CLI is an FTX External Referral Program; we may receive a fraction of the trading fees that are generated by the software (this does not affect the trading fees that you pay).