docs(readme): enhance README with CLI tool documentation, GPU provider monetization focus, and performance metrics
- Add comprehensive CLI tool section with quick start guide and key features - Add "Earn Money with Your GPU" section highlighting provider benefits and success tips - Add CLI installation and usage examples for marketplace, agent management, and development - Add multi-language CLI support documentation - Add performance metrics section with response times, processing speed, and up
This commit is contained in:
116
cli/completion/aitbc_completion.sh
Executable file
116
cli/completion/aitbc_completion.sh
Executable file
@@ -0,0 +1,116 @@
|
||||
#!/bin/bash
|
||||
# AITBC CLI completion script for bash/zsh
|
||||
|
||||
_aitbc_completion() {
|
||||
local cur prev words
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
words=("${COMP_WORDS[@]}")
|
||||
|
||||
# Main commands
|
||||
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
||||
local commands="admin agent agent-comm analytics auth blockchain chain client config config-show deploy exchange genesis governance marketplace miner monitor multimodal node optimize plugin simulate swarm version wallet"
|
||||
COMPREPLY=($(compgen -W "${commands}" -- "${cur}"))
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Subcommand completions
|
||||
case "${words[1]}" in
|
||||
wallet)
|
||||
local wallet_commands="address backup balance create delete earn history info liquidity-stake liquidity-unstake list multisig-create multisig-propose multisig-sign request-payment restore rewards send spend stake staking-info stats switch unstake"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${wallet_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
blockchain)
|
||||
local blockchain_commands="block blocks info peers status supply sync-status transaction validators"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${blockchain_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
marketplace)
|
||||
local marketplace_commands="agents bid gpu governance offers orders pricing review reviews test"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${marketplace_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
config)
|
||||
local config_commands="edit environments export get-secret import-config path profiles reset set set-secret show validate"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${config_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
analytics)
|
||||
local analytics_commands="alerts dashboard monitor optimize predict summary"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${analytics_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
agent-comm)
|
||||
local agent_comm_commands="collaborate discover list monitor network register reputation send status"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${agent_comm_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
chain)
|
||||
local chain_commands="create delete info list status switch validate"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${chain_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
client)
|
||||
local client_commands="batch-submit blocks cancel history receipt status submit template"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${client_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
miner)
|
||||
local miner_commands="concurrent-mine deregister earnings heartbeat jobs mine poll register status update-capabilities"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${miner_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
auth)
|
||||
local auth_commands="import-env keys login logout refresh status token"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${auth_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
monitor)
|
||||
local monitor_commands="alerts dashboard history metrics webhooks"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${monitor_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
simulate)
|
||||
local simulate_commands="init load-test reset results scenario user workflow"
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
COMPREPLY=($(compgen -W "${simulate_commands}" -- "${cur}"))
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# Option completions
|
||||
case "${prev}" in
|
||||
--output)
|
||||
COMPREPLY=($(compgen -W "table json yaml" -- "${cur}"))
|
||||
;;
|
||||
--config-file)
|
||||
COMPREPLY=($(compgen -f -- "${cur}"))
|
||||
;;
|
||||
--wallet-name)
|
||||
COMPREPLY=($(compgen -W "$(aitbc wallet list 2>/dev/null | awk 'NR>2 {print $1}')" -- "${cur}"))
|
||||
;;
|
||||
--api-key)
|
||||
COMPREPLY=($(compgen -W "your_api_key_here" -- "${cur}"))
|
||||
;;
|
||||
--url)
|
||||
COMPREPLY=($(compgen -W "http://localhost:8000 http://127.0.0.1:18000" -- "${cur}"))
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _aitbc_completion aitbc
|
||||
251
cli/completion/aitbc_shell_completion.sh
Normal file
251
cli/completion/aitbc_shell_completion.sh
Normal file
@@ -0,0 +1,251 @@
|
||||
#!/bin/bash
|
||||
# AITBC CLI Shell Completion Script
|
||||
# Source this file in your .bashrc or .zshrc to enable tab completion
|
||||
|
||||
# AITBC CLI completion for bash
|
||||
_aitbc_completion() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
# Main commands
|
||||
if [[ ${COMP_CWORD} -eq 1 ]]; then
|
||||
opts="client miner wallet auth blockchain marketplace admin config simulate help --help --version --url --api-key --output -v --debug --config-file"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Command-specific completions
|
||||
case "${COMP_WORDS[1]}" in
|
||||
client)
|
||||
_aitbc_client_completion
|
||||
;;
|
||||
miner)
|
||||
_aitbc_miner_completion
|
||||
;;
|
||||
wallet)
|
||||
_aitbc_wallet_completion
|
||||
;;
|
||||
auth)
|
||||
_aitbc_auth_completion
|
||||
;;
|
||||
blockchain)
|
||||
_aitbc_blockchain_completion
|
||||
;;
|
||||
marketplace)
|
||||
_aitbc_marketplace_completion
|
||||
;;
|
||||
admin)
|
||||
_aitbc_admin_completion
|
||||
;;
|
||||
config)
|
||||
_aitbc_config_completion
|
||||
;;
|
||||
simulate)
|
||||
_aitbc_simulate_completion
|
||||
;;
|
||||
--output)
|
||||
opts="table json yaml"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Client command completion
|
||||
_aitbc_client_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="submit status blocks receipts cancel history"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
submit)
|
||||
opts="inference training fine-tuning"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
status|cancel)
|
||||
# Complete with job IDs (placeholder)
|
||||
COMPREPLY=( $(compgen -W "job_123 job_456 job_789" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Miner command completion
|
||||
_aitbc_miner_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="register poll mine heartbeat status"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
fi
|
||||
}
|
||||
|
||||
# Wallet command completion
|
||||
_aitbc_wallet_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="balance earn spend history address stats send request"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
fi
|
||||
}
|
||||
|
||||
# Auth command completion
|
||||
_aitbc_auth_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="login logout token status refresh keys import-env"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
keys)
|
||||
opts="create list revoke"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Blockchain command completion
|
||||
_aitbc_blockchain_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="blocks block transaction status sync-status peers info supply validators"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
fi
|
||||
}
|
||||
|
||||
# Marketplace command completion
|
||||
_aitbc_marketplace_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="gpu orders pricing reviews"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
gpu)
|
||||
opts="list details book release"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Admin command completion
|
||||
_aitbc_admin_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="status jobs miners analytics logs maintenance action"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
jobs|miners)
|
||||
opts="list details cancel suspend"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Config command completion
|
||||
_aitbc_config_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="show set path edit reset export import validate environments profiles"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
set)
|
||||
opts="coordinator_url api_key timeout"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
export|import)
|
||||
opts="--format json yaml"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
profiles)
|
||||
opts="save list load delete"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Simulate command completion
|
||||
_aitbc_simulate_completion() {
|
||||
local cur prev opts
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
|
||||
if [[ ${COMP_CWORD} -eq 2 ]]; then
|
||||
opts="init user workflow load-test scenario results reset"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
elif [[ ${COMP_CWORD} -eq 3 ]]; then
|
||||
case "${COMP_WORDS[2]}" in
|
||||
user)
|
||||
opts="create list balance fund"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
scenario)
|
||||
opts="list run"
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# Register the completion
|
||||
complete -F _aitbc_completion aitbc
|
||||
|
||||
# For zsh compatibility
|
||||
if [[ -n "$ZSH_VERSION" ]]; then
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
_aitbc_completion() {
|
||||
local matches
|
||||
matches=($(compgen -W "$(aitbc _completion_helper "${words[@]}")" -- "${words[CURRENT]}"))
|
||||
_describe 'aitbc commands' matches
|
||||
}
|
||||
compdef _aitbc_completion aitbc
|
||||
fi
|
||||
|
||||
echo "AITBC CLI shell completion loaded!"
|
||||
echo "Tab completion is now enabled for the aitbc command."
|
||||
Reference in New Issue
Block a user