tend-cli 0.1.0 → 0.1.1

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 (2) hide show
  1. package/README.md +51 -61
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,95 +1,85 @@
1
1
  # tend
2
2
 
3
- > Tend your code now so it never becomes an overgrown mess.
3
+ ![status: alpha](https://img.shields.io/badge/status-alpha-yellow)
4
4
 
5
- An open-source CLI that audits a JS/TS repo with established scanners, then fixes the
6
- findings with parallel AI sessions in a safe **scan → fix → re-scan** loop. It never
7
- commits — fixes are left as uncommitted edits for you to review.
5
+ *Tend your code now so it never becomes an overgrown mess.*
8
6
 
9
- ```bash
10
- npx tend-cli # snapshot audit fix loop report (changed files)
11
- npx tend-cli --all # fix the entire backlog, not just changed files
12
- ```
7
+ > [!NOTE]
8
+ > **Early days (v0.x).** tend works, but it's young flags and config may still
9
+ > change before 1.0. As with any tool that edits code, run it on a committed repo
10
+ > and review the changes. Feedback and issues are very welcome.
11
+
12
+ An open-source CLI that audits a JS/TS repo with standard scanners, then fixes the findings
13
+ with parallel AI sessions in a safe **scan → fix → re-scan** loop. It never commits — fixes
14
+ land as uncommitted edits for you to review.
13
15
 
14
- ## Why
16
+ ## Quick start
15
17
 
16
- Every team already has scanners. What they don't have is the time to act on 200
17
- findings. tend closes the loop: **deterministic detection → AI fix → deterministic
18
- verification**. Machines find and check; the model only does the edit. The worst case
19
- is "tend changed nothing," never "tend broke your code."
18
+ ```bash
19
+ npx tend-cli # changed files vs HEAD (the default)
20
+ npx tend-cli src/app lib/ # only findings under these paths
21
+ npx tend-cli --all # the entire backlog, repo-wide
22
+ ```
20
23
 
21
- ## What it runs
24
+ Requires **Node 20** and a git repo. Review the edits with `tend diff`; undo the whole run
25
+ with `tend undo`.
22
26
 
23
- | Category | Tools | Action |
24
- |----------|-------|--------|
25
- | AI fix loop | `eslint`+`sonarjs`, `knip`, `jscpd`, `semgrep` | findings fed to AI sessions |
26
- | Deterministic | `osv-scanner` | dependency version bumps, no AI |
27
- | Report-and-halt | `gitleaks` | secrets surfaced loudly, never AI-touched; exit non-zero |
27
+ ## What it does
28
28
 
29
- **`eslint`+`sonarjs`, `knip`, and `jscpd` ship with tend** (bundled deps, resolved from tend's
30
- own install) they work with zero setup. eslint+sonarjs runs via the ESLint Node API in one of
31
- three modes, picked automatically:
29
+ Scanners find problems; acting on them is the work. tend closes the loop
30
+ **deterministic detection AI fix deterministic verification**. The scanners detect what's
31
+ wrong and confirm when it's fixed; the model only makes the edit in between. The worst case is
32
+ "tend changed nothing," never "tend broke your code."
32
33
 
33
- | Your project | tend runs |
34
- |--------------|-----------|
35
- | no eslint config | **tend's config** — eslint recommended + sonarjs recommended (TS/JSX parsed, no tsconfig needed) |
36
- | eslint config, no sonarjs | **your config + sonarjs layered on top** — your rules *and* sonarjs in one pass |
37
- | eslint config with sonarjs | **your config, untouched** |
34
+ Six scanners run on one of three tracks:
38
35
 
39
- For `knip` and `jscpd`: tend uses **your project's installed version if you have one** (and that
40
- tool auto-loads your `knip.json` / `.jscpd.json` from the repo root), otherwise it falls back to
41
- tend's bundled copy. So if you already use them, tend runs *your* setup; if not, it just works.
36
+ | Track | Tools | What tend does |
37
+ |-------|-------|----------------|
38
+ | **AI fix** | `eslint`+`sonarjs`, `knip`, `jscpd`, `semgrep` | each finding fixed by an AI session, then gated kept only if it passes |
39
+ | **Report only** | `osv-scanner` | vulnerable deps surfaced with a suggested version bump (not applied) |
40
+ | **Report + fail** | `gitleaks` | secrets reported, never AI-touched; the run exits non-zero |
42
41
 
