|
1 | 1 | # fuzmit |
2 | 2 |
|
3 | | -Conventional commits with fuzzy type selection and direct CLI flags. |
| 3 | +Conventional Commit helper CLI with fuzzy prompts and direct flags |
4 | 4 |
|
5 | | -`fuzmit` is a standalone binary. If you also want Git subcommand style, install the same binary as `git-fuzmit`. |
| 5 | +## π¬ Demo |
6 | 6 |
|
7 | | -## Run locally |
| 7 | + |
8 | 8 |
|
9 | | -```bash |
10 | | -go run . --help |
11 | | -go run . --type fix --scope auth -m "fix nil panic" |
12 | | -go run . --type feat --scope -m "prompted scope example" |
13 | | -``` |
| 9 | +## πΊ Install (Homebrew) |
14 | 10 |
|
15 | | -## Build locally |
| 11 | +From [o6uoq/homebrew-tap](https://github.com/o6uoq/homebrew-tap): |
16 | 12 |
|
17 | 13 | ```bash |
18 | | -go build -o fuzmit . |
19 | | -./fuzmit --help |
| 14 | +brew tap o6uoq/homebrew-tap |
| 15 | +brew install o6uoq/homebrew-tap/fuzmit |
20 | 16 | ``` |
21 | 17 |
|
22 | | -Optional Git-subcommand install: |
| 18 | +## β‘ Quick start |
23 | 19 |
|
24 | 20 | ```bash |
25 | | -cp ./fuzmit ~/.bin/git-fuzmit |
26 | | -git fuzmit --help |
| 21 | +fuzmit --help |
| 22 | +fuzmit --type fix --scope auth -m "handle nil panic" |
| 23 | +fuzmit --type feat -m "add jira scope detection" |
| 24 | +fuzmit --type feat --scope -m "prompt for optional scope" |
27 | 25 | ``` |
28 | 26 |
|
29 | | -## Flags (A-Z) |
30 | | - |
31 | | -- `--jira-scope` detect Jira scope from current branch (for example `ABC-123`) |
32 | | -- `-m, --message <description>` set commit description directly |
33 | | -- `--no-emojis` disable emojis in commit-type picker/help output |
34 | | -- `--override` bypass main-branch protection |
35 | | -- `--scope <scope>` set optional scope directly (requires `--type`) |
36 | | -- `--scope` (no value) prompt for optional scope interactively (requires `--type`) |
37 | | -- `--type <type>` set commit type directly (`build|chore|ci|docs|feat|fix|perf|refactor|style|test`) |
| 27 | +## π§ Flags |
38 | 28 |
|
39 | | -Commit subjects follow Conventional Commits; emojis are included by default and can be disabled with `--no-emojis` or `FUZMIT_NO_EMOJIS=true`. |
| 29 | +- `--type <type>` required commit type: `build|chore|ci|docs|feat|fix|perf|refactor|style|test` |
| 30 | +- `--scope <scope>` optional scope |
| 31 | +- `--scope` prompt for optional scope |
| 32 | +- `--jira-scope` detect scope from branch name (example: `ABC-123`) |
| 33 | +- `-m, --message <description>` set description directly |
| 34 | +- `--no-emojis` disable emojis in picker/help output |
| 35 | +- `--override` bypass main branch protection |
40 | 36 |
|
41 | | -## Environment defaults |
| 37 | +## π§ͺ Env defaults |
42 | 38 |
|
43 | | -`fuzmit` is env-driven. If a variable is unset or invalid, it defaults to `false`. |
| 39 | +- `FUZMIT_SCOPE=true|false` prompt for scope if `--scope` is not provided |
| 40 | +- `FUZMIT_JIRA_SCOPE=true|false` detect Jira scope from branch and ignore `--scope` / `FUZMIT_SCOPE` |
| 41 | +- `FUZMIT_NO_EMOJIS=true|false` disable emojis in commit subjects, menus, and help output |
44 | 42 |
|
45 | | -- `FUZMIT_SCOPE=true|false` prompt for scope by default when `--scope` is not provided |
46 | | -- `FUZMIT_JIRA_SCOPE=true|false` auto-detect Jira scope from branch name; when true, both `--scope` and `FUZMIT_SCOPE` are ignored |
47 | | -- `FUZMIT_NO_EMOJIS=true|false` disable emojis in picker/help output |
48 | | - |
49 | | -Inspect current resolved env settings: |
| 43 | +Inspect resolved env settings: |
50 | 44 |
|
51 | 45 | ```bash |
52 | 46 | fuzmit env |
53 | 47 | ``` |
54 | 48 |
|
55 | | -## Jira scope detection |
56 | | - |
57 | | -When Jira scope extraction is enabled, `fuzmit` scans the current branch name for an issue key and uses the first match as commit scope. |
| 49 | +## π Release flow |
58 | 50 |
|
59 | | -- Case-insensitive match |
60 | | -- Normalized to uppercase |
61 | | -- Expected Jira key shape: `<PROJECT_KEY>-<NUMBER>` (for example `ABCD-12345`) |
| 51 | +- Tag push `v*` triggers GitHub Actions release |
| 52 | +- GoReleaser builds binaries + checksums |
| 53 | +- Tap formula update PR lands in [o6uoq/homebrew-tap](https://github.com/o6uoq/homebrew-tap) |
62 | 54 |
|
63 | | -## Pre-commit hooks |
64 | | - |
65 | | -Install and enable both `pre-commit` and `commit-msg` hooks: |
| 55 | +Create a release: |
66 | 56 |
|
67 | 57 | ```bash |
68 | | -pre-commit install --hook-type pre-commit --hook-type commit-msg |
69 | | -pre-commit run -a |
70 | | -``` |
71 | | - |
72 | | -Configured checks: |
73 | | - |
74 | | -- `go fmt ./...` |
75 | | -- `go vet ./...` |
76 | | -- `go test ./...` |
77 | | -- `golangci-lint` (official upstream pre-commit hook) |
78 | | -- Conventional Commit message validation on `commit-msg` |
79 | | - |
80 | | -## Homebrew release model |
81 | | - |
82 | | -This repo uses tag-driven releases in GitHub Actions: |
83 | | - |
84 | | -1. Push a tag matching `v*` |
85 | | -2. GitHub Actions runs tests and GoReleaser |
86 | | -3. GoReleaser publishes release artifacts + checksums to GitHub Releases |
87 | | -4. GoReleaser opens/updates a PR in `o6uoq/homebrew-tap` for `Formula/fuzmit.rb` |
88 | | - |
89 | | -Required repository secret in `o6uoq/fuzmit`: |
90 | | - |
91 | | -- `HOMEBREW_TAP_GITHUB_TOKEN` (PAT with write access to `o6uoq/homebrew-tap`) |
92 | | - |
93 | | -Release workflow file: |
94 | | - |
95 | | -- `.github/workflows/release.yml` |
96 | | - |
97 | | -GoReleaser config: |
98 | | - |
99 | | -- `.goreleaser.yaml` |
100 | | - |
101 | | -Example prerelease (before `v0.1.0`): |
102 | | - |
103 | | -```bash |
104 | | -git tag v0.0.1-beta.1 |
105 | | -git push origin v0.0.1-beta.1 |
106 | | -``` |
107 | | - |
108 | | -Example stable release: |
109 | | - |
110 | | -```bash |
111 | | -git tag v0.1.0 |
112 | | -git push origin v0.1.0 |
113 | | -``` |
114 | | - |
115 | | -Install from tap: |
116 | | - |
117 | | -```bash |
118 | | -brew tap o6uoq/homebrew-tap |
119 | | -brew install o6uoq/homebrew-tap/fuzmit |
| 58 | +git tag v0.1.1 |
| 59 | +git push origin v0.1.1 |
120 | 60 | ``` |
0 commit comments