zapdev 0.3.0 → 0.5.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 +34 -2
- package/dist/index.js +2357 -1950
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,12 @@ zapdev runs on the [Bun](https://bun.sh) runtime. Install Bun first.
|
|
|
12
12
|
bun add -g zapdev # installs the `zapdev` command globally
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
> If `zapdev: command not found`, Bun's global bin is not on your `PATH`. Add it (zsh):
|
|
16
|
+
>
|
|
17
|
+
> ```sh
|
|
18
|
+
> echo 'export PATH="$HOME/.bun/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
|
|
19
|
+
> ```
|
|
20
|
+
|
|
15
21
|
Or run it once without installing:
|
|
16
22
|
|
|
17
23
|
```bash
|
|
@@ -20,22 +26,46 @@ bunx zapdev commit
|
|
|
20
26
|
|
|
21
27
|
## Usage
|
|
22
28
|
|
|
29
|
+
Run `zapdev` with no command to pick one from an interactive menu (falls back to usage output without a TTY).
|
|
30
|
+
|
|
23
31
|
### `zapdev commit`
|
|
24
32
|
|
|
25
33
|
Stages all changes (`git add -A`), asks an Ollama model for a one-line Conventional Commits message, then lets you commit, edit or cancel, and optionally push.
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
|
-
zapdev commit
|
|
36
|
+
zapdev commit
|
|
29
37
|
```
|
|
30
38
|
|
|
31
39
|
| Flag | Description |
|
|
32
40
|
| --- | --- |
|
|
33
41
|
| `-m, --model <model>` | Override the Ollama model |
|
|
42
|
+
| `-t, --type <type>` | Force the Conventional Commits type (`feat`, `fix`, `chore`, …) |
|
|
34
43
|
| `-p, --push` | Push after committing without asking |
|
|
35
44
|
| `-y, --yes` | Skip prompts and commit directly |
|
|
36
45
|
|
|
46
|
+
```bash
|
|
47
|
+
zapdev commit -t feat # force the type; the model still writes scope + description
|
|
48
|
+
```
|
|
49
|
+
|
|
37
50
|
Without a TTY (piped / CI), it commits automatically and only pushes when `--push` is set.
|
|
38
51
|
|
|
52
|
+
### `zapdev cleanup`
|
|
53
|
+
|
|
54
|
+
Walks a directory for git repos, and for each one: `git fetch --prune`, lets you switch to the default branch (from `origin/HEAD`) or stay on the current one, interactively deletes stale local branches, then optionally pulls.
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
zapdev cleanup # scan the current directory
|
|
58
|
+
zapdev cleanup ~/dev # scan a specific directory
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
| Flag | Description |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| `-s, --stay` | Stay on the current branch instead of switching to the default |
|
|
64
|
+
| `-p, --pull` | Pull the checked-out branch after cleanup without asking |
|
|
65
|
+
| `-y, --yes` | Non-interactive: switch to default and delete every other local branch |
|
|
66
|
+
|
|
67
|
+
Deletion uses `git branch -D` (force). Without a TTY (or with `--yes`), every non-default branch is deleted automatically. The walk prunes at each repo, so submodules and `node_modules` are never scanned.
|
|
68
|
+
|
|
39
69
|
## Configuration
|
|
40
70
|
|
|
41
71
|
| Variable | Default | Description |
|
|
@@ -62,4 +92,6 @@ bun run build # bundle to dist/
|
|
|
62
92
|
|
|
63
93
|
- `src/index.ts` — CLI entry (Citty); registers subcommands, defaults to `commit`.
|
|
64
94
|
- `src/commands/` — one file per command.
|
|
65
|
-
- `src/lib/` — pure logic (`config`, `commit-message`, unit-tested) and side effects (`git`, `ollama`).
|
|
95
|
+
- `src/lib/` — pure logic (`config`, `commit-message`, `branches`, unit-tested) and side effects (`git`, `ollama`); shared helpers (`errors`).
|
|
96
|
+
- `src/prompts/` — LLM prompts as `.md` files, imported as text (`with { type: "text" }`) and inlined into the bundle at build time.
|
|
97
|
+
- `src/types/` — shared type declarations (one file per domain) and ambient module declarations.
|