Command-line interface for TAO Name Service - Similar to btcli for Bittensor
Project description
TNS CLI Tool
Command-line interface for TAO Name Service - production-ready CLI similar to btcli.
Quick Installation (Recommended)
Install from PyPI (Once Published)
# Install globally - just like 'pip install btcli' for Bittensor
pip install tnscli
# Verify installation
tns --version
tns --help
Install from Source
# Clone or download the repository
cd tns/cli
# Install globally (creates 'tns' command)
pip install .
# Or install in editable mode for development
pip install -e .
After installation, the tns command will be available from any directory:
tns --help
tns stats
tns check mydomain
Alternative: Local Installation
If you prefer to run locally without system-wide installation:
# 1. Run the automated install script
./install.sh
# 2. Activate the virtual environment
source venv/bin/activate
# 3. Use the CLI
./tns.py --help
Commands
Query Commands (No Wallet Required)
Check Domain Availability:
python tns.py check alice
Resolve Domain:
python tns.py resolve alice.tao
Search Domains:
python tns.py search alice --limit 20
Lookup by Address:
python tns.py lookup 5F3sa2TJAbpD9LgKr8WZitnWjExqWXqUhPnK8Mv5S3FQGn8Y
python tns.py lookup ADDRESS --type coldkey
python tns.py lookup ADDRESS --type hotkey
Platform Statistics:
python tns.py stats
Blockchain Commands (Require Wallet)
Register Domain:
python tns.py register alice 5F3sa2TJAbpD9LgKr8WZitnWjExqWXqUhPnK8Mv5S3FQGn8Y
# You will be prompted for your mnemonic phrase
Link Hotkey:
python tns.py link alice 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
Transfer Domain:
python tns.py transfer alice 5F3sa2TJAbpD9LgKr8WZitnWjExqWXqUhPnK8Mv5S3FQGn8Y
Renew Domain:
python tns.py renew alice
Features
- Rich terminal output with colors and tables
- Interactive confirmations for blockchain transactions
- Secure mnemonic input (hidden)
- Error handling and validation
- Support for all TNS operations
Environment Variables
TNS_API_URL: TNS REST API endpointTNS_WS_URL: Subtensor WebSocket endpoint
Current configuration uses secure Cloudflare tunnel endpoints for production reliability.
Examples
Check if domain is available
$ python tns.py check alice
✓ alice.tao is AVAILABLE
Registration fee: 0.5 TAO
Resolve a domain
$ python tns.py resolve alice
┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Field ┃ Value ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Owner │ 5F3sa2TJAbpD9LgKr8WZitnWjExqWXqUhPnK8Mv5S3FQGn8Y │
│ Coldkey │ 5F3sa2TJAbpD9LgKr8WZitnWjExqWXqUhPnK8Mv5S3FQGn8Y │
│ Hotkey │ 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY │
│ Expires at block │ 5256000 │
│ Registered at block│ 1000 │
│ Status │ Active │
└────────────────────┴────────────────────────────────────────────────────┘
View statistics
$ python tns.py stats
╭───────── TNS Platform Statistics ──────────╮
│ Total Domains: 42 │
│ Active Domains: 38 │
│ Expired Domains: 4 │
│ Total Events: 156 │
│ Recent Registrations (24h): 5 │
╰────────────────────────────────────────────╯
Security Notes
- Never share your mnemonic phrase
- The CLI prompts for mnemonic securely (hidden input)
- Mnemonic is not stored or logged
- All blockchain transactions require confirmation
Troubleshooting
Import Error: Make sure you're in the virtual environment and have installed dependencies.
Connection Error: Check that the API and blockchain node are running at the configured URLs.
Transaction Failed: Ensure you have sufficient TAO balance to pay transaction fees.
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 Distribution
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 tnscli-1.0.0.tar.gz.
File metadata
- Download URL: tnscli-1.0.0.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
945924c5bf40109a867d53495aeea556e08c001bc08d53d78925c3c45eb7546a
|
|
| MD5 |
3f2fb4f06c8bed240796849a1ea8843b
|
|
| BLAKE2b-256 |
24efd9b8d1c3311bbfec6a2ca839a8c2963e4b9b9071801c565ff5c3fc3d21e7
|
File details
Details for the file tnscli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: tnscli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e0ed453ff7307822f0bbdeb0dd626c46a55ad124864f8ce0e4a38c9f2162574
|
|
| MD5 |
02015b7b2d1ea9639ce4501c9258d060
|
|
| BLAKE2b-256 |
20a1a514b837d905a2c5d32571a4e56f71e52b47e348bcca229ee600fb744314
|