chisle 3.2.0 → 3.2.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chisle",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Maximum-efficiency dev mode. Zero-fluff prose combined with YAGNI/ladder-first code decisions. One persona: the senior dev who deletes code for fun and bills by the syllable.",
5
5
  "hooks": {
6
6
  "SessionStart": [
package/README.md CHANGED
@@ -144,21 +144,30 @@ Preview first with `npx chisle --dry-run`, scope with `--only claude` or `--only
144
144
 
145
145
  ### Upgrading
146
146
 
147
- Same command as installing. It is idempotent and overwrites the previous copy:
147
+ ```bash
148
+ npx chisle@latest --update
149
+ ```
150
+
151
+ That refreshes every agent that already has Chisle and installs it into none that don't. Two details it exists to handle:
152
+
153
+ - **Plain `npx chisle` does not upgrade.** Every install path skips what is already present, so an upgrade run reports success and changes nothing. `--update` pairs the refresh with that check.
154
+ - **`@latest` matters.** `npx chisle` can serve a cached copy of the package from a previous run, so the pin is what guarantees you get the new one.
155
+
156
+ Per-agent equivalents, if you prefer the native tool:
148
157
 
149
158
  ```bash
150
- npx chisle # npm / standalone install
151
- claude plugin update chisle@chisle # Claude Code plugin install
159
+ claude plugin update chisle@chisle # Claude Code plugin install
160
+ pi install npm:chisle # Pi package
161
+ gemini extensions install https://github.com/JayPokale/Chisle
152
162
  ```
153
163
 
154
- Chisle checks npm on session start and mentions it once when a **major** version
155
- is out (cached 3 days, `CHISLE_UPDATE_CHECK=0` to silence). Minor and patch
156
- releases stay quiet on purpose.
164
+ Project-scoped agents (Cursor, Windsurf, Cline, Kiro, Copilot) keep their rule file inside the repo, so run the update once per project that has one.
165
+
166
+ Not sure what you are running? `npx chisle --list` prints the agents it detects, and `claude plugin list` shows the installed plugin and its version.
167
+
168
+ Chisle checks npm on session start and mentions it once when a **major** version is out (cached 3 days, `CHISLE_UPDATE_CHECK=0` to silence). Minor and patch releases stay quiet on purpose.
157
169
 
158
- Upgrading to 3.0.0 from 2.x needs nothing: a `lite`/`full`/`ultra` value in
159
- `CHISLE_DEFAULT_MODE` or `config.json` is no longer meaningful, falls through to
160
- the default, and Chisle stays active. It says so once so the setting is not
161
- ignored silently. Replace it with `on`/`off` or delete it.
170
+ Upgrading to 3.0.0 from 2.x needs nothing: a `lite`/`full`/`ultra` value in `CHISLE_DEFAULT_MODE` or `config.json` is no longer meaningful, falls through to the default, and Chisle stays active. It says so once so the setting is not ignored silently. Replace it with `on`/`off` or delete it.
162
171
 
163
172
  ### Claude Code plugin (marketplace)
164
173
 
package/bin/install.js CHANGED
@@ -58,7 +58,7 @@ const PROVIDERS = [
58
58
  // ── argv ────────────────────────────────────────────────────────────────────
59
59
  function parseArgs(argv) {
60
60
  const opts = { dryRun: false, force: false, list: false, uninstall: false,
61
- noColor: false, help: false, stats: false, only: [], configDir: null };
61
+ noColor: false, help: false, stats: false, update: false, only: [], configDir: null };
62
62
  for (let i = 0; i < argv.length; i++) {
63
63
  const a = argv[i];
64
64
  switch (a) {
@@ -66,6 +66,9 @@ function parseArgs(argv) {
66
66
  case '--force': opts.force = true; break;
67
67
  case '--list': opts.list = true; break;
68
68
  case '--stats': opts.stats = true; break;
69
+ // --update is --force narrowed to what is already there: refresh every
70
+ // agent that has Chisle, add it to none that don't.
71
+ case '--update': opts.update = true; opts.force = true; break;
69
72
  case '--uninstall': case '-u': opts.uninstall = true; break;
70
73
  case '--no-color': opts.noColor = true; break;
71
74
  case '-h': case '--help': opts.help = true; break;
@@ -165,6 +168,49 @@ function claudeDir(opts) {
165
168
  return path.join(os.homedir(), '.claude');
166
169
  }
167
170
 
171
+ // ── what is already installed ───────────────────────────────────────────────
172
+ // Every install path skips when Chisle is already present, which is right for
173
+ // `npx chisle` and useless for an upgrade: the run reports success and changes
174
+ // nothing. --update pairs this check with --force so a refresh touches exactly
175
+ // the agents that already have it.
176
+ function installedFor(id, opts) {
177
+ try {
178
+ switch (id) {
179
+ case 'claude': {
180
+ if (hasCmd('claude')) {
181
+ const r = capture('claude', ['plugin', 'list']);
182
+ if (r.status === 0 && /chisle/i.test(r.stdout || '')) return true;
183
+ }
184
+ const settings = SETTINGS.readSettings(path.join(claudeDir(opts), 'settings.json'));
185
+ const hooks = (settings && settings.hooks) || {};
186
+ for (const event of Object.keys(hooks)) {
187
+ for (const entry of hooks[event] || []) {
188
+ for (const h of (entry && entry.hooks) || []) {
189
+ if (typeof h.command === 'string' && h.command.includes('chisle-')) return true;
190
+ }
191
+ }
192
+ }
193
+ return false;
194
+ }
195
+ case 'pi':
196
+ return hasCmd('pi') && piSources(capture('pi', ['list']).stdout).length > 0;
197
+ case 'gemini': {
198
+ if (!hasCmd('gemini')) return false;
199
+ const r = capture('gemini', ['extensions', 'list']);
200
+ return r.status === 0 && /chisle/i.test(r.stdout || '');
201
+ }
202
+ case 'codex': {
203
+ const md = path.join(os.homedir(), '.codex', 'AGENTS.md');
204
+ return fs.existsSync(md) && fs.readFileSync(md, 'utf8').includes(FENCE_BEGIN);
205
+ }
206
+ default: {
207
+ const prov = PROVIDERS.find(x => x.id === id);
208
+ return !!(prov && prov.rule && fs.existsSync(path.join(process.cwd(), prov.rule)));
209
+ }
210
+ }
211
+ } catch (e) { return false; }
212
+ }
213
+
168
214
  // ── Claude Code ─────────────────────────────────────────────────────────────
169
215
  function installClaude(ctx) {
170
216
  const { say, note, warn, opts, results } = ctx;
@@ -459,6 +505,7 @@ Usage:
459
505
  Flags:
460
506
  --list Detect agents and print them; install nothing
461
507
  --stats Print tool-output savings recorded so far; change nothing
508
+ --update Refresh every agent that already has Chisle; install none
462
509
  --only <id> Limit install/uninstall to one agent (repeatable)
463
510
  --dry-run Print actions, change nothing
464
511
  --force Reinstall / overwrite even if already present
@@ -474,6 +521,7 @@ Examples:
474
521
  npx chisle --only claude # just Claude Code
475
522
  npx chisle --dry-run # preview
476
523
  npx chisle --stats # what the compressor has saved
524
+ npx chisle@latest --update # upgrade what is already installed
477
525
  `);
478
526
  }
