Hacker News new | ask | show | jobs
by markstos 1045 days ago
As someone who knows systemd very well, my team of Mac-based devs did appreciate when I made something like this. I used a different framework, a precursor to Tome:

   https://github.com/toumorokoshi/tome
Using this, I was able to create a very focused tool with few commands and simple docs, which supported things like:

  - my-cli help
  - my-cli start
  - my-cli stop
  - my-cli restart
  - my-cli status
Sometimes the commands were thin wrappers around systemd, sometimes they were a bit more complex because we really had a collection of services, not a single one.

So while my first reaction was "why not use systemd?", my second reaction is "Oh yeah, I built something like that and it was helpful".

Systemd is great, but it does have a massive amount of a commands and documentation and be overkill and overwhelming.

1 comments

Wow, never seen tome before but I built almost the exact same thing at my current company with the only difference being all the sub-commands run in a nix environment. Being able to share bash scripts in our monorepo by just creating a file at ./scripts/bash/foo.bash and calling it with 'my-cli foo' has been awesome. You can also set up runners so ./scripts/js and ./scripts/python works as you would think. Having everything inside of a nix env means all the tools are there and work across everyone's machines.

I don't have a solution for managing services though and that has been the one pain point after moving away from containerized dev envs. The cross platform network and service management you get with docker is pretty ideal. devenv.sh is on to something with their 'services' feature but it doesn't quiet fit the bill for us yet.

Check out devshell[1], especially paired with flake-parts and direnv. When a user cds into a flake directory, drenv's "use flake" makes the terminal show all devshell commands in a nice menu

[1]: https://flake.parts/options/devshell.html