- Add modern CLI interface built with Zig for performance - Include TUI (Terminal User Interface) with bubbletea-like features - Implement ML experiment commands (run, status, manage) - Add configuration management and validation - Include shell completion scripts for bash and zsh - Add comprehensive CLI testing framework - Support for multiple ML frameworks and project types CLI provides fast, efficient interface for ML experiment management with modern terminal UI and comprehensive feature set.
119 lines
No EOL
3.4 KiB
Bash
119 lines
No EOL
3.4 KiB
Bash
# Zsh completion for the `ml` CLI
|
|
# Usage:
|
|
# source /path/to/ml_completion.zsh
|
|
# or add to your ~/.zshrc:
|
|
# source /path/to/ml_completion.zsh
|
|
|
|
_ml() {
|
|
local -a subcommands
|
|
subcommands=(
|
|
'init:Setup configuration interactively'
|
|
'sync:Sync project to server'
|
|
'queue:Queue job for execution'
|
|
'status:Get system status'
|
|
'monitor:Launch TUI via SSH'
|
|
'cancel:Cancel running job'
|
|
'prune:Prune old experiments'
|
|
'watch:Watch directory for auto-sync'
|
|
'dataset:Manage datasets'
|
|
'experiment:Manage experiments'
|
|
)
|
|
|
|
local -a global_opts
|
|
global_opts=(
|
|
'--help:Show this help message'
|
|
'--verbose:Enable verbose output'
|
|
'--quiet:Suppress non-error output'
|
|
'--monitor:Monitor progress of long-running operations'
|
|
)
|
|
|
|
local curcontext="$curcontext" state line
|
|
_arguments -C \
|
|
'1:command:->cmds' \
|
|
'*::arg:->args'
|
|
|
|
case $state in
|
|
cmds)
|
|
_describe -t commands 'ml commands' subcommands
|
|
return
|
|
;;
|
|
args)
|
|
case $words[2] in
|
|
sync)
|
|
_arguments -C \
|
|
'--help[Show sync help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]' \
|
|
'1:directory:_directories'
|
|
;;
|
|
queue)
|
|
_arguments -C \
|
|
'--help[Show queue help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]' \
|
|
'1:job name:'
|
|
;;
|
|
status)
|
|
_arguments -C \
|
|
'--help[Show status help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]'
|
|
;;
|
|
monitor)
|
|
_arguments -C \
|
|
'--help[Show monitor help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]'
|
|
;;
|
|
cancel)
|
|
_arguments -C \
|
|
'--help[Show cancel help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]' \
|
|
'1:job name:'
|
|
;;
|
|
prune)
|
|
_arguments -C \
|
|
'--help[Show prune help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]' \
|
|
'--keep[Keep N most recent experiments]:number:' \
|
|
'--older-than[Remove experiments older than D days]:days:'
|
|
;;
|
|
watch)
|
|
_arguments -C \
|
|
'--help[Show watch help]' \
|
|
'--verbose[Enable verbose output]' \
|
|
'--quiet[Suppress non-error output]' \
|
|
'--monitor[Monitor progress]' \
|
|
'1:directory:_directories'
|
|
;;
|
|
dataset)
|
|
_values 'dataset subcommand' \
|
|
'list[list datasets]' \
|
|
'upload[upload dataset]' \
|
|
'download[download dataset]' \
|
|
'delete[delete dataset]' \
|
|
'info[dataset info]' \
|
|
'search[search datasets]'
|
|
;;
|
|
experiment)
|
|
_values 'experiment subcommand' \
|
|
'log[log metrics]' \
|
|
'show[show experiment]'
|
|
;;
|
|
*)
|
|
_arguments -C "${global_opts[@]}"
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
compdef _ml ml |