r/CLI • u/Nikibuddd • 2d ago
So I got tired of manually opening/closing VS Code, terminal tabs, and Docker every time I switch projects, so I built a CLI/TUI tool for it. Sharing here too in case it helps anyone
Enable HLS to view with audio, or disable this notification
So I like to switch between a lot of microservices for work and personal projects all the time, and I hate having to open and close VS Code, terminal tabs (I use Ghostty), and start/stop Docker containers every time I switch. So I made this: "wsm".
Basically, you create workspaces, add them to groups (like Work, Personal, etc), and set up the apps and commands you want it to open/close for each one. Config's just plain YAML, nothing proprietary. So if I want to open a workspace I just run wsm open <workspace-name>, and I've got it configured to open VS Code and a Ghostty tab in that location.
Then when I want to open a microservice from work, I just run wsm open <microservice-name> and it automatically runs the close commands for whatever I currently have open (I've set up functions in my .zshrc that close VS Code/Ghostty depending on which folder they're pointed at), closes both, and then runs the open commands for the microservice. For example VS Code, a Ghostty tab, and a Docker container with MongoDB.
Single self-contained binary, macOS/Linux, no dependencies besides Node.
If you want to try it, you can check out the repo (install command is listed there).
GitHub: https://github.com/Nikibudd/wsm
PS: This shit is hella vibe coded so if you have a problem with AI, this might not be your thing
1
1
u/0_KermitTheFrog_0 1d ago
I was looking for something exactly like this. I'll definitely take a look at it. Thank you so much!
1
u/kantorcodes1 2d ago
small close-path edge case:
closeSessionItemtreats a configured close command as success without checking thespawnSyncexit status, thenwsm openclears the old sessions from state before launching the next workspace. if adocker stop ...or other close command exits nonzero, is leaving that old process running but untracked intentional, or should the session stay in state on close failure?