Documentation / Concepts Bittensor
Bittensor CLI
The Bittensor command line interface (btcli) ships in the bittensor Python package, built from the subtensor repository.
Dernière vérification le 2026-10-05
The Bittensor command line interface (btcli) lets you use the Bittensor chain from a terminal: create wallets, stake, register, set weights and send any transaction.
btcli is part of the bittensor Python package. One install gives you both the Python SDK (import bittensor) and the btcli command. The SDK and CLI live in the subtensor repository, alongside the chain code. Both are generated from the chain's metadata, so their commands match the live runtime.
Installation
Requires Python 3.10–3.14.
From pip
bash
pip install bittensorThis installs the btcli command and the bittensor Python package together.
From source
bash
git clone https://github.com/RaoFoundation/subtensor.git
cd subtensor/sdk/python
uv venv && source .venv/bin/activate
uv pip install -e .Using the CLI
btcli --help lists the command groups, and --help works on every command.
btcli query <name>reads any value from the chain.btcli query --helplists them by topic.btcli tx <name>sends any transaction.btcli tx --helplists them by pallet. Everytxcommand accepts--dry-run,--yesand--proxy-for.- Workflow groups wrap common tasks:
wallet,stake,subnets,weights,axon,proxy,multisig,crowd,lock,timelockandconfig. btcli evmcovers EVM keys, funding, precompiles and contracts.
If you leave out a required option, btcli asks for it, shows what it is about to do and waits for you to confirm. Add --dry-run to preview a transaction without sending it.
The short aliases from older versions still work, for example w, st and s.
Configuring the CLI
Set your network and wallet once:
bash
btcli config set network finney
btcli config set wallet my_coldkey
btcli config getA flag on the command overrides an environment variable, which overrides the config file.
| Option | Environment variable | Meaning |
|---|---|---|
--network, -n | BT_NETWORK | finney, test, local, or a ws:// endpoint |
--wallet, -w | BT_WALLET | Coldkey wallet name |
--wallet-hotkey, -H | BT_WALLET_HOTKEY | Hotkey name inside the wallet |
--wallet-path | BT_WALLET_PATH | Wallet directory |
--json | Machine-readable output | |
--yes, -y | Skip confirmation prompts |
The full CLI reference is at bittensor.com/docs/cli.