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.
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 supports one of three
operation types: copy, shell, or local.
tasks:
- name: Copy file to the remote host
copy: test.txt
to: /tmp/test.txt
- name: Copy directory to the remote host
copy: testdir
to: /tmp/testdir
- name: List /tmp on the remote host
shell: ls /tmp
Run Tasks
minop # use ./hosts.yaml and ./minop.yaml
minop -H ./prod-hosts.yaml # custom hosts file
minop -t ./deploy.yaml # custom tasks file
minop -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
minop check # validate minop.yaml and list its tasks
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.