zapdev 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +27 -2
  2. package/dist/index.js +2324 -1965
  3. package/package.json +1 -1
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,12 +26,14 @@ 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 # `zapdev` alone works too — commit is the default command
36
+ zapdev commit
29
37
  ```
30
38
 
31
39
  | Flag | Description |
@@ -36,6 +44,23 @@ zapdev commit # `zapdev` alone works too — commit is the default command
36
44
 
37
45
  Without a TTY (piped / CI), it commits automatically and only pushes when `--push` is set.
38
46
 
47
+ ### `zapdev cleanup`
48
+
49
+ 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.
50
+
51
+ ```bash
52
+ zapdev cleanup # scan the current directory
53
+ zapdev cleanup ~/dev # scan a specific directory
54
+ ```
55
+
56
+ | Flag | Description |
57
+ | --- | --- |
58
+ | `-s, --stay` | Stay on the current branch instead of switching to the default |
59
+ | `-p, --pull` | Pull the checked-out branch after cleanup without asking |
60
+ | `-y, --yes` | Non-interactive: switch to default and delete every other local branch |
61
+
62
+ 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.
63
+
39
64
  ## Configuration
40
65
 
41
66
  | Variable | Default | Description |
@@ -62,4 +87,4 @@ bun run build # bundle to dist/
62
87
 
63
88
  - `src/index.ts` — CLI entry (Citty); registers subcommands, defaults to `commit`.
64
89
  - `src/commands/` — one file per command.
65
- - `src/lib/` — pure logic (`config`, `commit-message`, unit-tested) and side effects (`git`, `ollama`).
90
+ - `src/lib/` — pure logic (`config`, `commit-message`, `branches`, unit-tested) and side effects (`git`, `ollama`); shared helpers (`errors`).