tend-cli 0.1.0 → 0.1.2

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 +53 -61
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,95 +1,87 @@
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. The fix sessions run on Claude via [Claude Code](https://www.anthropic.com/claude-code)
10
+ > for now; support for other models is planned. As with any tool that edits code, run it on a
11
+ > committed repo and review the changes. Feedback and issues are very welcome.
12
+
13
+ An open-source CLI that audits a JS/TS repo with standard scanners, then fixes the findings
14
+ with parallel AI sessions in a safe **scan → fix → re-scan** loop. It never commits — fixes
15
+ land as uncommitted edits for you to review.
13
16
 
14
- ## Why
17
+ ## Quick start
15
18
 
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."
19
+ ```bash
20
+ npx tend-cli # changed files vs HEAD (the default)
21
+ npx tend-cli src/app lib/ # only findings under these paths
22
+ npx tend-cli --all # the entire backlog, repo-wide
23
+ ```
20
24
 
21
- ## What it runs
25
+ Requires **Node 20**, a git repo, and the [Claude Code](https://www.anthropic.com/claude-code)
26
+ CLI (`claude`) installed and signed in — tend drives it to make the fixes. Review the edits with
27
+ `tend diff`; undo the whole run with `tend undo`.
22
28
 
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 |
29
+ ## What it does
28
30
 
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:
31
+ Scanners find problems; acting on them is the work. tend closes the loop
32
+ **deterministic detection AI fix deterministic verification**. The scanners detect what's
33
+ wrong and confirm when it's fixed; the model only makes the edit in between. The worst case is
34
+ "tend changed nothing," never "tend broke your code."
32
35
 
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** |
36
+ Six scanners run on one of three tracks:
38
37
 
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.
38
+ | Track | Tools | What tend does |
39
+ |-------|-------|----------------|
40
+ | **AI fix** | `eslint`+`sonarjs`, `knip`, `jscpd`, `semgrep` | each finding fixed by an AI session, then gated kept only if it passes |
41
+ | **Report only** | `osv-scanner` | vulnerable deps surfaced with a suggested version bump (not applied) |
42
+ | **Report + fail** | `gitleaks` | secrets reported, never AI-touched; the run exits non-zero |
42
43
 
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.
44
+ `eslint`+`sonarjs`, `knip`, and `jscpd` are **bundled and need zero setup**; the native tools
45
+ (`semgrep`, `osv-scanner`, `gitleaks`) you install yourself. See [docs/USAGE.md](docs/USAGE.md)
46
+ for full scanner behavior, flags, and config.
46
47
 
47
48
  ## Safety
48
49
 
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
50
+ - **In-place edits** to your working tree — no worktrees, no branches, no commits.
51
+ - A **silent snapshot** (tracked + untracked) is taken before any edit, so `tend undo` restores
52
+ the pre-run state exactly.
53
+ - Every fix must pass a gate — **anti-suppression · anti-regression · `tsc` · tests** — or it's
52
54
  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.
55
+ - Tests are the behavior oracle: a fix may edit a test, but a **teeth check** rejects any edit
56
+ that no longer fails on the old code.
55
57
 
56
- ## Commands
58
+ ## Configuration
57
59
 
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`, …):
60
+ Zero-config by default. Drop a `.tendrc` (or a `tend` key in `package.json`) to tune it:
69
61
 
70
62
  ```jsonc
71
63
  {
72
64
  "maxSessions": 4,
73
65
  "maxLoops": 5,
74
- "perIssueBudget": 3,
75
- "teethCheck": true,
76
- "includeTests": false,
77
66
  "model": "sonnet",
78
67
  "effort": "high"
79
68
  }
80
69
  ```
81
70
 
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`.
71
+ Full flags and config reference: **[docs/USAGE.md](docs/USAGE.md)**.
86
72
 
87
73
  ## Output
88
74
 
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.
75
+ While it runs, a live task tree; when it finishes, a summary (fixed / couldn't-fix / left /
76
+ secrets, elapsed time, estimated AI cost & tokens) and a machine-readable `.tend/report.json`.
77
+ Pass `--plain` for line-per-event output in CI.
78
+
79
+ ## Status & contributing
80
+
81
+ tend is **pre-1.0 (v0.x)** — interfaces may change between releases, so pin a version if you
82
+ need stability. Bug reports, ideas, and PRs are very welcome via
83
+ [GitHub issues](../../issues).
92
84
 
93
85
  ## License
94
86
 
95
- MIT
87
+ [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.2",
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",