3 ms·
I've successfully used a pattern like this for groups of 10 to 20 devs where you designate a folder containing scripts and subfolders as a clu for team. I star
by zanderhill 2y ago
I've successfully used a pattern like this for groups of 10 to 20 devs where you designate a folder containing scripts and subfolders as a clu for team.
I started off using Basecamp sub, then a rust remake called tome and finally simplified it as a golang project https://github.com/zph/tome-cli https://github.com/zph/tome-cli.
The elegance of this solution is having a helper binary that wraps a folder of sub folders and scripts as a cohesive sdk.
Copied from readme, the features are:
- Organize a folder of scripts into a CLI sdk
- Any language is supported via normal script #!
- Usage text extracted from script header if USAGE: is included in leading comments
- Full help text extracted as lines from USAGE: to first empty line
- Builtin alias generator allows for embedding configuration flags via tome-cli alias
Auto completion of:
subcommands (exec, help, etc)
root folder's folder names
root folder's scripts
root script's flags and arguments (when they satisfy the --complete and TOME_COMPLETION interface)
Gitignore like syntax for ignoring scripts by using a .tomeignore file at base of root folder example
The trick to allowing any script language is to only allow self contained dependency languages like deno, python with uv inline deps or golang with bash wrapper. And then you need to vendor those runtime references in repo as well using hermit or dotslash so that the toolkit is self contained.
It saves a good bit of time to have a central cli andale it easy to extend