Python CLI + SDK wrapper for agcli — Bittensor staking, transfers, wallets, weights, subnets, and more
Project description
taocli
Python CLI + SDK wrapper for agcli — Bittensor staking, transfers, wallets, weights, subnets, and more.
Current release status
taocliis the CLI command and Python import name.tao-cliis the intended PyPI distribution name.- The README CI badge tracks lint/test/coverage only; PyPI publishing now runs in a separate GitHub Actions workflow.
- The last failed GitHub publish attempted the old
taocli0.6.5package name, which PyPI rejected as too similar to an existing project. - The intended public install command is
uv pip install tao-clionce the refreshed wheels are live from the separate publish workflow. - Once those platform wheels are published, supported Linux/macOS installs should work without a separate
agclionPATHbecause the bundled-binary path is already implemented in code.
Install
Planned PyPI install
uv pip install tao-cli
That installs the package, but the command you run stays:
taocli --help
Do not use uv pip install taocli; the published distribution name is tao-cli.
Current pre-release/source install
Until tao-cli wheels are live on PyPI, install from a local checkout:
git clone https://github.com/unarbos/taocli
cd taocli
uv pip install -e .
Source installs do not bundle agcli. For now, source installs still require agcli on PATH or an explicit --agcli-binary / TAOCLI_AGCLI_BINARY override.
When published as supported Linux/macOS wheels, tao-cli will use the bundled agcli binary automatically.
Agent/discovery metadata is also shipped in llms.txt.
CLI
taocli mirrors agcli 1:1 — same commands, same flags, same output:
taocli wallet list
taocli balance --address 5G...
taocli stake add --amount 10 --netuid 1
taocli subnet list
taocli view portfolio
taocli transfer --dest 5G... --amount 1.0
SDK
from taocli import Client
c = Client(network="finney")
# Balance
c.balance(address="5G...")
# Wallet
c.wallet.list()
c.wallet.create()
# Staking
c.stake.add(10.0, netuid=1)
c.stake.list()
# Transfer
c.transfer.transfer("5G...", 1.0)
# Subnet
c.subnet.list()
c.subnet.show(1)
# Weights
c.weights.set(1, {0: 100, 1: 200}, version_key=7)
workflow = c.weights.workflow_help(1, {0: 100, 1: 200}, salt="round-42", version_key=7, wait=True)
print(workflow["commit_reveal"])
print(workflow["reveal"])
print(c.weights.troubleshoot_help(1, "IncorrectCommitRevealVersion", {0: 100, 1: 200}, salt="round-42", version_key=7))
# View
c.view.portfolio()
c.view.network()
c.weights accepts the native agcli CSV form ("0:100,1:200") plus agent-friendlier mappings, (uid, weight) pairs, JSON strings, - for stdin, and @file.json inputs. Use workflow_help(...) when you want copy-pasteable set, commit-reveal, commit, reveal, and status commands for an operator runbook or agent handoff. For atomic commit-reveal flows, prefer commit_reveal_runbook_help(...) or create_commit_reveal_state_help(...) first so the original weights, salt, derived hash, and reusable reveal command can be saved and reused if the reveal step stalls.
save_commit_reveal_state_help(...), load_commit_reveal_state_help(...), recover_reveal_from_state_help(...), and troubleshoot_unrevealed_commit_help(...) are the recovery path: persist a JSON state record before or during commit, then reload it later to reveal the exact same commit manually instead of losing the original reveal inputs.
operator_note_for_atomic_commit_reveal_help(...) wraps that runbook in operator-facing guidance for handoff situations where another person or agent may need to finish the reveal later.
Weights SDK quick reference
from taocli import Client
c = Client(network="local")
# Direct set
c.weights.set(1, {0: 100, 1: 200}, version_key=7)
# Auto commit + reveal
c.weights.commit_reveal(1, {0: 100, 1: 200}, version_key=7, wait=True)
# Manual workflow hints for operator/agent guidance
workflow = c.weights.workflow_help(1, {0: 100, 1: 200}, salt="round-42", version_key=7, wait=True)
# workflow keys: normalized_weights, status, set, commit_reveal, commit, reveal
# Compact troubleshooting runbook for common failures
troubleshoot = c.weights.troubleshoot_help(
1,
"IncorrectCommitRevealVersion",
{0: 100, 1: 200},
salt="round-42",
version_key=7,
)
# troubleshoot keys: error, likely_cause, next_step, status, normalized_weights, set, commit, reveal, commit_reveal
# Mechanism-specific helper runbook
mechanism = c.weights.mechanism_workflow_help(
1,
4,
{0: 100, 1: 200},
salt="round-42",
hash_value="11" * 32,
version_key=7,
)
# mechanism keys: normalized_weights, status, set_mechanism, reveal_mechanism, optional commit_mechanism
# Mechanism troubleshooting / next-step guidance
# hash_value is optional here; taocli can derive it from weights + salt.
print(
c.weights.troubleshoot_mechanism_help(
1,
4,
"RevealTooEarly",
{0: 100, 1: 200},
salt="round-42",
version_key=7,
)
)
# Timelocked helper runbook
print(c.weights.timelocked_workflow_help(1, {0: 100, 1: 200}, 42, salt="round-42", version_key=7))
# timelocked keys: normalized_weights, status, set, commit_timelocked
# Timelocked troubleshooting / next-step guidance
print(c.weights.next_timelocked_action(1, {0: 100, 1: 200}, round=42, salt="round-42"))
# Compact live diagnose helpers
print(c.weights.diagnose_mechanism(1, 4, "RevealTooEarly", {0: 100, 1: 200}, salt="round-42", version_key=7))
print(c.weights.diagnose_timelocked(1, "ExpiredWeightCommit", {0: 100, 1: 200}, round=42, salt="round-42"))
For commit-reveal flows, check subnet status and hyperparameters first: validator permit, whether commit-reveal is enabled, the required version_key, and any rate limits.
Mechanism-specific and timelocked helpers use the same normalized weights parser, so agents can reuse the exact same payload across direct set, mechanism, and timelocked flows without hand-reformatting.
When weights status output is available, the mechanism and timelocked helpers can now turn it into a recommended next command (REVEAL, RECOMMIT, WAIT, or direct SET) instead of only showing static runbooks.
Common troubleshooting shortcuts:
NeuronNoValidatorPermit: the hotkey is not currently allowed to set weights on that subnet.IncorrectCommitRevealVersion: the subnet expects a differentversion_key; inspect subnet hyperparameters before retrying.RevealTooEarly/ExpiredWeightCommit: the commit-reveal timing window is wrong; checkc.weights.status(netuid)orc.weights.workflow_help(...)first and retry in the correct window.troubleshoot_help(...)turns a common runtime error plus optional weights inputs into a compact runbook with likely cause, next step, and normalized retry commands.workflow_help(...)is the fastest way to hand an operator or another agent a normalizedstatus,set,commit-reveal,commit, andrevealrunbook for the same weights payload.
SDK Modules
All modules are accessible as attributes on the Client instance.
| Module | Attribute | Description |
|---|---|---|
| Balance | c.balance() |
Query account balances |
| Wallet | c.wallet |
Create, list, import, sign, verify wallets |
| Stake | c.stake |
Add, remove, move, swap stake; limit orders; auto-compound |
| Transfer | c.transfer |
Send TAO between accounts |
| Subnet | c.subnet |
List, register, metagraph, health, cache, dissolve |
| Weights | c.weights |
Set, commit, reveal, commit-reveal weights |
| View | c.view |
Portfolio, network, dynamic, neuron, validators, analytics |
| Delegate | c.delegate |
Show, list delegates; adjust take |
| Root | c.root |
Root network registration and weights |
| Identity | c.identity |
Set, get, remove on-chain + subnet identity |
| Proxy | c.proxy |
Add, remove, pure, announced proxy accounts |
| Serve | c.serve |
Serve axon/prometheus endpoints |
| Commitment | c.commitment |
Set, get, list miner commitments |
| Config | c.config |
Get, set, list, reset config; cache management |
| Swap | c.swap |
Hotkey swap, coldkey swap, EVM key association |
| Admin | c.admin |
Sudo operations — set hyperparameters |
| Audit | c.audit |
Security audit of account exposure |
| Explain | c.explain |
Built-in Bittensor concept reference |
| Block | c.block |
Query block info, latest, ranges |
| Diff | c.diff |
Compare state between blocks |
| Multisig | c.multisig |
Submit, approve, execute threshold calls |
| Crowdloan | c.crowdloan |
Create, contribute, manage crowdloans |
| Liquidity | c.liquidity |
Add, remove, modify AMM positions |
| Subscribe | c.subscribe |
Subscribe to blocks and events |
| Scheduler | c.scheduler |
Schedule on-chain calls |
| Preimage | c.preimage |
Store governance preimages |
| Contracts | c.contracts |
Upload, instantiate, call WASM contracts |
| EVM | c.evm |
Call EVM contracts, withdraw to Substrate |
| SafeMode | c.safe_mode |
Enter/exit safe mode |
| Drand | c.drand |
Write drand randomness pulses |
| Localnet | c.localnet |
Start, stop, reset local dev chain |
| Batch | c.batch |
Run batch extrinsics from JSON |
| Utils | c.utils |
Convert denominations, measure latency |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tao_cli-0.6.6.tar.gz.
File metadata
- Download URL: tao_cli-0.6.6.tar.gz
- Upload date:
- Size: 70.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03219c56dae3a74e067e09fdd81cc55e27f20bfa4bec6d653b3ba87288f63b32
|
|
| MD5 |
3a172072ef7585a293e856583b3aa0e6
|
|
| BLAKE2b-256 |
f61586ffce211d995a143dda78bbb57f49ae552e0bed409dfc12f3964d63f3f9
|
File details
Details for the file tao_cli-0.6.6-py3-none-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: tao_cli-0.6.6-py3-none-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: Python 3, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5c40ae694fed3642dc072f3b31721bf0e139d1e00163b8ee9ad5368d1013c61
|
|
| MD5 |
d573eaba217f41fe8e5afc37937a3e5e
|
|
| BLAKE2b-256 |
fd4afa40eea2eb78206d363bf7a0bf04664e6d6c4eb338465dfd2f127e386fc5
|
File details
Details for the file tao_cli-0.6.6-py3-none-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: tao_cli-0.6.6-py3-none-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 5.6 MB
- Tags: Python 3, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01632e8f8f9759e5db7502eed0101a3a1df97e55a9d04a94dcbd3889d4d978a3
|
|
| MD5 |
42871299a129bf8a6d25b7e67f15557b
|
|
| BLAKE2b-256 |
8b875179b3809b35e3406ee1aff2e54b5fbb48c0b61231a3a0e51c5fff863ce3
|
File details
Details for the file tao_cli-0.6.6-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: tao_cli-0.6.6-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.2 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c95680f2277ae3a4b74757874e9f453cef71e1abc6352fba9af194788a534f2
|
|
| MD5 |
152c9311a3e5ebb1a534662fab401afb
|
|
| BLAKE2b-256 |
a4cc3e4752726ca2fd0d69459f70ce83dd4b553afcdba92844980e131228e886
|
File details
Details for the file tao_cli-0.6.6-py3-none-macosx_10_13_x86_64.whl.
File metadata
- Download URL: tao_cli-0.6.6-py3-none-macosx_10_13_x86_64.whl
- Upload date:
- Size: 5.9 MB
- Tags: Python 3, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02cfbfef8bd0ae54a818a6ae321ee2763b9129e6a2d850c8d93486b5bc55dd5f
|
|
| MD5 |
ec41ef1d3fcc0577d62176301e3aa282
|
|
| BLAKE2b-256 |
b36e768bcbfefad4661591ea2b78ca66dc26c9f1cddd914bd59282043d9edb8e
|