479
527
 
@@ -544,12 +592,20 @@ function main() {
544
592
 
545
593
  if (opts.uninstall) return uninstall(ctx);
546
594
 
547
- say(c.orange('╭─ Chisle installer ─╮'));
595
+ say(c.orange(opts.update ? '╭─ Chisle updater ─╮' : '╭─ Chisle installer ─╮'));
548
596
  say(c.dim(opts.dryRun ? ' (dry run, nothing will change)' : ' maximum signal, minimum noise'));
549
597
  say('');
550
598
 
551
- const targets = PROVIDERS.filter(p => opts.only.length ? opts.only.includes(p.id) : detectMatch(p.detect));
599
+ let targets = PROVIDERS.filter(p => opts.only.length ? opts.only.includes(p.id) : detectMatch(p.detect));
600
+ if (opts.update) targets = targets.filter(p => installedFor(p.id, opts));
552
601
  if (targets.length === 0) {
602
+ if (opts.update) {
603
+ warn('Nothing to update: Chisle is not installed for any detected agent.');
604
+ note('Run `npx chisle` to install it, or `npx chisle --list` to see what we look for.');
605
+ note('Project-scoped agents (Cursor, Windsurf, Cline, Kiro, Copilot) are per-repo:');
606
+ note('run this from the project that has the rule file.');
607
+ return;
608
+ }
553
609
  warn('No supported agents detected.');
554
610
  note('Run `npx chisle --list` to see what we look for, or `--only <id>` to force one.');
555
611
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chisle",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "description": "Maximum-efficiency dev mode for AI coding agents. Zero-fluff prose, YAGNI-first code, and safe tool-output compression.",
5
5
  "keywords": [
6
6
  "claude-code",