Fast, safe Rust toolkit for the Bittensor network. Wallets, staking, transfers, subnets, weights, metagraph queries, Dynamic TAO, monitoring, and more.
cargo install --git https://github.com/unconst/agcli# Check balance
agcli balance --address 5Gx...
# List subnets as JSON
agcli --output json subnet list
# Stake TAO with slippage protection
agcli stake add --amount 10 --netuid 1 --max-slippage 2.0 --password p --yes
# Atomic commit-reveal weights
agcli weights commit-reveal --netuid 1 --weights "0:100,1:200" --wait
# Live subnet monitoring (JSON streaming)
agcli subnet monitor --netuid 97 --json
# Local development β zero cost, instant feedback
agcli localnet scaffoldEvery command supports --output json|csv, --yes (skip prompts), --batch (hard-error mode), and --dry-run (preview). Full non-interactive operation for AI agents.
| Resource | Description |
|---|---|
| docs/why-agcli.md | Why agcli? Comparison with btcli and the Bittensor Python SDK |
| docs/llm.txt | Agent/LLM reference β quick-ref card + full command reference |
| docs/commands/ | Per-command deep dives β on-chain behavior, pallet refs, storage keys, events, errors |
| docs/tutorials/ | Step-by-step guides: getting started, staking, validator, subnet builder, agent automation |
| docs/faq.md | Beyond agcli β miners, Yuma math, picking subnets, validatorβminer protocols, subnet codebases |
| docs/hyperparameters.md | Complete reference for all ~32 sudo-settable subnet hyperparameters β what each does, defaults, interactions |
| docs/philosophy.md | Subnet design philosophy, incentive patterns, trust model |
[dependencies]
agcli = { git = "https://github.com/unconst/agcli", default-features = false, features = ["sdk-only"] }use agcli::{Client, Wallet, Balance};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let client = Client::connect("wss://entrypoint-finney.opentensor.ai:443").await?;
let balance = client.get_balance_ss58("5Gx...").await?;
let subnets = client.get_all_subnets().await?;
let metagraph = client.get_metagraph(1.into()).await?;
Ok(())
}agcli/
βββ src/
β βββ main.rs # CLI entry point
β βββ lib.rs # SDK re-exports (Client, Wallet, Balance, Config)
β βββ config.rs # Persistent config (~/.agcli/config.toml)
β βββ error.rs # Error classification + exit codes
β βββ events.rs # Real-time block/event subscription
β βββ live.rs # Live polling with delta tracking
β βββ chain/
β β βββ mod.rs # Client: connection, retry, 40+ queries + extrinsics
β β βββ queries.rs # Chain query methods
β β βββ extrinsics.rs # Transaction builders
β β βββ rpc_types.rs # Type conversions
β βββ cli/
β β βββ mod.rs # Clap parser: 20 command groups, 90+ subcommands
β β βββ commands.rs # Main dispatcher
β β βββ helpers.rs # Shared CLI helpers
β β βββ subnet_cmds.rs # Subnet operations
β β βββ view_cmds.rs # View/query handlers
β β βββ stake_cmds.rs # Staking operations
β β βββ weights_cmds.rs # Weight setting + commit-reveal
β β βββ wallet_cmds.rs # Wallet management
β β βββ block_cmds.rs # Block explorer
β β βββ network_cmds.rs # Network queries + commitment commands
β β βββ localnet_cmds.rs # Local chain lifecycle + scaffold
β β βββ admin_cmds.rs # AdminUtils sudo hyperparam setters
β β βββ system_cmds.rs # Config, proxy, delegate, identity
β βββ localnet.rs # SDK: Docker chain start/stop/status/reset/logs
β βββ admin.rs # SDK: 13 AdminUtils functions + raw_admin_call
β βββ scaffold.rs # SDK: Declarative test environment orchestration
β βββ wallet/ # Key management (Python wallet compat)
β βββ types/ # Balance, NeuronInfo, SubnetInfo, etc.
β βββ queries/ # Cache layer (Moka + disk)
β βββ extrinsics/ # Weight hashing, MEV shield
β βββ utils/ # Explain, format, POW solver
βββ docs/
β βββ llm.txt # Agent-optimized reference
β βββ commands/ # 24 per-command docs
β βββ tutorials/ # 5 step-by-step guides
βββ examples/
β βββ scaffold.toml # Example scaffold configuration
βββ tests/ # 7 integration test files
βββ build.rs # Compile-time chain metadata fetch
βββ Cargo.toml
Requires Rust 1.75+ and network access (fetches chain metadata at build time):
git clone https://github.com/unconst/agcli && cd agcli && cargo build --releaseMIT