d81a36f875
A bash command interface to trianglesd RPC designed for Hermes, Krystie, and Sami to manage TRI wallets and communicate via the built-in secure messaging system (smessage). Features: - Info: status, balance, peers, staking info - Wallet: addresses, send, transactions - Secure messaging: inbox, outbox, send (encrypted via ECDH over Tor P2P) - Raw RPC passthrough for any daemon command - Bash + zsh completion - SSH-tunneled RPC for remote node access - Config at /etc/tri/nodes.conf (shared between agents) Files: - scripts/tri/tri Main script - scripts/tri/nodes.conf.example Config template - scripts/tri/tri-completion.bash Bash completion - scripts/tri/_tri_zsh_completion Zsh completion - scripts/tri/README.md Documentation Tested against live DNS3 node (block 2,207,455, 4 peers). Secure messaging verified: send → inbox → outbox all working.
40 lines
943 B
Plaintext
40 lines
943 B
Plaintext
#compdef tri
|
|
|
|
_tri() {
|
|
local -a commands
|
|
commands=(
|
|
'status:Detailed node status'
|
|
'balance:Wallet balance'
|
|
'peers:Connected peers'
|
|
'stake:Staking info'
|
|
'address:Address management'
|
|
'send:Send TRI'
|
|
'tx:Transactions'
|
|
'msg:Secure messaging'
|
|
'raw:Raw RPC passthrough'
|
|
'help:Show help'
|
|
)
|
|
|
|
_arguments -C \
|
|
"1:command:->command" \
|
|
"*::arg:->args"
|
|
|
|
case "$state" in
|
|
command)
|
|
_describe 'tri command' commands
|
|
;;
|
|
args)
|
|
case ${words[1]} in
|
|
address|addr)
|
|
_values 'subcommand' 'new' 'list' 'balance'
|
|
;;
|
|
msg|message|messages)
|
|
_values 'subcommand' 'inbox' 'outbox' 'send' 'anon' 'keys' 'enable' 'pubkey' 'unlock'
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
_tri "$@"
|