Skip to content

Latest commit

 

History

History
100 lines (64 loc) · 2.51 KB

File metadata and controls

100 lines (64 loc) · 2.51 KB

CLI

How to use AutoCommitMsg in the terminal instead of as an extension

See steps below to setup and run the tool in the CLI. VS Code is not needed.

For development, see CLI Development.

Requirements

This should work on Windows too but has not been tested yet.

Setup

Clone the repo

$ git clone git@github.com:MichaelCurrin/auto-commit-msg.git
$ cd auto-commit-msg

Install dependencies

$ npm ci

Build and link the CLI tools

$ npm run cli

Verify installation:

$ acm -h
$ gacm -h

Usage

Use the -h or --help flags with any of these to avoid making changes.

Generate a message from changes and commit

This is the main command you should use.

Note this actually commit, so if you want to experiment with commit output without committing, use the command below instead.

No flags are needed.

$ gacm

Check Git changes and generate commit message

This will not commit.

No flags are needed.

$ acm

Generate a message from staged changes

This is a simpler command which does not interact with Git, intended for integrating with the Bash shell.

See shell/acm.sh if you want to use that script or write your own shell script. That relies on using this executable Node script

$ auto_commit_message_generate "$CHANGES"

Usage tips

The behavior depends on how Git treats files, so you should know these points:

  • The commands will pick up on staged changes and certain unstaged changes (modified and deleted, but not created as they are untracked).
  • If you want to handle created files, make sure to stage them first.
  • If you want to target only select changes for smaller commit, then stage stages and use the --cached flag to ignored unstaged changes.

Uninstall the linked CLI (optional)

If you get permission denied error, you can do this and then go back to the install step.

$ npm unlink -g auto-commit-msg