Installation
Install from Source
To install minop from source, ensure you have Go installed and run:
go install github.com/cqroot/minop@latest
Download Pre-compiled Binaries
Download the binary for your platform from the releases page and add its directory to your system's PATH.
Features
- Batch SSH execution — run shell commands on every host in
hosts.yaml concurrently (default 10, tunable via --max-procs).
- File & directory uploads — built-in
copy task with optional backup: true that preserves any pre-existing remote file.
- Local commands — run shell snippets on the minop host itself, useful for orchestration glue.
- Interactive REPL —
minop cli opens a TUI where every input line is dispatched to all targets; output scrolls above a pinned input box with hint shortcuts.
- Ansible-style task syntax —
minop.yaml follows the "action key as type" convention familiar to ansible users: shell:, local:, and copy: each pick the operation type by their key, no explicit type: field required.
- Inspection commands —
minop host prints the parsed host tree; minop task lists every task in minop.yaml without executing.
Usage
minop reads two configuration files:
| File |
Flag |
Purpose |
hosts.yaml |
-H / --hosts-file |
Hosts grouped by role. Stable across runs; usually version-controlled. |
minop.yaml |
-t / --task |
Tasks to execute. Changes from run to run. |
Both files are looked up in the current working directory by default.
Hosts File (hosts.yaml)
A flat YAML map from role name to a list of host strings in the
format <user>:<password>@<address>:<port>. The role named all is
special: every task targets it unless the task specifies a different
role.
all:
- root:PASSWORD@127.0.0.1:8001
main:
- root:PASSWORD@127.0.0.1:8002
- root:PASSWORD@127.0.0.1:8003
Tasks File (minop.yaml)
A list of tasks under the tasks key. Each task declares exactly one
action — the action key itself picks the operation type, no separate
type: field is needed.
| Action key |
Operation |
Body |
shell: <cmd> |
run on every target host |
command string |
local: <cmd> |
run on the minop host |
command string |
copy: {...} |
upload a file or directory |
nested object |
tasks:
- name: Copy a file to the remote host
copy:
src: test.txt
dest: /tmp/test.txt
- name: Copy a directory to the remote host
copy:
src: testdir
dest: /tmp/testdir
- name: List /tmp on the remote host
shell: ls /tmp
copy accepts an optional backup: true flag — when set, any pre-existing
remote file at dest is renamed to dest.minop_bak before the upload.
Run Tasks
minop run # use ./hosts.yaml and ./minop.yaml
minop run -H ./prod-hosts.yaml # custom hosts file
minop run -t ./deploy.yaml # custom tasks file
minop run -p 20 # run with concurrency 20 (default 10)
Inspect Configuration
minop host # show the parsed hosts as a tree
minop task # list the tasks defined in minop.yaml
Interactive CLI
minop cli # REPL: type a command, hit Enter, run on every host
Type exit (or quit) to leave the CLI, and help to see built-in
shortcuts.
Contributing
Contributions are welcome! Feel free to open an issue to report bugs, suggest new features, or submit a pull request.
License
This project is open source, licensed under the GPL-3.0 License.