43
- The native tools — `semgrep`, `osv-scanner`, `gitleaks` can't be npm deps; install those
44
- yourself (`brew install …`). tend skips any missing scanner with a hint and errors only if none
45
- of the six are present.
42
+ `eslint`+`sonarjs`, `knip`, and `jscpd` are **bundled and need zero setup**; the native tools
43
+ (`semgrep`, `osv-scanner`, `gitleaks`) you install yourself. See [docs/USAGE.md](docs/USAGE.md)
44
+ for full scanner behavior, flags, and config.
46
45
 
47
46
  ## Safety
48
47
 
49
- - **In-place edits** on your actual files — no worktrees, no branches.
50
- - A **silent snapshot** (tracked + untracked) is taken first as an invisible restore point.
51
- - Every fix passes a gate — **anti-suppression · anti-regression · `tsc` · tests** — or it's
48
+ - **In-place edits** to your working tree — no worktrees, no branches, no commits.
49
+ - A **silent snapshot** (tracked + untracked) is taken before any edit, so `tend undo` restores
50
+ the pre-run state exactly.
51
+ - Every fix must pass a gate — **anti-suppression · anti-regression · `tsc` · tests** — or it's
52
52
  reverted atomically (code + its sibling test together).
53
- - Tests are the behavior oracle: a fix may edit a test, but a **teeth check** rejects any
54
- edit that no longer fails on the old code.
53
+ - Tests are the behavior oracle: a fix may edit a test, but a **teeth check** rejects any edit
54
+ that no longer fails on the old code.
55
55
 
56
- ## Commands
56
+ ## Configuration
57
57
 
58
- | Command | What it does |
59
- |---------|--------------|
60
- | `tend` / `tend run` | snapshot → audit → fix loop → report |
61
- | `tend diff` | show only the tool's edits (your own changes filtered out) |
62
- | `tend undo` | restore the pre-run snapshot exactly |
63
- | `tend show <id>` | full detail on one finding (attempts, flow path, docs) |
64
- | `tend retry <id>` | re-attempt a stubborn finding with a larger budget |
65
-
66
- ## Config (zero-config by default)
67
-
68
- `cosmiconfig` discovery (`.tendrc`, `tend.config.js`, a `tend` key in `package.json`, …):
58
+ Zero-config by default. Drop a `.tendrc` (or a `tend` key in `package.json`) to tune it:
69
59
 
70
60
  ```jsonc
71
61
  {
72
62
  "maxSessions": 4,
73
63
  "maxLoops": 5,
74
- "perIssueBudget": 3,
75
- "teethCheck": true,
76
- "includeTests": false,
77
64
  "model": "sonnet",
78
65
  "effort": "high"
79
66
  }
80
67
  ```
81
68
 
82
- CLI flags (`--max-loops`, `--max-sessions`, `--model`, `--effort`, `--all`) override the config
83
- file. `model` is an alias (`sonnet` default, `opus`, `haiku`) or a full model id (e.g.
84
- `claude-opus-4-8`); `effort` is the reasoning effort (`low | medium | high | xhigh | max`,
85
- unset → claude's default). Both are passed straight to `claude -p`.
69
+ Full flags and config reference: **[docs/USAGE.md](docs/USAGE.md)**.
86
70
 
87
71
  ## Output
88
72
 
89
- A live `listr2` task tree while running, a machine-readable `.tend/report.json`, and a
90
- final summary that groups remaining issues by **why** tend couldn't fix them, ordered by
91
- urgency: secrets security couldn't-fix → needs-review.
73
+ While it runs, a live task tree; when it finishes, a summary (fixed / couldn't-fix / left /
74
+ secrets, elapsed time, estimated AI cost & tokens) and a machine-readable `.tend/report.json`.
75
+ Pass `--plain` for line-per-event output in CI.
76
+
77
+ ## Status & contributing
78
+
79
+ tend is **pre-1.0 (v0.x)** — interfaces may change between releases, so pin a version if you
80
+ need stability. Bug reports, ideas, and PRs are very welcome via
81
+ [GitHub issues](../../issues).
92
82
 
93
83
  ## License
94
84
 
95
- MIT
85
+ [MIT](LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tend-cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Audit a JS/TS repo with established scanners, then fix the findings with parallel AI sessions in a safe scan-fix-rescan loop.",
5
5
  "keywords": [
6
6
  "lint",