Skip to content

Commit 9771df4

Browse files
committed
docs: update cli.md, shell/README.md and TODO.md
1 parent 2f8b0fc commit 9771df4

3 files changed

Lines changed: 21 additions & 36 deletions

File tree

docs/cli.md

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,22 @@ See steps below to setup and run the tool in the CLI. VS Code is not needed.
55

66
For development, see [CLI Development](development/cli.md).
77

8-
## Requirements
8+
_This should work on Windows too but has not been tested yet._
99

10-
- Node (see version in [package.json](/package.json))
11-
- Git
1210

13-
_This should work on Windows too but has not been tested yet._
11+
## Install
1412

15-
## Setup
13+
Requires Git and Node.
1614

17-
### Clone the repo
15+
<!-- TODO replace with instructions for downloading from a release using manual steps and install with curl or npm
16+
Note you do not need Git or Node, you can download the pre-packaged CLI tool as a binary.
17+
-->
1818

1919
```sh
2020
$ git clone git@github.com:MichaelCurrin/auto-commit-msg.git
2121
$ cd auto-commit-msg
22-
```
23-
24-
### Install dependencies
25-
26-
```sh
27-
$ npm ci
28-
```
29-
30-
### Build and link the CLI tools
31-
32-
```sh
33-
$ npm run cli
34-
```
35-
36-
Verify installation:
37-
38-
```sh
39-
$ acm -h
40-
$ gacm -h
22+
$ npm install
23+
$ npm run cli:install
4124
```
4225

4326
## Usage
@@ -55,12 +38,12 @@ TODO -c not just --cached but pass through as --cached.
5538

5639
This is the **main** command you should use.
5740

58-
Note this actually **commit**, so if you want to experiment with commit output **without** committing, use the command below instead.
41+
Note this will **commit**, so if you want to experiment with commit output **without** committing, use the command below instead.
5942

6043
No flags are needed.
6144

6245
```sh
63-
$ gacm
46+
$ gacm --help
6447
```
6548

6649
### Check Git changes and generate commit message
@@ -70,15 +53,13 @@ This will **not** commit.
7053
No flags are needed.
7154

7255
```sh
73-
$ acm
56+
$ acm --help
7457
```
7558

7659
### Generate a message from staged changes
7760

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

80-
See [shell/acm.sh](/shell/acm.sh) if you want to use that script or write your own shell script. That relies on using this executable Node script
81-
8263
```sh
8364
$ auto_commit_message_generate "$CHANGES"
8465
```

shell/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11

22
# Shell
33

4-
See [acm-hook.sh](acm-hook.sh).
4+
See [acm-hook.sh](acm-hook.sh) script.
55

6-
A CLI script that bypasses using VS Code or an extension.
7-
It will get output from Git, send it to Node CLI entry-point tool and print
8-
it. This can be used as part of Git commit message hook flow (pre-commit hook).
6+
A Bash CLI script that bypasses using VS Code or an extension. It will get output from Git, send it to Node CLI entry-point tool and print
7+
it.
98

9+
This can be used as part of Git commit message hook flow such as a **pre-commit hook**.
10+
11+
> [!NOTE]
12+
> For **cross-platform support**, see [CLI docs](/docs/cli.md) as that uses Node instead of Bash and also supports creating a pre-built binary for distribution. Also that approach uses a new command which wraps the Git commit logic, while shell acm-hook.sh script works the opposite way as called by Git.
1013
1114
## Setup
1215

1316
If you want to use the hook:
1417

15-
1. Follow instructions to install the TS command globally as per [src/cli/README.md](/src/cli/README.md)
18+
1. Follow instructions to install the commands globally as per [CLI docs](/docs/cli.md).
1619
1. Install the pre-commit hook.
1720
```sh
1821
$ cp shell/acm-hook.sh YOUR_PROJECT/.hooks/pre-commit

shell/TODO.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ of template, so it that can be passed on.
66
- [ ] Add a flag for staged to get `--cached` flag.
77
- [ ] How to automated the install process for upgrades. Maybe the JS + shell script as NPM package or at least on GitHub with cURL install.
88
- [ ] Figure out how to switch between staged and not, with `--cached`. Like passing a param to the shell script and having two aliases. Or to have it as pass of the shell script to fallback to all if anything is staged. Or just control with filenames e.g. `git c .` or `git c package*` - oh wait, the shell script doesn't look at what is passed to `git commit`, only what is staged or not.
9-
- Fix bug where message is on modified and staged but only staged is committed with gacm or acm
9+
- [ ] Fix bug where message is on modified and staged but only staged is committed with gacm or acm
1010

1111
If the flag is omitted, then the standard `git status` logic is followed:
1212
look for staged changes and use them, otherwise use unstaged changes.
1313
there's a problem - commit does not take cached flag - but it will use implied staged or not. so do not pass through.
1414
BUT could look at advanced mode of pass through names of files to commit IF they are handled by status and commit, but using manual git add is good enough probably. esp for untracked files which need add anyway.
15+
- [ ] See if it is possible to make the shell script here shorter and use the logic in acm instead and a minimal .sh hook file.

0 commit comments

Comments
 (0)