Replace manual defer blocks with packet.deinit() for consistent cleanup: - jupyter.zig: 5 locations updated (restoreJupyter, startJupyter, stopJupyter, removeJupyter, listServices, packageCommands) - experiment.zig: 3 locations updated (executeLog, executeShow, executeDelete) - queue.zig: 1 location updated (queueSingleJob) - logs.zig: 1 location updated (run) Eliminates 44 manual cleanup blocks across 4 files. Build verified: zig build --release=fast |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| tests | ||
| build.zig | ||
| Makefile | ||
| README.md | ||
| src.zig | ||
ML CLI
Fast CLI tool for managing ML experiments.
Quick Start
# 1. Build
zig build
# 2. Setup configuration
./zig-out/bin/ml init
# 3. Run experiment
./zig-out/bin/ml sync ./my-experiment --queue
Commands
ml init- Setup configurationml sync <path>- Sync project to serverml queue <job1> [job2 ...] [--commit <id>] [--priority N] [--note <text>]- Queue one or more jobsml status- Check system/queue status for your API keyml validate <commit_id> [--json] [--task <task_id>]- Validate provenance + integrity for a commit or task (includesrun_manifest.jsonconsistency checks when validating by task)ml info <path|id> [--json] [--base <path>]- Show run info fromrun_manifest.json(by path or by scanningfinished/failed/running/pending)ml annotate <path|run_id|task_id> --note <text> [--author <name>] [--base <path>] [--json]- Append a human annotation torun_manifest.jsonml narrative set <path|run_id|task_id> [--hypothesis <text>] [--context <text>] [--intent <text>] [--expected-outcome <text>] [--parent-run <id>] [--experiment-group <text>] [--tags <csv>] [--base <path>] [--json]- Patch thenarrativefield inrun_manifest.jsonml monitor- Launch monitoring interface (TUI)ml cancel <job>- Cancel a running/queued job you ownml prune --keep N- Keep N recent experimentsml watch <path>- Auto-sync directoryml experiment log|show|list|delete- Manage experiments and metrics
Notes:
--jsonmode is designed to be pipe-friendly: machine-readable JSON is emitted to stdout, while user-facing messages/errors go to stderr.- When running
ml validate --task <task_id>, the server will try to locate the job'srun_manifest.jsonunder the configured base path (pending/running/finished/failed) and cross-check key fields (task id, commit id, deps, snapshot). - For tasks in
running,completed, orfailedstate, a missingrun_manifest.jsonis treated as a validation failure. Forqueuedtasks, it is treated as a warning (the job may not have started yet).
Experiment workflow (minimal)
-
ml sync ./my-experiment --queue
Syncs files, computes a unique commit ID for the directory, and queues a job. -
ml queue my-job
Queues a job namedmy-job. If--commitis omitted, the CLI generates a random commit ID and records(job_name, commit_id)in~/.ml/history.logso you don't have to remember hashes. -
ml queue my-job --note "baseline run; lr=1e-3"Adds a human-readable note to the run; it will be persisted into the run'srun_manifest.json(undermetadata.note). -
ml experiment list
Shows recent experiments from history with alias (job name) and commit ID. -
ml experiment delete <alias|commit>
Cancels a running/queued experiment by job name, full commit ID, or short commit prefix.
Configuration
Create ~/.ml/config.toml:
worker_host = "worker.local"
worker_user = "mluser"
worker_base = "/data/ml-experiments"
worker_port = 22
api_key = "your-api-key"
Install
# Install to system
make install
# Or copy binary manually
cp zig-out/bin/ml /usr/local/bin/
Need Help?
ml --help- Show command helpml <command> --help- Show command-specific help