zapdev 1.0.0 → 1.1.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/README.md +17 -29
- package/dist/cli.js +1725 -1996
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**zapdev** is a lightweight TypeScript CLI that makes small, repetitive Git chores fast and precise.
|
|
6
6
|
|
|
7
|
-
It stages changes, scans them for secrets, generates Conventional Commit messages
|
|
7
|
+
It stages changes, scans them for secrets, and generates Conventional Commit messages for one repository or several direct child repositories in a single review flow.
|
|
8
8
|
|
|
9
9
|
## Project Architecture
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ flowchart LR
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
- `src/index.ts`: bin launcher; enables the V8 compile cache, then loads `cli.js`.
|
|
23
|
-
- `src/cli.ts`: CLI entry; registers
|
|
23
|
+
- `src/cli.ts`: CLI entry; registers `commit` as the default command.
|
|
24
24
|
- `src/commands/`: command UI and orchestration.
|
|
25
25
|
- `src/lib/`: pure logic and isolated Git, Gitleaks, and LLM side effects.
|
|
26
26
|
- `src/prompts/`: LLM prompts inlined into the bundle at build time.
|
|
@@ -34,7 +34,7 @@ flowchart LR
|
|
|
34
34
|
| `ZD_MODEL` | For `commit` | Model identifier supported by the endpoint |
|
|
35
35
|
| `ZD_EFFORT` | For `commit` | Sent as `reasoning_effort`; use a value supported by your model, such as `low`, `medium`, or `high` |
|
|
36
36
|
|
|
37
|
-
There are no defaults, automatic provider detection, or backup models. CLI flags override these variables. Legacy `OLLAMA_*` variables are no longer read.
|
|
37
|
+
There are no defaults, automatic provider detection, or backup models. CLI flags override these variables. Legacy `OLLAMA_*` variables are no longer read.
|
|
38
38
|
|
|
39
39
|
Requests use the OpenAI Chat Completions format over plain `fetch`, without a provider SDK. No authentication headers are sent; use an endpoint that does not require them. The endpoint and model must support `reasoning_effort`.
|
|
40
40
|
|
|
@@ -86,11 +86,18 @@ npm run build # bundle to dist/ with esbuild
|
|
|
86
86
|
|
|
87
87
|
## Usage
|
|
88
88
|
|
|
89
|
-
Run `zapdev`
|
|
89
|
+
Run `zapdev` or `zapdev commit` to start the commit flow. Both accept the flags below.
|
|
90
90
|
|
|
91
91
|
### `zapdev commit`
|
|
92
92
|
|
|
93
|
-
Stages all changes, scans them with Gitleaks when installed, generates
|
|
93
|
+
Stages all changes, scans them with Gitleaks when installed, generates Conventional Commit messages, and optionally pushes the commits.
|
|
94
|
+
|
|
95
|
+
- **Inside a Git repository:** uses that repository only, including when launched from a subdirectory. Does not inspect child repositories.
|
|
96
|
+
- **Outside a Git repository:** processes only direct child repositories. No recursive search; `node_modules` is excluded.
|
|
97
|
+
- **Unified review:** generates messages in parallel, then presents every message with its repository name.
|
|
98
|
+
- **Actions:** commit all, commit only a named repository, edit a named repository's message, or cancel. Editing returns to the review menu.
|
|
99
|
+
|
|
100
|
+
Repositories with nothing to commit are skipped. Unselected or cancelled changes remain staged. Push confirmation is asked once for the successfully committed repositories.
|
|
94
101
|
|
|
95
102
|
```bash
|
|
96
103
|
zapdev commit
|
|
@@ -106,18 +113,20 @@ zapdev commit
|
|
|
106
113
|
| `-s, --staged` | Commit only changes that are already staged |
|
|
107
114
|
| `-r, --rebase` | Rebase on upstream if the push is rejected |
|
|
108
115
|
| `-m, --merge` | Merge upstream if the push is rejected |
|
|
109
|
-
| `-y, --yes` | Skip prompts and commit
|
|
116
|
+
| `-y, --yes` | Skip prompts and commit all prepared repositories |
|
|
110
117
|
|
|
111
118
|
```bash
|
|
112
119
|
zapdev commit -t feat # force the type
|
|
113
120
|
zapdev commit --staged # leave unstaged changes untouched
|
|
114
121
|
```
|
|
115
122
|
|
|
116
|
-
Before contacting the LLM endpoint, zapdev runs `gitleaks git --staged` when Gitleaks is installed. A failed scan
|
|
123
|
+
Before contacting the LLM endpoint, zapdev runs `gitleaks git --staged` in each changed repository when Gitleaks is installed. A failed scan skips that repository without sending its diff; when Gitleaks is absent, the scan is skipped. The staged diff is sent to the configured endpoint, which may be remote.
|
|
124
|
+
|
|
125
|
+
Failures are reported per repository while the others continue. Any failure produces a nonzero exit code.
|
|
117
126
|
|
|
118
127
|
Pushing is optimistic, with no preliminary fetch. If the branch is behind upstream, `--rebase` runs `git pull --rebase`, while `--merge` runs `git pull --no-rebase --no-edit`; zapdev then retries once. Without either flag, interactive runs ask whether to rebase, merge, or quit. Runs using `--yes` or without a TTY must provide one of the flags.
|
|
119
128
|
|
|
120
|
-
Without a TTY, zapdev commits automatically and only pushes when `--push` is set.
|
|
129
|
+
Without a TTY, zapdev commits all prepared repositories automatically and only pushes when `--push` is set.
|
|
121
130
|
|
|
122
131
|
### Zed IDE
|
|
123
132
|
|
|
@@ -151,31 +160,10 @@ Add this entry to Zed's `keymap.json` to run the commit task with `ctrl-cmd-ente
|
|
|
151
160
|
}
|
|
152
161
|
```
|
|
153
162
|
|
|
154
|
-
### `zapdev reset`
|
|
155
|
-
|
|
156
|
-
Operates on a Git repository or the direct child repositories of a directory. It fetches and prunes, switches branch, then permanently removes other local branches and linked worktrees.
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
zapdev reset # reset the current repo or direct child repos
|
|
160
|
-
zapdev reset ~/dev # reset repos under a directory
|
|
161
|
-
zapdev reset -p # switch to the principal branch without prompting
|
|
162
|
-
zapdev reset -t dev # switch to dev or fall back to the principal branch
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
| Flag | Description |
|
|
166
|
-
| ----------------------- | ------------------------------------------------------------------ |
|
|
167
|
-
| `-p, --principal` | Switch every repo to its resolved principal branch (`origin/HEAD`) |
|
|
168
|
-
| `-t, --target <branch>` | Switch to a target branch, falling back to the principal branch |
|
|
169
|
-
| `--pull` | Pull the checked-out branch after reset without asking |
|
|
170
|
-
| `-y, --yes` | Switch and delete without confirmation |
|
|
171
|
-
|
|
172
|
-
Deletion is permanent. Branches are removed with `git branch -D`; worktrees are removed with `git worktree remove --force`. Without a TTY, pass `--yes` or the destructive step is refused. `node_modules` is never scanned.
|
|
173
|
-
|
|
174
163
|
### Shell Aliases
|
|
175
164
|
|
|
176
165
|
```bash
|
|
177
166
|
alias commit="zapdev commit --yes"
|
|
178
|
-
alias git-reset="zapdev reset --yes --principal --pull"
|
|
179
167
|
```
|
|
180
168
|
|
|
181
169
|
## Other
|