# Bittensor CLI

The Bittensor command line interface (btcli) ships in the bittensor Python package, built from the subtensor repository.

_Source: https://beta.taostats.io/docs/concepts/command-line-tool_

_Last reviewed: 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](https://github.com/RaoFoundation/subtensor/tree/main/sdk/python), 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 bittensor
```

This 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 --help` lists them by topic.
* `btcli tx <name>` sends any transaction. `btcli tx --help` lists them by pallet. Every `tx` command accepts `--dry-run`, `--yes` and `--proxy-for`.
* Workflow groups wrap common tasks: `wallet`, `stake`, `subnets`, `weights`, `axon`, `proxy`, `multisig`, `crowd`, `lock`, `timelock` and `config`.
* `btcli evm` covers 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 get
```

A 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](https://bittensor.com/docs/cli).

> [!NOTE]
> Previously `btcli` was a separate package (`bittensor-cli`) in its own repository. That package is superseded by `bittensor`.
