zapdev 0.8.0 → 0.9.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 +12 -2
  2. package/dist/cli.js +3 -24
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -36,7 +36,6 @@ zapdev commit
36
36
  | --- | --- |
37
37
  | `-m, --model <model>` | Override the Ollama model |
38
38
  | `-t, --type <type>` | Force the Conventional Commits type (`feat`, `fix`, `chore`, …) |
39
- | `--pull` | Rebase onto upstream (`git pull --rebase`) after committing, before pushing |
40
39
  | `-p, --push` | Push after committing without asking |
41
40
  | `-y, --yes` | Skip prompts and commit directly |
42
41
 
@@ -44,7 +43,7 @@ zapdev commit
44
43
  zapdev commit -t feat # force the type; the model still writes scope + description
45
44
  ```
46
45
 
47
- Pushing is optimistic — no preliminary fetch, so the common case stays a single round-trip. If the push is rejected because the branch is behind its upstream, in a TTY it offers to `git pull --rebase` and retry; non-interactively (`--yes` / piped) it stops and asks you to re-run with `--pull`. Pass `--pull` to rebase onto upstream right after the commit (a rebase conflict stops before pushing). `--yes` only silences prompts; it never rebases on its own.
46
+ Pushing is optimistic — no preliminary fetch, so the common case stays a single round-trip. If the push is rejected because the branch is behind its upstream, zapdev automatically runs `git pull --rebase` and retries the push once — no prompt, in every mode. A rebase conflict stops before pushing so you can resolve it, then re-run.
48
47
 
49
48
  Without a TTY (piped / CI), it commits automatically and only pushes when `--push` is set.
50
49
 
@@ -68,6 +67,17 @@ zapdev reset -t dev # switch each repo to `dev` (or principal if absent
68
67
 
69
68
  Deletion is permanent: branches via `git branch -D` (force), worktrees via `git worktree remove --force`. Worktrees are removed first so the branches they held become deletable. Without a TTY, pass `--yes` — otherwise the destructive step is refused. `node_modules` is never scanned.
70
69
 
70
+ ## Shell aliases
71
+
72
+ `--yes` skips every prompt, which is exactly what you want behind a short alias. Two that pay off daily — add them to `~/.zshrc` or `~/.bashrc`:
73
+
74
+ ```bash
75
+ alias commit="zapdev commit --yes" # stage → generate message → commit, no prompts
76
+ alias git-reset="zapdev reset --yes --principal --pull" # switch each repo to its principal branch, wipe the rest, then pull
77
+ ```
78
+
79
+ `commit` collapses the whole stage → message → commit flow into one word. `git-reset` brings a workspace back to a clean principal state in one shot — point it at a parent directory to reset every child repo at once.
80
+
71
81
  ## Configuration
72
82
 
73
83
  | Variable | Default | Description |
package/dist/cli.js CHANGED
@@ -1718,7 +1718,7 @@ function _getBuiltinFlags(long, short, userNames, userAliases) {
1718
1718
  // package.json
1719
1719
  var package_default = {
1720
1720
  name: "zapdev",
1721
- version: "0.8.0",
1721
+ version: "0.9.0",
1722
1722
  description: "Fast, performant and lightweight git chores and dev tools using your terminal and your own local LLM.",
1723
1723
  type: "module",
1724
1724
  bin: {
@@ -2382,10 +2382,6 @@ var commitCommand = defineCommand({
2382
2382
  alias: "t",
2383
2383
  description: `Force the Conventional Commits type (${COMMIT_TYPES.join(", ")}).`
2384
2384
  },
2385
- pull: {
2386
- type: "boolean",
2387
- description: "Rebase onto upstream (git pull --rebase) after committing, before pushing."
2388
- },
2389
2385
  push: {
2390
2386
  type: "boolean",
2391
2387
  alias: "p",
@@ -2471,10 +2467,6 @@ var commitCommand = defineCommand({
2471
2467
  }
2472
2468
  await commit(finalMessage);
2473
2469
  if (interactive) log.success(`Committed: ${finalMessage}`);
2474
- if (args.pull && !await rebaseOnUpstream(interactive)) {
2475
- process.exitCode = 1;
2476
- return;
2477
- }
2478
2470
  let shouldPush = Boolean(args.push);
2479
2471
  if (!shouldPush && interactive && !args.yes) {
2480
2472
  const answer = await confirm({ message: "Push?", initialValue: false });
@@ -2485,7 +2477,7 @@ var commitCommand = defineCommand({
2485
2477
  shouldPush = answer;
2486
2478
  }
2487
2479
  if (shouldPush) {
2488
- const pushed = await pushOptimistic(interactive, Boolean(args.yes));
2480
+ const pushed = await pushOptimistic(interactive);
2489
2481
  if (!pushed) {
2490
2482
  process.exitCode = 1;
2491
2483
  return;
@@ -2495,10 +2487,6 @@ var commitCommand = defineCommand({
2495
2487
  }
2496
2488
  });
2497
2489
  async function rebaseOnUpstream(interactive) {
2498
- if (!await hasUpstream()) {
2499
- log.info("No upstream to pull from; skipping --pull.");
2500
- return true;
2501
- }
2502
2490
  const loader = interactive ? spinner() : void 0;
2503
2491
  loader?.start("Pulling --rebase");
2504
2492
  try {
@@ -2511,21 +2499,12 @@ async function rebaseOnUpstream(interactive) {
2511
2499
  return false;
2512
2500
  }
2513
2501
  }
2514
- async function pushOptimistic(interactive, assumeYes) {
2502
+ async function pushOptimistic(interactive) {
2515
2503
  const [upstream, branch] = await Promise.all([hasUpstream(), currentBranch()]);
2516
2504
  const doPush = () => upstream ? push() : pushSetUpstream(branch);
2517
2505
  const first = await tryPush(interactive, doPush);
2518
2506
  if (first.ok) return true;
2519
2507
  if (upstream && await isBehind(interactive)) {
2520
- if (assumeYes || !interactive) {
2521
- log.error("Behind upstream \u2014 re-run with --pull to rebase and push.");
2522
- return false;
2523
- }
2524
- const answer = await confirm({ message: "Pull --rebase and retry push?", initialValue: true });
2525
- if (isCancel(answer) || !answer) {
2526
- log.info("Not pushed (still behind).");
2527
- return true;
2528
- }
2529
2508
  if (!await rebaseOnUpstream(interactive)) return false;
2530
2509
  const retry = await tryPush(interactive, doPush);
2531
2510
  if (retry.ok) return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapdev",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Fast, performant and lightweight git chores and dev tools using your terminal and your own local LLM.",
5
5
  "type": "module",
6
6
  "bin": {