@hallaxius/forge 0.1.3 → 0.1.4
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/README.md +160 -158
- package/bin/forge.js +2 -2
- package/dist/cli.js +12764 -13800
- package/package.json +75 -75
- package/src/cli.ts +80 -78
- package/src/commands/account.ts +80 -0
- package/src/commands/alias.ts +66 -66
- package/src/commands/branch.ts +46 -46
- package/src/commands/ci.ts +28 -28
- package/src/commands/clone.ts +100 -100
- package/src/commands/commit.ts +88 -88
- package/src/commands/config.ts +47 -48
- package/src/commands/diff.ts +26 -26
- package/src/commands/fetch.ts +20 -20
- package/src/commands/help.ts +58 -58
- package/src/commands/init.ts +32 -33
- package/src/commands/issue.ts +63 -63
- package/src/commands/log.ts +29 -29
- package/src/commands/merge.ts +37 -37
- package/src/commands/pr.ts +65 -65
- package/src/commands/push.ts +35 -35
- package/src/commands/release.ts +26 -26
- package/src/commands/remote.ts +107 -107
- package/src/commands/reset.ts +30 -30
- package/src/commands/setup.ts +93 -94
- package/src/commands/stash.ts +44 -44
- package/src/commands/status.ts +74 -74
- package/src/commands/sync.ts +20 -20
- package/src/commands/tag.ts +41 -41
- package/src/commands/undo.ts +27 -27
- package/src/commands/version.ts +12 -12
- package/src/constants/colors.ts +7 -7
- package/src/constants/commit-types.ts +24 -24
- package/src/constants/messages.ts +13 -23
- package/src/lib/auth.ts +172 -172
- package/src/lib/config.ts +108 -108
- package/src/lib/git.ts +543 -543
- package/src/lib/github.ts +202 -160
- package/src/lib/logger.ts +18 -31
- package/src/lib/ui.ts +122 -156
- package/src/lib/validators.ts +16 -16
- package/src/templates/commit-types.json +9 -9
- package/src/utils/files.ts +21 -21
- package/src/utils/strings.ts +19 -19
- package/src/version.const.ts +1 -1
package/README.md
CHANGED
|
@@ -1,159 +1,161 @@
|
|
|
1
|
-
# @hallaxius/forge
|
|
2
|
-
|
|
3
|
-
A modern Git CLI with professional UX
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@hallaxius/forge) [](https://opensource.org/licenses/MIT)
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
Requires [Bun](https://bun.sh) (recommended) or Node.js >= 18.0.0.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# Using npm
|
|
13
|
-
npm install -g @hallaxius/forge
|
|
14
|
-
|
|
15
|
-
# Using bun
|
|
16
|
-
bun install -g @hallaxius/forge
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Configuration Tutorial (`fg setup`)
|
|
20
|
-
|
|
21
|
-
Run `fg setup` and follow the interactive steps:
|
|
22
|
-
|
|
23
|
-
1. **Name** — your name for commits
|
|
24
|
-
2. **Email** — your email for commits
|
|
25
|
-
3. **GitHub Token** (optional) — for authenticated operations
|
|
26
|
-
4. **Encrypt token?** — if yes, set a master password (AES-GCM)
|
|
27
|
-
5. **Verification** — confirms Git is installed
|
|
28
|
-
|
|
29
|
-
Config saved to `~/.forge/config.json`. Token is encrypted.
|
|
30
|
-
|
|
31
|
-
To reconfigure: run `fg setup` again.
|
|
32
|
-
|
|
33
|
-
## Commands (
|
|
34
|
-
|
|
35
|
-
### Configuration
|
|
36
|
-
| Command | Description |
|
|
37
|
-
|---------|-------------|
|
|
38
|
-
| `fg setup` | Initial interactive configuration |
|
|
39
|
-
| `fg config` | Show current config |
|
|
40
|
-
| `fg config --edit` | Open in `$EDITOR` (vim default) |
|
|
41
|
-
| `fg reset` | Delete all configuration (with confirmation) |
|
|
42
|
-
| `fg version` | Show version |
|
|
43
|
-
| `fg help` | Full help |
|
|
44
|
-
| `fg --help` | Quick help |
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| `fg
|
|
51
|
-
| `fg
|
|
52
|
-
| `fg remote
|
|
53
|
-
| `fg remote
|
|
54
|
-
| `fg remote
|
|
55
|
-
| `fg remote
|
|
56
|
-
| `fg remote
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
| `fg
|
|
63
|
-
| `fg
|
|
64
|
-
| `fg
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
| `fg branch
|
|
71
|
-
| `fg branch -
|
|
72
|
-
| `fg branch -
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
| `fg
|
|
79
|
-
| `fg
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
| `fg
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| `fg stash
|
|
92
|
-
| `fg stash --
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
| `fg tag
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| `fg
|
|
105
|
-
| `fg
|
|
106
|
-
| `fg
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
| `fg
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
|
118
|
-
|
|
119
|
-
| `fg
|
|
120
|
-
| `fg
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
|
126
|
-
|
|
127
|
-
| `fg
|
|
128
|
-
| `fg
|
|
129
|
-
| `fg
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
# @hallaxius/forge
|
|
2
|
+
|
|
3
|
+
A modern Git CLI with professional UX
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@hallaxius/forge) [](https://opensource.org/licenses/MIT) [](https://www.npmjs.com/package/@hallaxius/forge) [](https://www.npmjs.com/package/@hallaxius/forge) [](https://github.com/hallaxius/forge/stargazers) [](https://github.com/hallaxius/forge/network) [](https://github.com/hallaxius/forge/issues) [](https://github.com/hallaxius/forge/issues?q=is%3Aissue+is%3Aclosed) [](https://bun.sh) [](https://nodejs.org) [](https://www.typescriptlang.org) [](https://codecov.io/gh/hallaxius/forge) [](https://github.com/hallaxius/forge/commits)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Requires [Bun](https://bun.sh) (recommended) or Node.js >= 18.0.0.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Using npm
|
|
13
|
+
npm install -g @hallaxius/forge
|
|
14
|
+
|
|
15
|
+
# Using bun
|
|
16
|
+
bun install -g @hallaxius/forge
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Configuration Tutorial (`fg setup`)
|
|
20
|
+
|
|
21
|
+
Run `fg setup` and follow the interactive steps:
|
|
22
|
+
|
|
23
|
+
1. **Name** — your name for commits
|
|
24
|
+
2. **Email** — your email for commits
|
|
25
|
+
3. **GitHub Token** (optional) — for authenticated operations
|
|
26
|
+
4. **Encrypt token?** — if yes, set a master password (AES-GCM)
|
|
27
|
+
5. **Verification** — confirms Git is installed
|
|
28
|
+
|
|
29
|
+
Config saved to `~/.forge/config.json`. Token is encrypted.
|
|
30
|
+
|
|
31
|
+
To reconfigure: run `fg setup` again.
|
|
32
|
+
|
|
33
|
+
## Commands (30)
|
|
34
|
+
|
|
35
|
+
### Configuration
|
|
36
|
+
| Command | Description |
|
|
37
|
+
|---------|-------------|
|
|
38
|
+
| `fg setup` | Initial interactive configuration |
|
|
39
|
+
| `fg config` | Show current config |
|
|
40
|
+
| `fg config --edit` | Open in `$EDITOR` (vim default) |
|
|
41
|
+
| `fg reset` | Delete all configuration (with confirmation) |
|
|
42
|
+
| `fg version` | Show version |
|
|
43
|
+
| `fg help` | Full help |
|
|
44
|
+
| `fg --help` | Quick help |
|
|
45
|
+
| `fg account` | Display account information (local and GitHub) |
|
|
46
|
+
|
|
47
|
+
### Repositories
|
|
48
|
+
| Command | Description |
|
|
49
|
+
|---------|-------------|
|
|
50
|
+
| `fg clone <url\|org/repo> [dir] [--ssh] [--depth N] [--branch X] [--recurse-submodules] [--cd]` | Clone repo; supports `org/repo` shorthand; `--cd` prints `cd dir` for `eval` |
|
|
51
|
+
| `fg init [dir] [--initial-commit] [--branch main]` | Initialize repo; `--initial-commit` creates empty commit |
|
|
52
|
+
| `fg remote` | List remotes |
|
|
53
|
+
| `fg remote add <name> <url>` | Add remote |
|
|
54
|
+
| `fg remote remove <name>` | Remove remote (asks confirmation) |
|
|
55
|
+
| `fg remote set-url <name> <url>` | Change remote URL |
|
|
56
|
+
| `fg remote rename <old> <new>` | Rename remote |
|
|
57
|
+
| `fg remote get-url <name>` | Show remote URL |
|
|
58
|
+
|
|
59
|
+
### Commits
|
|
60
|
+
| Command | Description |
|
|
61
|
+
|---------|-------------|
|
|
62
|
+
| `fg commit [-m "msg"] [--amend]` | Interactive commit (type, scope, description) or quick with `-m`; `--amend` amends last |
|
|
63
|
+
| `fg undo` | Undo last commit keeping changes (soft reset) |
|
|
64
|
+
| `fg log [-n 10]` | Formatted history (hash, date, author, message) |
|
|
65
|
+
| `fg diff [--staged]` | Unstaged or staged diff |
|
|
66
|
+
|
|
67
|
+
### Branches
|
|
68
|
+
| Command | Description |
|
|
69
|
+
|---------|-------------|
|
|
70
|
+
| `fg branch` | List branches (current marked with `*`) |
|
|
71
|
+
| `fg branch -n <name>` | Create new branch |
|
|
72
|
+
| `fg branch -d <name> [--force]` | Delete branch (`--force` = `-D`) |
|
|
73
|
+
| `fg branch -s <name>` | Switch to branch |
|
|
74
|
+
|
|
75
|
+
### Push / Pull / Sync
|
|
76
|
+
| Command | Description |
|
|
77
|
+
|---------|-------------|
|
|
78
|
+
| `fg push [--force]` | Push to origin (confirms first; `--force` requires extra confirmation) |
|
|
79
|
+
| `fg sync` | Pull with rebase (`git pull --rebase`) |
|
|
80
|
+
| `fg fetch` | Fetch from remote |
|
|
81
|
+
|
|
82
|
+
### Status
|
|
83
|
+
| Command | Description |
|
|
84
|
+
|---------|-------------|
|
|
85
|
+
| `fg status` | Branch, ahead/behind, modified files (table), last 3 commits |
|
|
86
|
+
| `fg st` | Short status |
|
|
87
|
+
|
|
88
|
+
### Stash
|
|
89
|
+
| Command | Description |
|
|
90
|
+
|---------|-------------|
|
|
91
|
+
| `fg stash` | Save stash (prompts for message) |
|
|
92
|
+
| `fg stash --pop` | Apply and drop latest stash |
|
|
93
|
+
| `fg stash --list` | List stashes |
|
|
94
|
+
|
|
95
|
+
### Tags
|
|
96
|
+
| Command | Description |
|
|
97
|
+
|---------|-------------|
|
|
98
|
+
| `fg tag -n <name> [-m "msg"]` | Create tag (annotated with `-m`) |
|
|
99
|
+
| `fg tag --list` | List tags |
|
|
100
|
+
|
|
101
|
+
### Merge / Cherry-pick
|
|
102
|
+
| Command | Description |
|
|
103
|
+
|---------|-------------|
|
|
104
|
+
| `fg merge <branch> [--no-ff] [--squash] [--no-commit]` | Merge with options |
|
|
105
|
+
| `fg cherry-pick <commits...> [--no-commit] [--mainline N]` | Apply commits |
|
|
106
|
+
| `fg cherry-pick --continue` | Continue after conflict |
|
|
107
|
+
| `fg cherry-pick --abort` | Abort cherry-pick |
|
|
108
|
+
|
|
109
|
+
### Clean
|
|
110
|
+
| Command | Description |
|
|
111
|
+
|---------|-------------|
|
|
112
|
+
| `fg clean [paths...] [--dry-run] [--force] [--exclude pattern]` | Remove untracked files; `--dry-run` shows only; without `--force` asks confirmation |
|
|
113
|
+
|
|
114
|
+
### GitHub Integration
|
|
115
|
+
| Command | Description |
|
|
116
|
+
|---------|-------------|
|
|
117
|
+
| `fg ci` | Check CI status for the repository |
|
|
118
|
+
| `fg issue list [-s, --state <state>]` | List GitHub issues (filter by state: open, closed, all) |
|
|
119
|
+
| `fg issue create [-t, --title <title>]` | Create a new GitHub issue |
|
|
120
|
+
| `fg pr list [-s, --state <state>]` | List pull requests (filter by state: open, closed, all) |
|
|
121
|
+
| `fg pr create [-t, --title <title>] [-H, --head <branch>] [-B, --base <branch>]` | Create a new pull request |
|
|
122
|
+
| `fg release <tag> [-n, --name <name>]` | Create a GitHub release |
|
|
123
|
+
|
|
124
|
+
### Aliases
|
|
125
|
+
| Command | Description |
|
|
126
|
+
|---------|-------------|
|
|
127
|
+
| `fg alias add <name> <command>` | Add alias (e.g., `fg alias add g commit`) |
|
|
128
|
+
| `fg alias list` | List aliases |
|
|
129
|
+
| `fg alias remove <name>` | Remove alias |
|
|
130
|
+
|
|
131
|
+
## Configuration
|
|
132
|
+
|
|
133
|
+
File: `~/.forge/config.json`
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"user": { "name": "", "email": "" },
|
|
138
|
+
"github": { "token": "encrypted" },
|
|
139
|
+
"preferences": { "autoPush": false, "commitTemplate": "conventional", "editor": "vim" },
|
|
140
|
+
"clones": [],
|
|
141
|
+
"aliases": {}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
- GitHub token encrypted with AES-GCM (Web Crypto API)
|
|
146
|
+
- `clones`: last 10 clones for `fg clone --list`
|
|
147
|
+
- `aliases`: custom shortcuts
|
|
148
|
+
|
|
149
|
+
## Dependencies
|
|
150
|
+
|
|
151
|
+
- **[Bun](https://bun.sh)** (recommended) or **Node.js >= 18.0.0**
|
|
152
|
+
- **[@octokit/rest](https://github.com/octokit/rest.js)** - GitHub API client
|
|
153
|
+
- **[isomorphic-git](https://github.com/isomorphic-git/isomorphic-git)** - Git operations
|
|
154
|
+
- **[commander](https://github.com/tj/commander.js)** - CLI framework
|
|
155
|
+
- **[inquirer](https://github.com/SBoudrias/Inquirer.js)** - Interactive prompts
|
|
156
|
+
- **[chalk](https://github.com/chalk/chalk)** - Terminal colors
|
|
157
|
+
- **[ora](https://github.com/sindresorhus/ora)** - Spinners
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
159
161
|
MIT
|
package/bin/forge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
import "../dist/cli.js";
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import "../dist/cli.js";
|