git-smart-flow 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/bin/git-smart-flow.js +2 -0
- package/bin/gsf.js +2 -0
- package/bin/gsfc.js +3 -0
- package/bin/gsfm.js +3 -0
- package/bin/gsfp.js +3 -0
- package/bin/gsfpr.js +3 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +214 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/aliases.d.ts +2 -0
- package/dist/commands/aliases.js +37 -0
- package/dist/commands/aliases.js.map +1 -0
- package/dist/commands/branch.d.ts +2 -0
- package/dist/commands/branch.js +414 -0
- package/dist/commands/branch.js.map +1 -0
- package/dist/commands/commit-message.d.ts +7 -0
- package/dist/commands/commit-message.js +95 -0
- package/dist/commands/commit-message.js.map +1 -0
- package/dist/commands/commit.d.ts +3 -0
- package/dist/commands/commit.js +597 -0
- package/dist/commands/commit.js.map +1 -0
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +88 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +246 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/info.d.ts +2 -0
- package/dist/commands/info.js +155 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/install-hooks.d.ts +2 -0
- package/dist/commands/install-hooks.js +66 -0
- package/dist/commands/install-hooks.js.map +1 -0
- package/dist/commands/log.d.ts +2 -0
- package/dist/commands/log.js +101 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/menu.d.ts +2 -0
- package/dist/commands/menu.js +297 -0
- package/dist/commands/menu.js.map +1 -0
- package/dist/commands/merge.d.ts +6 -0
- package/dist/commands/merge.js +128 -0
- package/dist/commands/merge.js.map +1 -0
- package/dist/commands/pr.d.ts +2 -0
- package/dist/commands/pr.js +731 -0
- package/dist/commands/pr.js.map +1 -0
- package/dist/commands/push.d.ts +7 -0
- package/dist/commands/push.js +225 -0
- package/dist/commands/push.js.map +1 -0
- package/dist/commands/reflog.d.ts +2 -0
- package/dist/commands/reflog.js +162 -0
- package/dist/commands/reflog.js.map +1 -0
- package/dist/commands/repo-init.d.ts +2 -0
- package/dist/commands/repo-init.js +466 -0
- package/dist/commands/repo-init.js.map +1 -0
- package/dist/commands/revert.d.ts +7 -0
- package/dist/commands/revert.js +694 -0
- package/dist/commands/revert.js.map +1 -0
- package/dist/commands/setup.d.ts +2 -0
- package/dist/commands/setup.js +86 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/stash.d.ts +2 -0
- package/dist/commands/stash.js +130 -0
- package/dist/commands/stash.js.map +1 -0
- package/dist/commands/sync.d.ts +2 -0
- package/dist/commands/sync.js +335 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tag.d.ts +2 -0
- package/dist/commands/tag.js +163 -0
- package/dist/commands/tag.js.map +1 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +203 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/config.d.ts +10 -0
- package/dist/config/config.js +126 -0
- package/dist/config/config.js.map +1 -0
- package/dist/git/ai-context-builder.d.ts +11 -0
- package/dist/git/ai-context-builder.js +112 -0
- package/dist/git/ai-context-builder.js.map +1 -0
- package/dist/git/convention-detector.d.ts +3 -0
- package/dist/git/convention-detector.js +211 -0
- package/dist/git/convention-detector.js.map +1 -0
- package/dist/git/ensure-repo.d.ts +7 -0
- package/dist/git/ensure-repo.js +141 -0
- package/dist/git/ensure-repo.js.map +1 -0
- package/dist/git/gitignore.d.ts +8 -0
- package/dist/git/gitignore.js +261 -0
- package/dist/git/gitignore.js.map +1 -0
- package/dist/git/remote-setup.d.ts +2 -0
- package/dist/git/remote-setup.js +129 -0
- package/dist/git/remote-setup.js.map +1 -0
- package/dist/git/repo.d.ts +73 -0
- package/dist/git/repo.js +308 -0
- package/dist/git/repo.js.map +1 -0
- package/dist/git/validate.d.ts +36 -0
- package/dist/git/validate.js +113 -0
- package/dist/git/validate.js.map +1 -0
- package/dist/providers/base.provider.d.ts +10 -0
- package/dist/providers/base.provider.js +40 -0
- package/dist/providers/base.provider.js.map +1 -0
- package/dist/providers/claude.provider.d.ts +14 -0
- package/dist/providers/claude.provider.js +85 -0
- package/dist/providers/claude.provider.js.map +1 -0
- package/dist/providers/copilot.provider.d.ts +12 -0
- package/dist/providers/copilot.provider.js +88 -0
- package/dist/providers/copilot.provider.js.map +1 -0
- package/dist/providers/heuristic.provider.d.ts +9 -0
- package/dist/providers/heuristic.provider.js +163 -0
- package/dist/providers/heuristic.provider.js.map +1 -0
- package/dist/providers/ollama.provider.d.ts +14 -0
- package/dist/providers/ollama.provider.js +83 -0
- package/dist/providers/ollama.provider.js.map +1 -0
- package/dist/providers/openai.provider.d.ts +14 -0
- package/dist/providers/openai.provider.js +84 -0
- package/dist/providers/openai.provider.js.map +1 -0
- package/dist/providers/provider.factory.d.ts +5 -0
- package/dist/providers/provider.factory.js +51 -0
- package/dist/providers/provider.factory.js.map +1 -0
- package/dist/security/scanner.d.ts +13 -0
- package/dist/security/scanner.js +138 -0
- package/dist/security/scanner.js.map +1 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/ux/components/BranchTree.d.ts +8 -0
- package/dist/ux/components/BranchTree.js +57 -0
- package/dist/ux/components/BranchTree.js.map +1 -0
- package/dist/ux/components/CommitProposal.d.ts +13 -0
- package/dist/ux/components/CommitProposal.js +127 -0
- package/dist/ux/components/CommitProposal.js.map +1 -0
- package/dist/ux/components/DiagnosticReport.d.ts +18 -0
- package/dist/ux/components/DiagnosticReport.js +19 -0
- package/dist/ux/components/DiagnosticReport.js.map +1 -0
- package/dist/ux/components/ErrorBox.d.ts +7 -0
- package/dist/ux/components/ErrorBox.js +9 -0
- package/dist/ux/components/ErrorBox.js.map +1 -0
- package/dist/ux/components/FileSelector.d.ts +14 -0
- package/dist/ux/components/FileSelector.js +87 -0
- package/dist/ux/components/FileSelector.js.map +1 -0
- package/dist/ux/components/Logo.d.ts +6 -0
- package/dist/ux/components/Logo.js +21 -0
- package/dist/ux/components/Logo.js.map +1 -0
- package/dist/ux/components/RepoContext.d.ts +8 -0
- package/dist/ux/components/RepoContext.js +17 -0
- package/dist/ux/components/RepoContext.js.map +1 -0
- package/dist/ux/components/SecurityAlert.d.ts +9 -0
- package/dist/ux/components/SecurityAlert.js +16 -0
- package/dist/ux/components/SecurityAlert.js.map +1 -0
- package/dist/ux/components/StatusDashboard.d.ts +14 -0
- package/dist/ux/components/StatusDashboard.js +36 -0
- package/dist/ux/components/StatusDashboard.js.map +1 -0
- package/dist/ux/components/SuccessBox.d.ts +7 -0
- package/dist/ux/components/SuccessBox.js +9 -0
- package/dist/ux/components/SuccessBox.js.map +1 -0
- package/dist/ux/components/ValidationReport.d.ts +16 -0
- package/dist/ux/components/ValidationReport.js +19 -0
- package/dist/ux/components/ValidationReport.js.map +1 -0
- package/dist/ux/components/WarningBox.d.ts +7 -0
- package/dist/ux/components/WarningBox.js +9 -0
- package/dist/ux/components/WarningBox.js.map +1 -0
- package/dist/ux/display.d.ts +21 -0
- package/dist/ux/display.js +96 -0
- package/dist/ux/display.js.map +1 -0
- package/dist/ux/hooks/useActivation.d.ts +8 -0
- package/dist/ux/hooks/useActivation.js +16 -0
- package/dist/ux/hooks/useActivation.js.map +1 -0
- package/dist/ux/hooks/useSpinner.d.ts +2 -0
- package/dist/ux/hooks/useSpinner.js +13 -0
- package/dist/ux/hooks/useSpinner.js.map +1 -0
- package/dist/ux/menu.d.ts +7 -0
- package/dist/ux/menu.js +56 -0
- package/dist/ux/menu.js.map +1 -0
- package/dist/ux/prompt.d.ts +7 -0
- package/dist/ux/prompt.js +361 -0
- package/dist/ux/prompt.js.map +1 -0
- package/dist/ux/renderer.d.ts +9 -0
- package/dist/ux/renderer.js +45 -0
- package/dist/ux/renderer.js.map +1 -0
- package/dist/ux/spinner.d.ts +6 -0
- package/dist/ux/spinner.js +42 -0
- package/dist/ux/spinner.js.map +1 -0
- package/dist/ux/statusbar.d.ts +2 -0
- package/dist/ux/statusbar.js +44 -0
- package/dist/ux/statusbar.js.map +1 -0
- package/dist/ux/theme.d.ts +37 -0
- package/dist/ux/theme.js +55 -0
- package/dist/ux/theme.js.map +1 -0
- package/package.json +125 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.0](https://github.com/anir-dev/git-smart-flow/compare/v0.2.0...v0.3.0) (2026-05-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **commands:** update package-lock.json, package.json files ([c4f2687](https://github.com/anir-dev/git-smart-flow/commit/c4f268756c232289249b22c390dce64a36e22e53))
|
|
9
|
+
* **commands:** update package, branch, renderer ([2045130](https://github.com/anir-dev/git-smart-flow/commit/204513064f676b0f23b3616e5e393506b5f03b61))
|
|
10
|
+
* **core:** first version ([a409e2b](https://github.com/anir-dev/git-smart-flow/commit/a409e2be3586c4201af650968e934bc942320498))
|
|
11
|
+
* **ux:** update bin, package-lock.json files ([b1979df](https://github.com/anir-dev/git-smart-flow/commit/b1979df1561ac42d2fd07704a830b3f8f6edc5db))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **release:** align tag pattern between release-please and release workflow ([ab6b563](https://github.com/anir-dev/git-smart-flow/commit/ab6b56380c61a632dd597739d4db1db107ac72c2))
|
|
17
|
+
* **release:** align tag pattern between release-please and release workflow ([#18](https://github.com/anir-dev/git-smart-flow/issues/18)) ([e1b36aa](https://github.com/anir-dev/git-smart-flow/commit/e1b36aaa0516f78a65e7bef3f78f9f7330a00c31))
|
|
18
|
+
|
|
19
|
+
## [0.2.0](https://github.com/anir-dev/git-smart-flow/compare/git-smart-flow-v0.1.0...git-smart-flow-v0.2.0) (2026-05-22)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **commands:** update package-lock.json, package.json files ([c4f2687](https://github.com/anir-dev/git-smart-flow/commit/c4f268756c232289249b22c390dce64a36e22e53))
|
|
25
|
+
* **commands:** update package, branch, renderer ([2045130](https://github.com/anir-dev/git-smart-flow/commit/204513064f676b0f23b3616e5e393506b5f03b61))
|
|
26
|
+
* **core:** first version ([a409e2b](https://github.com/anir-dev/git-smart-flow/commit/a409e2be3586c4201af650968e934bc942320498))
|
|
27
|
+
* **ux:** update bin, package-lock.json files ([b1979df](https://github.com/anir-dev/git-smart-flow/commit/b1979df1561ac42d2fd07704a830b3f8f6edc5db))
|
|
28
|
+
|
|
29
|
+
## Changelog
|
|
30
|
+
|
|
31
|
+
All notable changes to this project will be documented in this file.
|
|
32
|
+
|
|
33
|
+
<!-- changelog content will be auto-generated by release-it + @release-it/conventional-changelog -->
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 YOUR_NAME
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# git-smart-flow
|
|
2
|
+
|
|
3
|
+
> Interactive CLI to manage Git workflows guided, safe and smart
|
|
4
|
+
|
|
5
|
+
[](https://github.com/anir-dev/git-smart-flow/actions)
|
|
6
|
+
[](https://www.npmjs.com/package/git-smart-flow)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
**git-smart-flow** helps developers manage Git tasks in a guided, safe, and interactive way. It generates commit messages following the detected convention in your repository, creates assisted PRs, validates branches, and reviews changes before pushing — all from the terminal.
|
|
10
|
+
|
|
11
|
+
Works with or without AI. The heuristic provider always works offline.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Quick Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g git-smart-flow
|
|
19
|
+
git-smart-flow setup
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Or via script (macOS/Linux):
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
curl -fsSL https://raw.githubusercontent.com/anir-dev/git-smart-flow/main/installers/macos/install.sh | bash
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or download a [standalone binary](https://github.com/anir-dev/git-smart-flow/releases) (no Node.js required).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
| Command | Alias | Description |
|
|
35
|
+
|---------|-------|-------------|
|
|
36
|
+
| `git-smart-flow setup` | — | Interactive setup wizard |
|
|
37
|
+
| `git-smart-flow commit` | `gsfc` | Guided commit assistant |
|
|
38
|
+
| `git-smart-flow commit-message` | — | Generate commit message (no commit) |
|
|
39
|
+
| `git-smart-flow pr` | `gsfpr` | Generate PR title and description |
|
|
40
|
+
| `git-smart-flow validate` | — | Validate repository state |
|
|
41
|
+
| `git-smart-flow push` | `gsfp` | Validated push with confirmation |
|
|
42
|
+
| `git-smart-flow merge` | `gsfm` | Assisted merge |
|
|
43
|
+
| `git-smart-flow doctor` | — | Full environment diagnostic |
|
|
44
|
+
| `git-smart-flow info` | — | Show current repository context |
|
|
45
|
+
| `git-smart-flow config` | — | Edit configuration |
|
|
46
|
+
| `git-smart-flow install-hooks` | — | Install Git hooks |
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## AI Providers
|
|
51
|
+
|
|
52
|
+
| Provider | Cost | Privacy | Requirement |
|
|
53
|
+
|----------|------|---------|-------------|
|
|
54
|
+
| Heuristic (default) | Free | Local | None |
|
|
55
|
+
| Ollama | Free | Local, private | Ollama running locally |
|
|
56
|
+
| GitHub Copilot CLI | Subscription | Remote | `gh copilot` CLI |
|
|
57
|
+
| OpenAI API | Pay-per-use | Remote | `OPENAI_API_KEY` |
|
|
58
|
+
| Claude API | Pay-per-use | Remote | `ANTHROPIC_API_KEY` |
|
|
59
|
+
|
|
60
|
+
Configure with `git-smart-flow setup` or `git-smart-flow config`.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Project Structure
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
src/
|
|
68
|
+
cli.ts Entry point
|
|
69
|
+
commands/ One file per command
|
|
70
|
+
config/ Config loading and merging
|
|
71
|
+
git/ Git operations, convention detection, AI context builder
|
|
72
|
+
providers/ AI providers (heuristic, ollama, openai, claude, copilot)
|
|
73
|
+
security/ Secret and sensitive file scanner
|
|
74
|
+
types/ Shared TypeScript interfaces
|
|
75
|
+
ux/ Display, prompts, spinner, menus
|
|
76
|
+
tests/ Node.js native test runner
|
|
77
|
+
scripts/ prepare-release.ts, smoke-test.sh
|
|
78
|
+
installers/ macOS, Linux, Windows install scripts
|
|
79
|
+
docs/ User documentation
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Local Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
git clone https://github.com/anir-dev/git-smart-flow.git
|
|
88
|
+
cd git-smart-flow
|
|
89
|
+
npm install
|
|
90
|
+
npm run build
|
|
91
|
+
npm link # makes gsf / git-smart-flow available globally
|
|
92
|
+
gsf --version
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Testing
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm test # 48 unit tests with Node.js native runner
|
|
101
|
+
npm run smoke # End-to-end smoke test in a temp repo
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Release
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Local release preparation (build + test + npm pack + standalone binaries)
|
|
110
|
+
npm run prepare-release
|
|
111
|
+
|
|
112
|
+
# Publish (requires npm login and git tag)
|
|
113
|
+
npm run release
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
CI automatically publishes to npm and creates a GitHub Release when a `v*` tag is pushed.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Contributing
|
|
121
|
+
|
|
122
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
123
|
+
|
|
124
|
+
## Security
|
|
125
|
+
|
|
126
|
+
See [SECURITY.md](SECURITY.md).
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
[MIT](LICENSE) — 2025 YOUR_NAME
|
package/bin/gsf.js
ADDED
package/bin/gsfc.js
ADDED
package/bin/gsfm.js
ADDED
package/bin/gsfp.js
ADDED
package/bin/gsfpr.js
ADDED
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { readFileSync } from 'fs';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
import { spawnSync as _gitPassSpawn } from 'child_process';
|
|
6
|
+
import { printStatusBar } from './ux/statusbar.js';
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('git-smart-flow')
|
|
13
|
+
.description('Interactive CLI to manage Git workflows guided, safe and smart')
|
|
14
|
+
.version(pkg.version, '-v, --version', 'Show version number')
|
|
15
|
+
.action(async () => {
|
|
16
|
+
const { runMenu } = await import('./commands/menu.js');
|
|
17
|
+
await runMenu();
|
|
18
|
+
});
|
|
19
|
+
program
|
|
20
|
+
.command('setup')
|
|
21
|
+
.description('Interactive setup wizard')
|
|
22
|
+
.action(async () => {
|
|
23
|
+
const { runSetup } = await import('./commands/setup.js');
|
|
24
|
+
await runSetup();
|
|
25
|
+
});
|
|
26
|
+
program
|
|
27
|
+
.command('menu')
|
|
28
|
+
.description('Open interactive main menu')
|
|
29
|
+
.action(async () => {
|
|
30
|
+
const { runMenu } = await import('./commands/menu.js');
|
|
31
|
+
await runMenu();
|
|
32
|
+
});
|
|
33
|
+
program
|
|
34
|
+
.command('branch')
|
|
35
|
+
.description('Branch manager: create, switch, list, delete, rename')
|
|
36
|
+
.action(async () => {
|
|
37
|
+
const { runBranch } = await import('./commands/branch.js');
|
|
38
|
+
await runBranch();
|
|
39
|
+
});
|
|
40
|
+
program
|
|
41
|
+
.command('commit')
|
|
42
|
+
.description('Guided commit assistant')
|
|
43
|
+
.action(async () => {
|
|
44
|
+
const { runCommit } = await import('./commands/commit.js');
|
|
45
|
+
await runCommit();
|
|
46
|
+
});
|
|
47
|
+
program
|
|
48
|
+
.command('commit-message')
|
|
49
|
+
.description('Generate a commit message without committing')
|
|
50
|
+
.option('--no-ai', 'Force heuristic provider (no AI)')
|
|
51
|
+
.option('--show-prompt', 'Show AI prompt before sending')
|
|
52
|
+
.option('--output-only', 'Print message to stdout only (for scripting)')
|
|
53
|
+
.action(async (options) => {
|
|
54
|
+
const { runCommitMessage } = await import('./commands/commit-message.js');
|
|
55
|
+
await runCommitMessage(options);
|
|
56
|
+
});
|
|
57
|
+
program
|
|
58
|
+
.command('pr')
|
|
59
|
+
.description('Generate PR title and description')
|
|
60
|
+
.action(async () => {
|
|
61
|
+
const { runPR } = await import('./commands/pr.js');
|
|
62
|
+
await runPR();
|
|
63
|
+
});
|
|
64
|
+
program
|
|
65
|
+
.command('validate')
|
|
66
|
+
.description('Validate repository state')
|
|
67
|
+
.action(async () => {
|
|
68
|
+
const { runValidate } = await import('./commands/validate.js');
|
|
69
|
+
await runValidate();
|
|
70
|
+
});
|
|
71
|
+
program
|
|
72
|
+
.command('push')
|
|
73
|
+
.description('Validated push with confirmation')
|
|
74
|
+
.option('--dry-run', 'Preview push without executing')
|
|
75
|
+
.option('--yes', 'Skip confirmation prompts')
|
|
76
|
+
.action(async (opts) => {
|
|
77
|
+
const { runPush } = await import('./commands/push.js');
|
|
78
|
+
await runPush(opts);
|
|
79
|
+
});
|
|
80
|
+
program
|
|
81
|
+
.command('merge')
|
|
82
|
+
.description('Assisted merge with conflict handling')
|
|
83
|
+
.option('--dry-run', 'Preview merge without executing')
|
|
84
|
+
.option('--yes', 'Skip confirmation prompts')
|
|
85
|
+
.action(async (opts) => {
|
|
86
|
+
const { runMerge } = await import('./commands/merge.js');
|
|
87
|
+
await runMerge(opts);
|
|
88
|
+
});
|
|
89
|
+
program
|
|
90
|
+
.command('doctor')
|
|
91
|
+
.description('Full environment diagnostic')
|
|
92
|
+
.action(async () => {
|
|
93
|
+
const { runDoctor } = await import('./commands/doctor.js');
|
|
94
|
+
await runDoctor();
|
|
95
|
+
});
|
|
96
|
+
program
|
|
97
|
+
.command('config')
|
|
98
|
+
.description('Edit global and local configuration')
|
|
99
|
+
.action(async () => {
|
|
100
|
+
const { runConfig } = await import('./commands/config.js');
|
|
101
|
+
await runConfig();
|
|
102
|
+
});
|
|
103
|
+
program
|
|
104
|
+
.command('aliases')
|
|
105
|
+
.description('Manage optional command aliases and hooks')
|
|
106
|
+
.action(async () => {
|
|
107
|
+
const { runAliases } = await import('./commands/aliases.js');
|
|
108
|
+
await runAliases();
|
|
109
|
+
});
|
|
110
|
+
program
|
|
111
|
+
.command('install-hooks')
|
|
112
|
+
.description('Install Git hooks in .git/hooks/')
|
|
113
|
+
.action(async () => {
|
|
114
|
+
const { runInstallHooks } = await import('./commands/install-hooks.js');
|
|
115
|
+
await runInstallHooks();
|
|
116
|
+
});
|
|
117
|
+
program
|
|
118
|
+
.command('repo-init')
|
|
119
|
+
.description('Repository setup wizard: branch, identity, .gitignore, remote, hooks, protection')
|
|
120
|
+
.action(async () => {
|
|
121
|
+
const { runRepoInit } = await import('./commands/repo-init.js');
|
|
122
|
+
await runRepoInit();
|
|
123
|
+
});
|
|
124
|
+
program
|
|
125
|
+
.command('sync')
|
|
126
|
+
.description('Fetch from remote, show ahead/behind status, pull or resolve conflicts')
|
|
127
|
+
.action(async () => {
|
|
128
|
+
const { runSync } = await import('./commands/sync.js');
|
|
129
|
+
await runSync();
|
|
130
|
+
});
|
|
131
|
+
program
|
|
132
|
+
.command('revert')
|
|
133
|
+
.description('Undo / revert wizard: remove bad files, reset commits, revert to remote…')
|
|
134
|
+
.option('--dry-run', 'Preview undo operations without executing')
|
|
135
|
+
.option('--yes', 'Skip confirmation prompts')
|
|
136
|
+
.action(async (opts) => {
|
|
137
|
+
const { runRevert } = await import('./commands/revert.js');
|
|
138
|
+
await runRevert(opts);
|
|
139
|
+
});
|
|
140
|
+
program
|
|
141
|
+
.command('info')
|
|
142
|
+
.description('Show current repository context')
|
|
143
|
+
.action(async () => {
|
|
144
|
+
const { runInfo } = await import('./commands/info.js');
|
|
145
|
+
await runInfo();
|
|
146
|
+
});
|
|
147
|
+
program
|
|
148
|
+
.command('log')
|
|
149
|
+
.description('Show commit history graph')
|
|
150
|
+
.action(async () => {
|
|
151
|
+
const { runLog } = await import('./commands/log.js');
|
|
152
|
+
await runLog();
|
|
153
|
+
});
|
|
154
|
+
program
|
|
155
|
+
.command('stash')
|
|
156
|
+
.description('Stash manager: save, list, apply, drop')
|
|
157
|
+
.action(async () => {
|
|
158
|
+
const { runStash } = await import('./commands/stash.js');
|
|
159
|
+
await runStash();
|
|
160
|
+
});
|
|
161
|
+
program
|
|
162
|
+
.command('tag')
|
|
163
|
+
.description('Tag manager: list, create, delete, push tags')
|
|
164
|
+
.action(async () => {
|
|
165
|
+
const { runTag } = await import('./commands/tag.js');
|
|
166
|
+
await runTag();
|
|
167
|
+
});
|
|
168
|
+
program
|
|
169
|
+
.command('reflog')
|
|
170
|
+
.description('Reflog viewer and commit recovery')
|
|
171
|
+
.action(async () => {
|
|
172
|
+
const { runReflog } = await import('./commands/reflog.js');
|
|
173
|
+
await runReflog();
|
|
174
|
+
});
|
|
175
|
+
// ── Status bar — printed before every command action ──────────────────────
|
|
176
|
+
program.hook('preAction', () => {
|
|
177
|
+
printStatusBar();
|
|
178
|
+
});
|
|
179
|
+
// ── Git passthrough — unknown commands delegate to git ─────────────────────
|
|
180
|
+
const GSF_COMMANDS = new Set([
|
|
181
|
+
'setup',
|
|
182
|
+
'menu',
|
|
183
|
+
'branch',
|
|
184
|
+
'commit',
|
|
185
|
+
'commit-message',
|
|
186
|
+
'pr',
|
|
187
|
+
'validate',
|
|
188
|
+
'push',
|
|
189
|
+
'merge',
|
|
190
|
+
'doctor',
|
|
191
|
+
'config',
|
|
192
|
+
'aliases',
|
|
193
|
+
'install-hooks',
|
|
194
|
+
'repo-init',
|
|
195
|
+
'sync',
|
|
196
|
+
'revert',
|
|
197
|
+
'info',
|
|
198
|
+
'log',
|
|
199
|
+
'stash',
|
|
200
|
+
'tag',
|
|
201
|
+
'reflog',
|
|
202
|
+
]);
|
|
203
|
+
const _passthroughArg = process.argv[2];
|
|
204
|
+
if (_passthroughArg && !GSF_COMMANDS.has(_passthroughArg) && !_passthroughArg.startsWith('-')) {
|
|
205
|
+
const _gitArgs = process.argv.slice(2);
|
|
206
|
+
const _isTTY = process.stderr.isTTY;
|
|
207
|
+
const _dim = _isTTY ? '\x1b[2m' : '';
|
|
208
|
+
const _reset = _isTTY ? '\x1b[0m' : '';
|
|
209
|
+
process.stderr.write(`${_dim} (gsf → git ${_gitArgs.join(' ')})${_reset}\n`);
|
|
210
|
+
const _r = _gitPassSpawn('git', _gitArgs, { stdio: 'inherit' });
|
|
211
|
+
process.exit(_r.status ?? 0);
|
|
212
|
+
}
|
|
213
|
+
program.parse(process.argv);
|
|
214
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,GAAG,GAAG,IAAI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getConfig, saveGlobalConfig } from '../config/config.js';
|
|
2
|
+
import { blank, keyValue, section, success } from '../ux/display.js';
|
|
3
|
+
import { confirmPrompt } from '../ux/prompt.js';
|
|
4
|
+
import { runInstallHooks } from './install-hooks.js';
|
|
5
|
+
export async function runAliases() {
|
|
6
|
+
const config = getConfig();
|
|
7
|
+
section('Aliases & Hooks');
|
|
8
|
+
blank();
|
|
9
|
+
const aliases = [
|
|
10
|
+
['gsfc', 'gsfc → git-smart-flow commit'],
|
|
11
|
+
['gsfm', 'gsfm → git-smart-flow merge'],
|
|
12
|
+
['gsfp', 'gsfp → git-smart-flow push'],
|
|
13
|
+
['gsfpr', 'gsfpr → git-smart-flow pr'],
|
|
14
|
+
['gsfs', 'gsfs → git-smart-flow sync'],
|
|
15
|
+
['gsfr', 'gsfr → git-smart-flow revert'],
|
|
16
|
+
['gsfb', 'gsfb → git-smart-flow branch'],
|
|
17
|
+
['gsft', 'gsft → git-smart-flow tag'],
|
|
18
|
+
];
|
|
19
|
+
for (const [key, label] of aliases) {
|
|
20
|
+
keyValue(label, config.aliases[key] ? 'enabled' : 'disabled');
|
|
21
|
+
}
|
|
22
|
+
blank();
|
|
23
|
+
for (const [key, _label] of aliases) {
|
|
24
|
+
const current = config.aliases[key];
|
|
25
|
+
const toggle = await confirmPrompt(`${current ? 'Disable' : 'Enable'} "${key}" alias?`, false);
|
|
26
|
+
if (toggle) {
|
|
27
|
+
config.aliases[key] = !current;
|
|
28
|
+
success(`${key} ${config.aliases[key] ? 'enabled' : 'disabled'}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
saveGlobalConfig(config);
|
|
32
|
+
blank();
|
|
33
|
+
const installHooksNow = await confirmPrompt('Install Git hooks (commit-msg, pre-push) in current repo?', false);
|
|
34
|
+
if (installHooksNow)
|
|
35
|
+
await runInstallHooks();
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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