promptlike 0.9.0 → 0.10.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,99 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.10.0 — 2026-10-22
4
+
5
+ - **New: `ple import github:<owner>/<repo>[/path][@ref]`.** Bring prompts and skills from a
6
+ public GitHub repo into your library, pinned to the commit they were read at (also takes a
7
+ `https://github.com/…/tree/<ref>/<path>` URL). It finds `SKILL.md`, `*.prompt.md`,
8
+ `.claude/commands`, `.cursor/commands`, `*.mdc`, Fabric `patterns/<name>/system.md`, and
9
+ `AGENTS.md` / `CLAUDE.md` at the path you give, shows them in the same table as
10
+ `--scan` (kind, license, title, size, path) and imports with the same
11
+ `--dry-run`, `--all`, `--project` and pick-from-the-list behavior. Signed out it writes to
12
+ `~/.promptlike`, signed in to your account.
13
+ - **A file is copied only when it has an open license**, decided per file: its own `license:`
14
+ line, else the nearest `LICENSE` / `LICENCE` / `COPYING` file in its folder or a parent,
15
+ else (only when there is no such file) the license GitHub shows for the repo. Allowed: MIT,
16
+ MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Unlicense, CC0-1.0, CC-BY-4.0 and
17
+ CC-BY-SA-4.0 (with a note to keep the license if you change it and make it public). Files
18
+ without an open license are listed with a link and never copied. Each prompt keeps where it
19
+ came from: the description ends with `Source: github.com/<owner>/<repo>/blob/<commit>/<path> ·
20
+ <license>`, plus a record of the repo, commit, file and license (a few `upstream_*` lines in
21
+ the local file, or the prompt's source record in your account).
22
+ - **Only public repositories, and no token.** The CLI never reads `GITHUB_TOKEN` / `GH_TOKEN`
23
+ and sends no credentials or cookies; it contacts only `api.github.com` and
24
+ `raw.githubusercontent.com`, with a `promptlike-cli/<version>` User-Agent and nothing else
25
+ from you. Without a token GitHub allows 60 API requests an hour per IP address; an import
26
+ uses three of them (repo, commit, file list) plus file downloads, which do not count. Answers
27
+ are cached in `~/.promptlike/cache/github/`, so a `--dry-run` followed by the real import
28
+ costs nothing extra. Redirects are followed only for the API and only to `api.github.com`,
29
+ every request times out after 15 s, a file over 64 KB or with binary content is skipped, and
30
+ files that look like they hold a live token are skipped like in `--scan`.
31
+ - **New: `ple import --check [--apply]`.** Looks at every prompt you imported from GitHub, shows
32
+ a diff for the ones that changed upstream, and with `--apply` adds each upstream text as a NEW
33
+ version (signed in: a new version of the prompt with the changelog `Upstream owner/repo@abc1234
34
+ (blob def5678)`; signed out: a new entry in the local history). Nothing is overwritten, the
35
+ previous text stays in the history, and labels are never moved: move `production` with `ple tag`
36
+ when you are ready. A changed file goes through the license and secret checks again; a license
37
+ that turned non-open is reported, not applied. A file removed upstream is kept here. The
38
+ Free plan's version limit is reported with a link to the pricing page.
39
+ - **`ple sync` no longer uploads the same prompts twice.** Every prompt now travels with where it
40
+ is from (a prompt imported from GitHub keeps its source) and a fingerprint of its text, so a
41
+ second run skips what your account already has ("N already in your account — skipped"). A
42
+ prompt you edited since is a different text and is uploaded as a new prompt; sync copies, it
43
+ does not update. Prompts uploaded by an older version have no fingerprint on the server yet,
44
+ so the first sync after updating may upload them one more time. Sync also stores uploaded
45
+ versions with the source `cli` and, when your plan allows only one repo, lands in your existing
46
+ one instead of stopping.
47
+ - **New: `ple sync --project <repo>`.** Upload into that repo (name, slug, id or the short id from
48
+ `ple repo list`) instead of the default one. The repo is looked up after sign-in and before the
49
+ first upload, so a name that matches nothing stops the command with nothing sent; the plan-limit
50
+ and retry hints repeat the same `--project`. With `--dry-run` it only prints the name
51
+ (`→ repo <name> (checked when you upload)`) and stays offline.
52
+ - **Frontmatter:** `description: >` / `>-` / `|` / `|-` block text and one-level maps
53
+ (`metadata:` with indented `author: x`, read as `metadata_author`) are understood now, in
54
+ `--scan` as well. Lists and plain values work as before.
55
+ - **Loop and import calls never follow a redirect:** the bearer token is not sent on to a
56
+ different address (the other commands already worked this way).
57
+ - **Docs:** README has "Import from GitHub" and "Check for upstream changes", and the sync
58
+ section says what a second run does.
59
+ - **Signed in, prompts that exist only on this machine are no longer invisible.** `ple get`,
60
+ `ple show` and `ple copy` look in your account first; when the account has no match they fall
61
+ back to a matching prompt in `~/.promptlike` and say so on stderr (`Note: 'x' is only on this
62
+ machine, not in your account — 'ple sync' uploads it.`). `ple get` still prints nothing but the
63
+ prompt on stdout, so pipes behave as before. The fallback is skipped
64
+ with `--label` or `--project` (labels and repos exist only in your account), and a network or
65
+ sign-in failure is never answered from disk. `ple list` (without `--tag` / `--project`) ends with
66
+ one line when local prompts are missing from your account (how many, which folder, `ple sync`),
67
+ and `ple search` lists local matches under `On this machine only:`. Both compare titles with the
68
+ account's titles in the local suggestion cache, so they make no extra request.
69
+ - **`ple list` shows tags, and `--tag` can be repeated.** The table has a TAGS column (signed in
70
+ and signed out); long lists are cut (`debug, review +2`). `ple list --tag debug --tag review`
71
+ lists only prompts that carry both; before, only the last `--tag` counted. The server filters
72
+ by one tag, so the CLI asks for the first and checks the others itself, reading up to 10 pages
73
+ of 100 (it says so when it had to stop there; `--project` narrows it down). In your account
74
+ tag names must match exactly as saved, like the single-tag filter always did; local prompts
75
+ still match ignoring case. Tag names from the server are cleaned of terminal escape sequences
76
+ before they are printed.
77
+ - **`ple suggest` and the Claude Code hint match Turkish and accented words without the accents.**
78
+ Case, Turkish letters and accents are folded on both sides: `kok neden` finds `kök neden`,
79
+ `ingilizce`, `İngilizce` and `İNGİLİZCE` are one word, `egitim` finds the tag `eğitim`
80
+ (ç ğ ı İ ö ş ü â î û and other Latin accents). This applies to the task text and to every
81
+ field that is matched: title, tags, description and the start of the body. Before, a
82
+ description in Turkish was only found when the accents matched exactly. The server behind
83
+ the MCP `suggest_prompts` tool uses the same rule (and now looks at tags too). Nothing new
84
+ is stored or sent: matching still happens on your machine.
85
+ - **A once-a-day "new version" notice.** After a command succeeded in an interactive terminal, `ple`
86
+ tells you in one line on stderr when a newer `promptlike` is on npm (`Update available: promptlike
87
+ 0.9.0 → 0.10.0 · npm i -g promptlike@latest …`), at most once every 24 hours. To know that it makes
88
+ **at most one request a day: an anonymous `GET https://registry.npmjs.org/promptlike/latest`**, from
89
+ a background process with a 2 second timeout — the command never waits for it, so the line shows up
90
+ on a later run. The request carries no cookies, account, token, prompt or machine identifier; npm
91
+ sees your IP address, as on any `npm install`. Only a plain `x.y.z` from the answer is stored (in
92
+ `~/.config/promptlike/cache/update-check.json`) and shown; no other part of the response is used.
93
+ It stays silent, and makes no request, in pipes (`ple get … | claude`, the Claude Code hook), in CI,
94
+ after a failed command, and after `suggest`, `save`, `log`, `diff`, `rollback` and `import`.
95
+ Turn it off with `ple config set update-check off`, `PLE_UPDATE_CHECK=off` or `NO_UPDATE_NOTIFIER=1`.
96
+
3
97
  ## 0.9.0 — 2026-10-19
4
98
 
5
99
  - **New: conditional blocks in templates.** `{{#if var}}…{{else}}…{{/if}}` and
package/README.md CHANGED
@@ -16,7 +16,8 @@ ple get "code review" --var diff="$(git diff)" | claude
16
16
  ```
17
17
 
18
18
  Prompts live as plain Markdown files in `~/.promptlike/prompts/` — greppable,
19
- diffable, and yours. Nothing leaves your machine until you ask it to.
19
+ diffable, and yours. Your prompts stay on your machine until you ask it to
20
+ upload them.
20
21
 
21
22
  **Signing in is the upgrade, not the door.** A free
22
23
  [promptlikeengineer.com](https://promptlikeengineer.com) account adds version
@@ -37,13 +38,14 @@ ple sync # one-way, local → account; local files are kept
37
38
  1. [Install](#install)
38
39
  2. [Quick start](#quick-start)
39
40
  3. [Commands](#commands)
40
- 4. [Exit codes](#exit-codes)
41
- 5. [Security notes](#security-notes)
42
- 6. [Configuration](#configuration)
43
- 7. [How it works](#how-it-works)
44
- 8. [Troubleshooting](#troubleshooting)
45
- 9. [Feedback](#feedback)
46
- 10. [License](#license)
41
+ 4. [Update notice](#update-notice)
42
+ 5. [Exit codes](#exit-codes)
43
+ 6. [Security notes](#security-notes)
44
+ 7. [Configuration](#configuration)
45
+ 8. [How it works](#how-it-works)
46
+ 9. [Troubleshooting](#troubleshooting)
47
+ 10. [Feedback](#feedback)
48
+ 11. [License](#license)
47
49
 
48
50
  ---
49
51
 
@@ -79,7 +81,8 @@ Cursor, your shell, anywhere — `ple` doesn't know or care.
79
81
 
80
82
  > **Signed out, every read command uses the local store; signed in, the same
81
83
  > command uses your account library.** The commands do not change — only where
82
- > they read from.
84
+ > they read from. Signed in, prompts that exist only in `~/.promptlike` stay
85
+ > usable: see [Prompts only on this machine](#prompts-only-on-this-machine-signed-in).
83
86
 
84
87
  ### `ple save <title>` — no account needed
85
88
 
@@ -101,14 +104,21 @@ not repeat are carried over rather than wiped. Every save that changes the text
101
104
  also adds a version to a local, append-only history (see
102
105
  [Local version history](#local-version-history-signed-out)).
103
106
 
104
- ### `ple sync [--dry-run]`
107
+ ### `ple sync [--dry-run] [--project <repo>]`
105
108
 
106
109
  Uploads local prompts into your signed-in account. **Explicit on purpose** —
107
110
  nothing is uploaded when you log in, only when you ask.
108
111
 
109
112
  One-way (local → account) and it *copies*: your local files stay where they
110
- are, so running it twice uploads twice. `--dry-run` prints the list and
111
- changes nothing.
113
+ are. Running it again is safe: every prompt is sent with a fingerprint of its
114
+ text, and text your account already has is skipped ("N already in your account —
115
+ skipped"). A prompt you edited since is a different text and is uploaded as a new
116
+ prompt — sync adds, it does not update. A prompt imported from GitHub keeps its
117
+ source (see [Import from GitHub](#import-from-github)). `--project <repo>` (a name,
118
+ slug, id or the short id `ple repo list` prints) uploads into that repo instead of
119
+ the default one, and a name that matches nothing stops the command before anything
120
+ is sent. `--dry-run` prints the list (and the repo name, which is only looked up
121
+ when you upload) and changes nothing.
112
122
 
113
123
  ### `ple login`
114
124
 
@@ -128,23 +138,36 @@ Password: ********
128
138
  Removes the local session file. The session itself expires naturally on its
129
139
  own clock — this just clears the local copy.
130
140
 
131
- ### `ple list [--tag <name>] [--limit <n>] [--project <repo>]`
141
+ ### `ple list [--tag <name>]… [--limit <n>] [--project <repo>]`
132
142
 
133
143
  Lists every prompt your account has access to. The server scopes results to
134
- you automatically.
144
+ you automatically. The last column shows each prompt's tags (signed in and signed
145
+ out); a long list is cut, like `debug, review +2`.
135
146
 
136
147
  ```bash
137
148
  $ ple list
138
- ID TITLE UPDATED
139
- ──────── ──────────────────────────────────────── ──────────
140
- 12ab34cd Senior Code Reviewer 2d ago
141
- 98ef76dc Bug Triage Assistant 5d ago
142
-
143
- $ ple list --tag debug # filter by tag (server-side)
144
- $ ple list --limit 50 # default 30, max 100
145
- $ ple list --project my-prompts # only one repo (name, slug or id)
149
+ ID TITLE UPDATED TAGS
150
+ ──────── ──────────────────────────────────────── ────────── ────────────────────────
151
+ 12ab34cd Senior Code Reviewer 2d ago review, security
152
+ 98ef76dc Bug Triage Assistant 5d ago debug
153
+
154
+ $ ple list --tag debug # filter by tag
155
+ $ ple list --tag debug --tag review # repeat --tag: a prompt must carry all of them
156
+ $ ple list --limit 50 # default 30, max 100
157
+ $ ple list --project my-prompts # only one repo (name, slug or id)
146
158
  ```
147
159
 
160
+ `--tag` can be repeated and every tag has to match. In your account a tag
161
+ matches exactly as saved (`Debug` is not `debug`); local prompts match tags
162
+ ignoring case. The server filters by one tag, so with several `--tag` flags `ple`
163
+ asks for the first and checks the others itself, reading up to 10 pages of 100
164
+ prompts; if it had to stop there it says so on stderr (add `--project` to narrow
165
+ it down).
166
+
167
+ Signed in, a plain `ple list` (without `--tag` or `--project`) ends with one
168
+ line when local prompts are missing from your account — see
169
+ [Prompts only on this machine](#prompts-only-on-this-machine-signed-in).
170
+
148
171
  ### `ple repo` — create and manage repos
149
172
 
150
173
  A repo is a collection of prompts in your account. Needs an account
@@ -218,6 +241,26 @@ Same lookup as `copy`, but renders the prompt in the terminal with section
218
241
  headers (`── ROLE ──`, `── DESCRIPTION ──`, `── CONTEXT ──`) instead of putting
219
242
  it on the clipboard.
220
243
 
244
+ ### Prompts only on this machine (signed in)
245
+
246
+ A prompt you saved or imported while signed out lives in `~/.promptlike` and is
247
+ not in your account until you run `ple sync`. Signed in, it does not disappear:
248
+
249
+ - `ple get`, `ple show` and `ple copy` look in your account first. When the
250
+ account has no match, they use a matching local prompt and say so on stderr:
251
+ `Note: '<title>' is only on this machine, not in your account — 'ple sync' uploads it.`
252
+ `ple get` still prints nothing but the prompt on stdout, so pipes behave as before.
253
+ - There is no local fallback with `--label` or `--project` (labels and repos
254
+ exist only in your account), when the account match is ambiguous (the usual
255
+ "matched multiple prompts" list is shown), or after a network or sign-in error —
256
+ a copy on disk never stands in for your account's version.
257
+ - `ple list` ends with one line when local prompts are missing from your account,
258
+ and `ple search` lists local matches under `On this machine only:`.
259
+
260
+ Both compare titles with the account titles in the local suggestion cache, so
261
+ they make no extra request. Nothing is uploaded or changed until you run
262
+ `ple sync`.
263
+
221
264
  ### `ple get <name> [--var key=value...] [--copy]`
222
265
 
223
266
  Prints the prompt **raw to stdout** — no colors, no decoration — so agents and
@@ -237,7 +280,10 @@ $ ple get "code review" --var lang=python --copy
237
280
  ```
238
281
 
239
282
  Unfilled `{{variable}}` placeholders are left intact (not silently dropped) and
240
- reported on stderr.
283
+ reported on stderr. Signed in, a prompt that exists only in `~/.promptlike` is
284
+ used when your account has no match (see
285
+ [Prompts only on this machine](#prompts-only-on-this-machine-signed-in)); the note
286
+ about it goes to stderr as well.
241
287
 
242
288
  **Conditional blocks.** `{{#if var}}…{{else}}…{{/if}}` and `{{#unless var}}…{{/unless}}`
243
289
  keep or drop text depending on a variable. A variable counts as set when it has a
@@ -314,6 +360,9 @@ $ ple loop "code review" --rounds 2
314
360
 
315
361
  Case-insensitive `ilike` search across `title` and `description`. Version body
316
362
  (`content`) is not searched — that's tracked in the [V2 backlog](#scope--v2).
363
+ Signed in, local prompts that match and are not in your account are listed after
364
+ the results under `On this machine only:` (see
365
+ [Prompts only on this machine](#prompts-only-on-this-machine-signed-in)).
317
366
 
318
367
  ```bash
319
368
  $ ple search debug
@@ -351,7 +400,8 @@ overwritten without `--force`.
351
400
  ### `ple import --scan [--dry-run] [--all] [--project <repo>]`
352
401
 
353
402
  Bring in the prompts you already keep for your agents — no copy-pasting.
354
- Scans this repo and your home folder:
403
+ Scans this repo and your home folder (prompts from a GitHub repo:
404
+ [Import from GitHub](#import-from-github)):
355
405
 
356
406
  | Tool | Where |
357
407
  |---|---|
@@ -375,6 +425,116 @@ ple import --scan --all # everything new, no questions
375
425
  64 KB. A file that looks like it contains a live token (`sk-…`, `AKIA…`,
376
426
  `ghp_…`, private keys …) is skipped and named so you can clean it up.
377
427
 
428
+ ### Import from GitHub
429
+
430
+ `ple import github:<owner>/<repo>[/path][@ref]` brings prompts and skills from a
431
+ **public** GitHub repo into your library. Each one keeps a link to where it came
432
+ from and the license it was imported under.
433
+
434
+ ```bash
435
+ ple import github:anthropics/skills --dry-run # what is there, and under which license
436
+ ple import github:anthropics/skills/skills/pdf # one folder; pick 1,3-5 / all
437
+ ple import github:owner/repo@v1.2 --all # a tag, branch or commit; no questions
438
+ ple import https://github.com/owner/repo/tree/main/prompts # a github.com URL works too
439
+ ```
440
+
441
+ `@ref` is a branch, tag or commit (default: the repo's default branch). In a
442
+ github.com URL the ref is one path segment, so a branch with a `/` in its name
443
+ needs the `github:owner/repo@feature/x` form. A path that names a single `.md`
444
+ file imports just that file. The output is the same table as `--scan` (kind,
445
+ license, title, size, path); `--dry-run`, `--all`, `--project <repo>` and the
446
+ pick prompt work the same. Signed out it writes to `~/.promptlike`, signed in
447
+ to your account.
448
+
449
+ **What is picked up:**
450
+
451
+ | File | Imported as |
452
+ |---|---|
453
+ | `SKILL.md` (up to 8 folders deep) | a skill, titled by its `name` (else its folder) |
454
+ | `*.prompt.md` | a Copilot prompt |
455
+ | `.md` under `.claude/commands/` or `.cursor/commands/` | a command |
456
+ | `*.mdc` | a Cursor rule |
457
+ | `…/patterns/<name>/system.md` | a Fabric pattern |
458
+ | `AGENTS.md`, `CLAUDE.md` | context — only directly at the path you gave |
459
+ | one `.md` file, when the path names it | a prompt |
460
+
461
+ Only the Markdown file is imported. The rest of a skill's folder (scripts,
462
+ references) stays on GitHub and the output says how many files that is.
463
+ More than 200 matching files stop the import and ask for a narrower path. Files
464
+ over 64 KB, binary files, names like `.env*` / `*.key` / `credentials*`, and
465
+ files that look like they contain a live token (`sk-…`, `AKIA…`, `ghp_…`,
466
+ private keys …) are skipped and named; the token itself is never printed.
467
+
468
+ **License rule.** A file is copied only when it has an open license: MIT,
469
+ MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, Unlicense, CC0-1.0,
470
+ CC-BY-4.0 or CC-BY-SA-4.0 (the last one comes with a note: if you change it and
471
+ make it public, keep the same license). It is decided per file, closest first:
472
+
473
+ 1. the file's own `license:` frontmatter line (`MIT`, `Apache 2.0`, `CC BY 4.0` …);
474
+ a value like "see LICENSE.txt" continues with step 2;
475
+ 2. the nearest `LICENSE`, `LICENCE` or `COPYING` file (`.md` / `.txt` allowed) in
476
+ the file's folder, then in each parent up to the repo root. A closer license
477
+ file that is not on the list above blocks the file; it never falls back to a
478
+ broader license;
479
+ 3. only when there is no license file on the way up: the license GitHub shows for
480
+ the repo.
481
+
482
+ Files without an open license (all rights reserved, NonCommercial,
483
+ NoDerivatives, custom or source-available terms, no license at all) are never
484
+ copied: they are listed as "not imported — no open license found" with a link to
485
+ the file on GitHub. The license is recognized from its text; if a repo's
486
+ licensing matters to you, read it yourself.
487
+
488
+ **Attribution.** The prompt's description ends with
489
+ `Source: github.com/<owner>/<repo>/blob/<commit>/<path> · <license> · <copyright line>`
490
+ (the copyright line when the license file has one). Besides that, signed out the
491
+ local file gets a few `upstream_*` lines (repo, commit, file, license …) and
492
+ signed in the account stores the same facts as the prompt's source record; that
493
+ is what `ple import --check` reads. Running the import again skips files that
494
+ came in before, even if they changed upstream since (use `--check` for that).
495
+
496
+ **What is sent, and limits.** Only plain HTTPS requests to `api.github.com` and
497
+ `raw.githubusercontent.com`; nothing from your library or your account goes along.
498
+ There is **no token**: the CLI does not read a GitHub token from your
499
+ environment, sends no credentials or cookies, and only the `User-Agent:
500
+ promptlike-cli/<version>` header identifies it. Without a token GitHub allows 60
501
+ API requests an hour per IP address: an import uses three (repo, commit, file
502
+ list) plus file downloads, which do not count against that. When the limit is
503
+ used up the command says when to try again. Only public repositories can be
504
+ imported. Answers are kept in `~/.promptlike/cache/github/`, so a `--dry-run`
505
+ followed by the real import costs nothing extra: files and file lists are
506
+ stored by commit and never change, while a repo's info and what a branch points
507
+ to are reused for 10 minutes.
508
+
509
+ ### Check for upstream changes
510
+
511
+ `ple import --check` looks at every prompt you imported from GitHub and shows
512
+ what changed there since; `--apply` adds the changes as new versions.
513
+
514
+ ```bash
515
+ ple import --check # a diff for each changed prompt, nothing is written
516
+ ple import --check --apply # add each upstream text as a new version
517
+ ```
518
+
519
+ - It compares the file's identity on GitHub with the one you last took, so an
520
+ unchanged file costs no download. Prompts from the same repo share one lookup
521
+ (three API requests).
522
+ - **Nothing is overwritten.** An update is a new version: signed in, a new version
523
+ of the prompt (changelog `Upstream owner/repo@abc1234 (blob def5678)`); signed
524
+ out, a new entry in the local history. The text you had stays in the history,
525
+ and a text you edited by hand is recorded first. **Labels never move**:
526
+ `production` keeps pointing where it did until you run `ple tag`.
527
+ - A changed file goes through the license and secret checks again. A license that
528
+ turned non-open is reported ("license changed to … — not applied"), not
529
+ applied. A file that no longer exists upstream is kept here as it is. A file
530
+ whose new text is what your prompt already says only has its source pointer
531
+ updated.
532
+ - The first lines of each diff are shown (up to 60 lines, then a count). On the
533
+ Free plan a prompt at its version limit is reported with a link to the pricing
534
+ page and the rest carries on.
535
+ - Signed out it follows the local prompts that came from GitHub; signed in, the
536
+ ones in your account (`ple sync` brings local ones up, with their source).
537
+
378
538
  ### `ple log <name>` · `ple diff <name> [a] [b]` · `ple rollback <name> <version>`
379
539
 
380
540
  The version history you have on the web, in the terminal (signed in).
@@ -416,7 +576,8 @@ ple rollback "code review" v1 # asks first; --yes for scripts
416
576
  `ple save --force` over it records the text that was on disk as v1 first.
417
577
  A file you edited by hand is recorded the same way before a rollback.
418
578
  - No network access: these commands only read and write files under
419
- `~/.promptlike` (`PROMPTLIKE_HOME` moves it). `--project` is ignored signed out.
579
+ `~/.promptlike` (`PROMPTLIKE_HOME` moves it) — not even the
580
+ [update notice](#update-notice) runs after them. `--project` is ignored signed out.
420
581
  - `ple sync` uploads the current text of each prompt. The version history is
421
582
  not uploaded and stays local.
422
583
 
@@ -454,6 +615,9 @@ Use one: ple get "Code Review"
454
615
  Ranking: title ×3, tag ×2, description ×1, the first 600 characters of the
455
616
  body ×0.5, weighted by how rare each word is in your library, plus a small
456
617
  bonus for prompts you use a lot. Weak single-word matches are not suggested.
618
+ Case, Turkish letters and accents are folded on both sides, so `kok neden` finds
619
+ `kök neden` and `İngilizce` is the same word as `ingilizce` (ç ğ ı İ ö ş ü â î û
620
+ and other Latin accents). This applies to the hook note as well.
457
621
 
458
622
  `--hook` is what the Claude Code plugin runs on every message
459
623
  (`UserPromptSubmit`). It reads the hook's JSON from stdin and prints one short
@@ -469,8 +633,13 @@ when one is actually used.
469
633
  ### `ple config get [key]` · `ple config set <key> <value>`
470
634
 
471
635
  CLI preferences, stored in `~/.config/promptlike/settings.json` (separate from
472
- the session file, so logging out keeps them). Today there is one key:
473
- `suggest` (`on` | `off`).
636
+ the session file, so logging out keeps them). Today there are two keys, both
637
+ `on` | `off`:
638
+
639
+ | Key | Effect when `off` |
640
+ |---|---|
641
+ | `suggest` | `ple suggest --hook` and the Claude Code hint stay silent |
642
+ | `update-check` | no [update notice](#update-notice) and no request for it |
474
643
 
475
644
  ### `ple --help` / `ple <cmd> --help`
476
645
 
@@ -479,6 +648,36 @@ sub-command.
479
648
 
480
649
  ---
481
650
 
651
+ ## Update notice
652
+
653
+ After a command succeeded in an interactive terminal, `ple` prints one line on
654
+ stderr when a newer `promptlike` is on npm, at most once a day:
655
+
656
+ ```
657
+ Update available: promptlike 0.10.0 → 0.11.0 · npm i -g promptlike@latest (turn off: ple config set update-check off)
658
+ ```
659
+
660
+ To know that, it makes **at most one request a day**: an anonymous
661
+ `GET https://registry.npmjs.org/promptlike/latest` from a detached background
662
+ process (2 second timeout, redirects are never followed). The command never waits
663
+ for it, so the line appears on a later run. The request carries no cookies,
664
+ account, token, prompt or machine identifier; npm sees your IP address, as on any
665
+ `npm install`. Only a plain `x.y.z` version from the answer is stored and printed.
666
+ The answer is kept in `~/.config/promptlike/cache/update-check.json` (owner-only
667
+ permissions where the system supports them).
668
+
669
+ It stays silent, and reads and requests nothing:
670
+
671
+ - when output is not a terminal (pipes, scripts, the Claude Code hook) and in CI;
672
+ - after a failed command;
673
+ - after `ple suggest`, `save`, `log`, `diff`, `rollback` and `import`, so the
674
+ commands documented as offline (or as talking to GitHub only) stay that way.
675
+
676
+ Turn it off with `ple config set update-check off`, `PLE_UPDATE_CHECK=off` or
677
+ `NO_UPDATE_NOTIFIER=1`.
678
+
679
+ ---
680
+
482
681
  ## Exit codes
483
682
 
484
683
  | Code | Meaning | Examples |
@@ -505,6 +704,17 @@ Scripts should treat any non-zero code as failure; `2` is the one worth retrying
505
704
  through a symbolic link; local prompts, history and cache are `0600`.
506
705
  - **Terminal safety:** titles and descriptions that come from the server have
507
706
  escape sequences and control characters removed before they are printed.
707
+ - **GitHub imports:** public repositories only; two hosts (`api.github.com`,
708
+ `raw.githubusercontent.com`) over https; no token is read or sent; redirects only
709
+ for the API and only to `api.github.com`; every request times out after 15 s; a
710
+ response is cut off at its size limit while it downloads; text from GitHub has
711
+ terminal escape sequences removed before it is printed; cache files are `0600`.
712
+ - **Update notice:** at most one anonymous `GET` a day to `registry.npmjs.org`,
713
+ from a background process that the command never waits for; no cookies, account,
714
+ token, prompt or identifier is sent, redirects are not followed, the answer is cut
715
+ down to a plain `x.y.z` before it is stored or printed, and the cache file is
716
+ `0600`. Never in pipes, in CI or after the offline commands; off with
717
+ `ple config set update-check off` (see [Update notice](#update-notice)).
508
718
  - **No shell:** `ple copy` runs the clipboard tool directly and sends the text on
509
719
  its standard input. The one deliberate exception is `ple loop --exec`, which runs
510
720
  *your own* command through your shell (see the note there).
@@ -518,6 +728,8 @@ Scripts should treat any non-zero code as failure; `2` is the one worth retrying
518
728
  | `~/.config/promptlike/config.json` | Local session token storage | `0600` |
519
729
  | `~/.config/promptlike/settings.json` | Preferences (`ple config`) | `0600` |
520
730
  | `~/.config/promptlike/cache/library.json` | Library snapshot for `ple suggest` (titles, descriptions, tags, first 600 chars) | `0600` |
731
+ | `~/.config/promptlike/cache/update-check.json` | Latest `promptlike` version npm reported and when you were last told (see [Update notice](#update-notice)); safe to delete | `0600` where supported |
732
+ | `~/.promptlike/cache/github/` | Answers from GitHub for `ple import github:…` (file lists, files, repo info); safe to delete | `0600` |
521
733
 
522
734
  Shape of the config file:
523
735
 
@@ -552,6 +764,8 @@ to configure.
552
764
  | Variable | Effect |
553
765
  |---|---|
554
766
  | `PLE_SUGGEST=off` | `ple suggest --hook` stays silent |
767
+ | `PLE_UPDATE_CHECK=off` | No update notice, no cache read, no request to npm |
768
+ | `NO_UPDATE_NOTIFIER=1` | Same (any value turns it off, even empty); a non-empty `CI` other than `false` / `0` does too |
555
769
  | `PLE_SURFACE`, `PLE_VIA` | How `copy/get/show` report a use (e.g. `hook`, `suggestion`) |
556
770
  | `PROMPTLIKE_HOME` | Local store location (default `~/.promptlike`) |
557
771
  | `PROMPTLIKE_CONFIG_DIR` | Session / settings / cache folder (default `~/.config/promptlike`) |
@@ -4,6 +4,8 @@
4
4
  *
5
5
  * Keys: `suggest` (on|off) — whether `ple suggest --hook` (the Claude Code
6
6
  * plugin hook) may add a saved-prompt hint to your messages.
7
+ * `update-check` (on|off) — whether `ple` may look for a newer version once a day
8
+ * (an anonymous request to the npm registry, in the background) and tell you about it.
7
9
  */
8
10
  Object.defineProperty(exports, "__esModule", { value: true });
9
11
  exports.configGetCommand = configGetCommand;
@@ -26,6 +28,12 @@ async function configGetCommand(key) {
26
28
  const note = stored !== effective ? format_1.c.muted(' (off via PLE_SUGGEST or the Claude Code plugin option)') : '';
27
29
  console.log(`suggest ${effective}${note}`);
28
30
  }
31
+ if (k === 'update-check') {
32
+ const stored = settings['update-check'] ?? 'on';
33
+ const effective = (0, settings_1.updateCheckEnabled)() ? 'on' : 'off';
34
+ const note = stored !== effective ? format_1.c.muted(' (off via PLE_UPDATE_CHECK, NO_UPDATE_NOTIFIER or CI)') : '';
35
+ console.log(`update-check ${effective}${note}`);
36
+ }
29
37
  }
30
38
  }
31
39
  async function configSetCommand(key, value) {
@@ -33,9 +41,14 @@ async function configSetCommand(key, value) {
33
41
  const settings = (0, settings_1.readSettings)();
34
42
  if (k === 'suggest')
35
43
  settings.suggest = (0, settings_1.parseOnOff)(value);
44
+ if (k === 'update-check')
45
+ settings['update-check'] = (0, settings_1.parseOnOff)(value);
36
46
  (0, settings_1.writeSettings)(settings);
37
47
  console.log(format_1.c.success(`✓ ${k} = ${settings[k]}`));
38
48
  if (k === 'suggest' && settings.suggest === 'off') {
39
49
  console.log(format_1.c.muted(' The Claude Code hook stays silent now. Turn it back on: ple config set suggest on'));
40
50
  }
51
+ if (k === 'update-check' && settings['update-check'] === 'off') {
52
+ console.log(format_1.c.muted(' ple no longer looks for new versions. Turn it back on: ple config set update-check on'));
53
+ }
41
54
  }
@@ -5,12 +5,14 @@ const api_client_1 = require("../lib/api-client");
5
5
  const tag_1 = require("./tag");
6
6
  const local_1 = require("./local");
7
7
  const promptResolver_1 = require("../lib/promptResolver");
8
+ const promptSource_1 = require("../lib/promptSource");
8
9
  const clipboard_1 = require("../lib/clipboard");
9
10
  const format_1 = require("../lib/format");
10
11
  const promptVariables_1 = require("../lib/promptVariables");
11
12
  /**
12
13
  * `ple copy <name>` — resolve a prompt by title (or short id) and copy its
13
- * content to the system clipboard.
14
+ * content to the system clipboard. Signed in, a prompt that exists only on this
15
+ * machine is the fallback when the account has no match (one stderr line says so).
14
16
  */
15
17
  async function copyCommand(name, options = {}) {
16
18
  if ((0, local_1.isSignedOut)()) {
@@ -22,11 +24,16 @@ async function copyCommand(name, options = {}) {
22
24
  }
23
25
  await (0, api_client_1.ensureAuthed)();
24
26
  const projectId = options.project ? await (0, promptResolver_1.resolveProjectId)(options.project) : undefined;
25
- const prompt = await (0, promptResolver_1.resolvePromptByName)(name, { projectId });
26
- if (!prompt) {
27
+ const found = await (0, promptSource_1.findPrompt)(name, { projectId, label: options.label });
28
+ if (!found) {
27
29
  process.exitCode = 1;
28
30
  return;
29
31
  }
32
+ if (found.source === 'local') {
33
+ await (0, local_1.copyLocalPrompt)(found.prompt, options.var ?? {});
34
+ return;
35
+ }
36
+ const prompt = found.prompt;
30
37
  const version = options.label
31
38
  ? await (0, api_client_1.getLabeledVersion)(prompt.id, (0, tag_1.normalizeLabel)(options.label))
32
39
  : (0, promptResolver_1.fetchPromptContent)(prompt);
@@ -6,6 +6,7 @@ const api_client_1 = require("../lib/api-client");
6
6
  const tag_1 = require("./tag");
7
7
  const local_1 = require("./local");
8
8
  const promptResolver_1 = require("../lib/promptResolver");
9
+ const promptSource_1 = require("../lib/promptSource");
9
10
  const clipboard_1 = require("../lib/clipboard");
10
11
  const format_1 = require("../lib/format");
11
12
  const promptVariables_1 = require("../lib/promptVariables");
@@ -18,6 +19,9 @@ const promptVariables_1 = require("../lib/promptVariables");
18
19
  * (warnings, errors, unfilled variables) go to stderr. This is what sets it
19
20
  * apart from `ple show` (colored, human-readable) and `ple copy` (clipboard).
20
21
  *
22
+ * Signed in, the account is read first; a prompt that exists only on this machine
23
+ * (saved while signed out, not synced yet) is the fallback, announced by one stderr line.
24
+ *
21
25
  * ple get "code review" --var lang=python --var tone=formal
22
26
  * ple get "code review" --var lang=python | claude # pipe to an agent
23
27
  */
@@ -31,11 +35,16 @@ async function getCommand(name, options = {}) {
31
35
  }
32
36
  await (0, api_client_1.ensureAuthed)();
33
37
  const projectId = options.project ? await (0, promptResolver_1.resolveProjectId)(options.project) : undefined;
34
- const prompt = await (0, promptResolver_1.resolvePromptByName)(name, { projectId });
35
- if (!prompt) {
38
+ const found = await (0, promptSource_1.findPrompt)(name, { projectId, label: options.label });
39
+ if (!found) {
36
40
  process.exitCode = 1;
37
41
  return;
38
42
  }
43
+ if (found.source === 'local') {
44
+ await (0, local_1.getLocalPrompt)(found.prompt, options.var ?? {}, options.copy === true);
45
+ return;
46
+ }
47
+ const prompt = found.prompt;
39
48
  const version = options.label
40
49
  ? await (0, api_client_1.getLabeledVersion)(prompt.id, (0, tag_1.normalizeLabel)(options.label))
41
50
  : (0, promptResolver_1.fetchPromptContent)(prompt);