zhaofengli / colmena

A simple, stateless NixOS deployment tool
https://colmena.cli.rs
MIT License
1.12k stars 62 forks source link

Show command output for `colmena exec`. #217

Open kevincox opened 2 months ago

kevincox commented 2 months ago

It is often useful to use colmena exec to quickly gather or check information on servers. Especially since you can filter by tag.

One relatively silly example:

colmena exec -- cat /etc/lsb-release

It would be great if the output was shown, and indicated which host it came from.

It may make sense to have two modes. A streaming mode where lines are prefixed with the host, and a batched mode where output is buffered until the command completes then each host is printed contiguously. (Like GNU parallel)

bjornfor commented 2 months ago

Have you tried the --verbose option? https://colmena.cli.rs/unstable/reference/cli.html#colmena-exec

It's not exactly/all you ask for, but does show the command output.

kevincox commented 2 months ago

I don't know how I missed that. Apparently I read the help too fast. This solves 95% of the problem. A batching mode would be nice but doesn't seem critical.