-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a CLI to interface with the tool #106
Comments
Hi, thanks for the interest. There is actually a CLI option. https://github.com/MichaelCurrin/auto-commit-msg/tree/master/shell#autofill-scripts I am missing pieces that make it easy to bundle and install. However I can send you something so you can try it out yourself, for Linux. SetupMake sure
Then continue.
Here is the script #!/usr/bin/env bash
set -e
DIFF_FLAGS='--name-status --find-renames --find-copies --no-color'
CHANGES=$(git diff-index $DIFF_FLAGS HEAD)
MESSAGE=$(node ~/Downloads/auto-commit-msg/extension/out/cli.js "$CHANGES")
echo "$MESSAGE" UsageYou can run it like this
And that is of course easier if you add a Bash alias or a Git alias Here for Git config: [alias]
c = '! git commit --edit -m "$(autofill.sh)"' Then just git c |
If you want an updated version, you'll have to download and unzip whenever there is a new release. If you have any ideas or can help with making setup and update smoother, that would be great. IdeasRollupI did some experiments today but got stuck because of the a mix of ES modules and CJS modules and fighting with TypeScript and Rollup. I found a way to bundle the Shell script distributionI am thinking of a pipeline solution to make the .sh file installable with one or more JS files. At the least using curl. But there are more professional tools I've seen for making Bash tools easy to install and update. NPM packageAnother idea I had is to do away with the Bash + JS option and instead make my tool installable as an NPM package (I've seen NPM packages come as a binary that was compiled from Go for example). Then you would install my tool as
And run like
And also this could be expanded to work on Windows if the .sh script I provided worked as .cmd / powershell |
Hey, great tools!
Unfortunately I don't use vscode. Is there any plan to make this tool usable from the CLI? or do you have any pointers if I want to implement a CLI for this?
The text was updated successfully, but these errors were encountered: