promptlike 0.9.0 → 0.10.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 (41) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/README.md +241 -27
  3. package/dist/commands/config.js +13 -0
  4. package/dist/commands/copy.js +10 -3
  5. package/dist/commands/get.js +11 -2
  6. package/dist/commands/import.js +30 -128
  7. package/dist/commands/importCheck.js +304 -0
  8. package/dist/commands/importGithub.js +171 -0
  9. package/dist/commands/list.js +83 -17
  10. package/dist/commands/local.js +31 -9
  11. package/dist/commands/login.js +6 -5
  12. package/dist/commands/save.js +1 -1
  13. package/dist/commands/search.js +73 -7
  14. package/dist/commands/show.js +11 -3
  15. package/dist/commands/suggest.js +100 -10
  16. package/dist/commands/sync.js +57 -13
  17. package/dist/index.js +7 -0
  18. package/dist/lib/errors.js +4 -0
  19. package/dist/lib/format.js +28 -0
  20. package/dist/lib/frontmatter.js +86 -4
  21. package/dist/lib/github.js +208 -0
  22. package/dist/lib/githubCache.js +118 -0
  23. package/dist/lib/githubHttp.js +197 -0
  24. package/dist/lib/githubImport.js +238 -0
  25. package/dist/lib/githubSelect.js +148 -0
  26. package/dist/lib/githubSnapshot.js +67 -0
  27. package/dist/lib/githubSpec.js +78 -0
  28. package/dist/lib/importOrigins.js +36 -0
  29. package/dist/lib/importShared.js +179 -0
  30. package/dist/lib/licenses.js +243 -0
  31. package/dist/lib/localStore.js +80 -2
  32. package/dist/lib/loopApi.js +63 -11
  33. package/dist/lib/promptResolver.js +22 -9
  34. package/dist/lib/promptSource.js +123 -0
  35. package/dist/lib/rank.js +30 -13
  36. package/dist/lib/settings.js +24 -3
  37. package/dist/lib/tagFilter.js +40 -0
  38. package/dist/lib/updateCheck.js +296 -0
  39. package/dist/lib/upstreamCheck.js +71 -0
  40. package/dist/program.js +26 -7
  41. package/package.json +1 -1
@@ -0,0 +1,296 @@
1
+ "use strict";
2
+ /**
3
+ * "A newer version is out" notice — costs the user nothing.
4
+ *
5
+ * What it does, exactly:
6
+ * - After a command finished successfully in an interactive terminal, it reads a small cache
7
+ * (`~/.config/promptlike/cache/update-check.json`). If the cache says a newer version exists and
8
+ * nobody was told in the last 24 hours, ONE line goes to stderr.
9
+ * - If the cache is older than 24 hours it starts a detached background process (never awaited,
10
+ * stdio ignored) that asks the npm registry for the latest version and stores it. The command
11
+ * never waits for the network; the answer shows up on a later run.
12
+ * - At most one registry request per 24 hours: the cache is stamped BEFORE the process starts, so
13
+ * a failed or slow check is not retried by the next command, and neither is a burst of commands.
14
+ *
15
+ * What is sent: one anonymous `GET https://registry.npmjs.org/promptlike/latest` (no cookies, no
16
+ * credentials, no identifiers, nothing about you or your prompts — the registry sees your IP address
17
+ * like it does on `npm install`). What comes back is reduced to a strict `x.y.z` version before it is
18
+ * stored or printed; no other response text is ever used.
19
+ *
20
+ * Silent, no cache read and no request: `PLE_UPDATE_CHECK=off`, `NO_UPDATE_NOTIFIER`, `CI`,
21
+ * `ple config set update-check off`, stdout or stderr not a terminal (so `ple get … | claude` and the
22
+ * Claude Code hook never see it), under a test runner, after a failed command, and after commands that
23
+ * promise to stay offline or to talk to one host only (see {@link SKIPPED_COMMANDS}).
24
+ */
25
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
26
+ if (k2 === undefined) k2 = k;
27
+ var desc = Object.getOwnPropertyDescriptor(m, k);
28
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
29
+ desc = { enumerable: true, get: function() { return m[k]; } };
30
+ }
31
+ Object.defineProperty(o, k2, desc);
32
+ }) : (function(o, m, k, k2) {
33
+ if (k2 === undefined) k2 = k;
34
+ o[k2] = m[k];
35
+ }));
36
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
37
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
38
+ }) : function(o, v) {
39
+ o["default"] = v;
40
+ });
41
+ var __importStar = (this && this.__importStar) || (function () {
42
+ var ownKeys = function(o) {
43
+ ownKeys = Object.getOwnPropertyNames || function (o) {
44
+ var ar = [];
45
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
46
+ return ar;
47
+ };
48
+ return ownKeys(o);
49
+ };
50
+ return function (mod) {
51
+ if (mod && mod.__esModule) return mod;
52
+ var result = {};
53
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
54
+ __setModuleDefault(result, mod);
55
+ return result;
56
+ };
57
+ })();
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.CHILD_SCRIPT = exports.SKIPPED_COMMANDS = exports.FETCH_TIMEOUT_MS = exports.CHECK_INTERVAL_MS = exports.REGISTRY_URL = exports.PACKAGE_NAME = void 0;
60
+ exports.parseVersion = parseVersion;
61
+ exports.cleanVersion = cleanVersion;
62
+ exports.isNewer = isNewer;
63
+ exports.updateCacheFile = updateCacheFile;
64
+ exports.readUpdateCache = readUpdateCache;
65
+ exports.writeUpdateCache = writeUpdateCache;
66
+ exports.isCheckDue = isCheckDue;
67
+ exports.isNoticeDue = isNoticeDue;
68
+ exports.commandOf = commandOf;
69
+ exports.isSilenced = isSilenced;
70
+ exports.noticeText = noticeText;
71
+ exports.fetchLatestVersion = fetchLatestVersion;
72
+ exports.refreshUpdateCache = refreshUpdateCache;
73
+ exports.startBackgroundCheck = startBackgroundCheck;
74
+ exports.afterCommand = afterCommand;
75
+ const child_process_1 = require("child_process");
76
+ const path = __importStar(require("path"));
77
+ const constants_1 = require("./constants");
78
+ const format_1 = require("./format");
79
+ const fsSafe_1 = require("./fsSafe");
80
+ const settings_1 = require("./settings");
81
+ exports.PACKAGE_NAME = 'promptlike';
82
+ exports.REGISTRY_URL = `https://registry.npmjs.org/${exports.PACKAGE_NAME}/latest`;
83
+ /** Both the interval between registry requests and between notices. */
84
+ exports.CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000;
85
+ exports.FETCH_TIMEOUT_MS = 2000;
86
+ /** A registry answer or cache entry longer than this is not a version. */
87
+ const MAX_VERSION_LENGTH = 20;
88
+ const VERSION_RE = /^\d+\.\d+\.\d+$/;
89
+ /**
90
+ * Commands after which nothing is checked. `suggest` is the Claude Code hook (it must stay instant
91
+ * and silent). The others are documented as network-free when signed out (`save`, `log`, `diff`,
92
+ * `rollback`: "No network access") or as talking to GitHub only (`import`) — a background request
93
+ * to a third host would make those sentences untrue.
94
+ */
95
+ exports.SKIPPED_COMMANDS = new Set(['suggest', 'save', 'log', 'diff', 'rollback', 'import']);
96
+ // ---------------------------------------------------------------------------
97
+ // Versions
98
+ // ---------------------------------------------------------------------------
99
+ /** `x.y.z` (digits only, each part up to 9 digits so it stays an exact number) or null. */
100
+ function parseVersion(value) {
101
+ if (typeof value !== 'string' || value.length > MAX_VERSION_LENGTH || !VERSION_RE.test(value))
102
+ return null;
103
+ const parts = value.split('.');
104
+ if (parts.some((p) => p.length > 9))
105
+ return null;
106
+ return [Number(parts[0]), Number(parts[1]), Number(parts[2])];
107
+ }
108
+ /** The version string if it is a strict `x.y.z`, else null — the only shape that is ever stored or printed. */
109
+ function cleanVersion(value) {
110
+ return parseVersion(value) ? value : null;
111
+ }
112
+ /** True when `latest` is a higher version than `current`. Numeric, so 0.10.0 > 0.9.0. Anything unparsable: false. */
113
+ function isNewer(latest, current) {
114
+ const a = parseVersion(latest);
115
+ const b = parseVersion(current);
116
+ if (!a || !b)
117
+ return false;
118
+ for (let i = 0; i < 3; i++) {
119
+ if (a[i] !== b[i])
120
+ return a[i] > b[i];
121
+ }
122
+ return false;
123
+ }
124
+ function updateCacheFile() {
125
+ return path.join((0, settings_1.configDir)(), 'cache', 'update-check.json');
126
+ }
127
+ const isTime = (v) => typeof v === 'number' && Number.isFinite(v) && v >= 0;
128
+ /** The cache, or null when it is missing, unreadable or not shaped like ours (never throws). */
129
+ function readUpdateCache() {
130
+ const raw = (0, fsSafe_1.readPrivateFile)(updateCacheFile());
131
+ if (raw === null)
132
+ return null;
133
+ try {
134
+ const o = JSON.parse(raw);
135
+ if (typeof o !== 'object' || o === null || !isTime(o.checkedAt))
136
+ return null;
137
+ return {
138
+ checkedAt: o.checkedAt,
139
+ // A tampered or corrupt value is dropped, so it can never reach a terminal.
140
+ latest: cleanVersion(o.latest),
141
+ notifiedAt: isTime(o.notifiedAt) ? o.notifiedAt : 0,
142
+ };
143
+ }
144
+ catch {
145
+ return null;
146
+ }
147
+ }
148
+ function writeUpdateCache(cache) {
149
+ (0, fsSafe_1.writePrivateFile)(updateCacheFile(), JSON.stringify(cache) + '\n');
150
+ }
151
+ /** No cache, or the last request was started 24 hours ago or more (also when the clock moved back). */
152
+ function isCheckDue(cache, now) {
153
+ if (!cache)
154
+ return true;
155
+ const age = now - cache.checkedAt;
156
+ return age < 0 || age >= exports.CHECK_INTERVAL_MS;
157
+ }
158
+ /** The user was never told, or last told 24 hours ago or more. */
159
+ function isNoticeDue(cache, now) {
160
+ const age = now - cache.notifiedAt;
161
+ return cache.notifiedAt === 0 || age < 0 || age >= exports.CHECK_INTERVAL_MS;
162
+ }
163
+ /** First argument that is not an option: the command name. */
164
+ function commandOf(argv) {
165
+ return argv.find((a) => !a.startsWith('-'));
166
+ }
167
+ /** True when neither the cache is read nor a request made nor a line printed. */
168
+ function isSilenced(ctx) {
169
+ if (!(0, settings_1.updateCheckEnabled)(ctx.env, ctx.settings))
170
+ return true; // env switches, CI, ple config set update-check off
171
+ if (ctx.env.VITEST !== undefined || ctx.env.NODE_ENV === 'test')
172
+ return true; // under a test runner
173
+ if (!ctx.stdoutIsTTY || !ctx.stderrIsTTY)
174
+ return true; // pipes, agents, hooks, cron
175
+ if (ctx.exitCode)
176
+ return true; // a failed command is not the moment for a nag
177
+ if (!ctx.command || exports.SKIPPED_COMMANDS.has(ctx.command))
178
+ return true;
179
+ return false;
180
+ }
181
+ function noticeText(current, latest) {
182
+ return (`Update available: ${exports.PACKAGE_NAME} ${current} → ${latest} · npm i -g ${exports.PACKAGE_NAME}@latest ` +
183
+ '(turn off: ple config set update-check off)');
184
+ }
185
+ /**
186
+ * Ask the registry for the latest version. Resolves to a strict `x.y.z` or null — on any problem:
187
+ * network error, timeout (2 s, body included), HTTP error, redirect, not JSON, or a `version` that
188
+ * is not a plain `x.y.z` of at most 20 characters. Nothing else from the response is looked at.
189
+ */
190
+ async function fetchLatestVersion(fetchImpl = fetch) {
191
+ const controller = new AbortController();
192
+ const timer = setTimeout(() => controller.abort(), exports.FETCH_TIMEOUT_MS);
193
+ try {
194
+ const res = await fetchImpl(exports.REGISTRY_URL, {
195
+ signal: controller.signal,
196
+ redirect: 'error',
197
+ headers: { Accept: 'application/json' },
198
+ });
199
+ if (!res.ok)
200
+ return null;
201
+ const body = (await res.json());
202
+ return cleanVersion(body?.version);
203
+ }
204
+ catch {
205
+ return null;
206
+ }
207
+ finally {
208
+ clearTimeout(timer);
209
+ }
210
+ }
211
+ /**
212
+ * Store the registry's answer. A failed request keeps the previous `latest` — and the stamp that
213
+ * `startBackgroundCheck` already wrote, so the next attempt is a day away.
214
+ */
215
+ async function refreshUpdateCache(now = Date.now(), fetchImpl) {
216
+ const latest = await fetchLatestVersion(fetchImpl);
217
+ // Read AFTER the request: another command may have shown a notice (and stored it) in the meantime.
218
+ const previous = readUpdateCache();
219
+ writeUpdateCache({
220
+ checkedAt: previous?.checkedAt ?? now,
221
+ latest: latest ?? previous?.latest ?? null,
222
+ notifiedAt: previous?.notifiedAt ?? 0,
223
+ });
224
+ }
225
+ const defaultSpawner = (execPath, args) => {
226
+ const child = (0, child_process_1.spawn)(execPath, args, { detached: true, stdio: 'ignore', windowsHide: true });
227
+ child.on('error', () => undefined);
228
+ child.unref();
229
+ };
230
+ /**
231
+ * Runs inside the background process: load this compiled module (its path is the one extra
232
+ * argument), ask the registry, store the answer, leave. A hard timer ends it even if a socket hangs.
233
+ */
234
+ exports.CHILD_SCRIPT = 'setTimeout(() => process.exit(0), 5000).unref();' +
235
+ 'require(process.argv[1]).refreshUpdateCache().then(() => process.exit(0), () => process.exit(0));';
236
+ /**
237
+ * Stamp the cache (that is the "one request per 24 hours" guarantee: it happens BEFORE the request, so
238
+ * a slow or failed check and a burst of commands cannot start a second one), then start the detached
239
+ * process. Returns false when nothing was started.
240
+ */
241
+ function startBackgroundCheck(previous, now, opts = {}) {
242
+ // Only the compiled package can be loaded by the child; a source checkout run through a loader cannot.
243
+ const modulePath = opts.modulePath ?? __filename;
244
+ if (!modulePath.endsWith('.js'))
245
+ return false;
246
+ try {
247
+ (0, fsSafe_1.ensurePrivateDir)(path.dirname(updateCacheFile()));
248
+ writeUpdateCache({ checkedAt: now, latest: previous?.latest ?? null, notifiedAt: previous?.notifiedAt ?? 0 });
249
+ (opts.spawner ?? defaultSpawner)(process.execPath, ['-e', exports.CHILD_SCRIPT, modulePath]);
250
+ return true;
251
+ }
252
+ catch {
253
+ return false;
254
+ }
255
+ }
256
+ /**
257
+ * Called once after a command ran. Prints the cached notice (at most one per 24 h) and starts the
258
+ * background check when it is due. Synchronous apart from the detached process, and it never throws.
259
+ * Returns what it did, for tests.
260
+ */
261
+ function afterCommand(deps = {}) {
262
+ const result = { printed: false, started: false };
263
+ try {
264
+ const env = deps.env ?? process.env;
265
+ const settings = deps.settings ?? (0, settings_1.readSettings)();
266
+ const gate = {
267
+ command: commandOf(deps.argv ?? process.argv.slice(2)),
268
+ env,
269
+ stdoutIsTTY: deps.stdoutIsTTY ?? process.stdout.isTTY === true,
270
+ stderrIsTTY: deps.stderrIsTTY ?? process.stderr.isTTY === true,
271
+ settings,
272
+ exitCode: 'exitCode' in deps ? deps.exitCode : process.exitCode,
273
+ };
274
+ if (isSilenced(gate))
275
+ return result;
276
+ const current = deps.currentVersion ?? constants_1.CLI_VERSION;
277
+ if (current === '0.0.0')
278
+ return result; // the version could not be read: nothing to compare with
279
+ const now = deps.now ?? Date.now();
280
+ const cache = readUpdateCache();
281
+ let notified = cache;
282
+ if (cache && cache.latest && isNewer(cache.latest, current) && isNoticeDue(cache, now)) {
283
+ (deps.print ?? ((line) => console.error(format_1.c.muted(line))))(noticeText(current, cache.latest));
284
+ notified = { ...cache, notifiedAt: now };
285
+ writeUpdateCache(notified);
286
+ result.printed = true;
287
+ }
288
+ if (isCheckDue(cache, now)) {
289
+ result.started = startBackgroundCheck(notified, now, { spawner: deps.spawner, modulePath: deps.modulePath });
290
+ }
291
+ }
292
+ catch {
293
+ // an update notice must never get in the way of a command
294
+ }
295
+ return result;
296
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * `ple import --check`, the part that needs no terminal: has the file a prompt
4
+ * was imported from changed on GitHub since the text we last took from it?
5
+ *
6
+ * Compared by git blob id (what the tree lists), so an unchanged file costs no
7
+ * download. A changed one is read, put through the same gates as an import
8
+ * (secret scan, license — it may have changed too), and compared with the
9
+ * prompt's current text.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DIFF_LINES = void 0;
13
+ exports.checkUpstream = checkUpstream;
14
+ exports.diffPreview = diffPreview;
15
+ exports.upstreamChangelog = upstreamChangelog;
16
+ exports.blobFromChangelog = blobFromChangelog;
17
+ const format_1 = require("./format");
18
+ const diff_1 = require("./diff");
19
+ const github_1 = require("./github");
20
+ const githubImport_1 = require("./githubImport");
21
+ const githubSnapshot_1 = require("./githubSnapshot");
22
+ const scanners_1 = require("./scanners");
23
+ const HEX = /^[0-9a-f]{7,40}$/;
24
+ /** Where the file stands at the snapshot's commit, compared with `currentBody` (the prompt's text now). */
25
+ async function checkUpstream(snap, t, currentBody) {
26
+ const head = snap.byPath.get(t.file);
27
+ if (!head)
28
+ return { kind: 'removed' };
29
+ if (HEX.test(t.blob) && head.sha.startsWith(t.blob))
30
+ return { kind: 'up-to-date' };
31
+ const text = await (0, githubSnapshot_1.readFile)(snap, t.file, false);
32
+ if (text === null)
33
+ return { kind: 'refused', reason: 'it is now larger than 64 KB or not text — not applied' };
34
+ const read = (0, githubImport_1.readUpstream)(text);
35
+ if ('skip' in read)
36
+ return { kind: 'refused', reason: `${read.skip} — not applied` };
37
+ if ((0, scanners_1.hashBody)(read.body) === (0, scanners_1.hashBody)(currentBody))
38
+ return { kind: 'matches', blob: head.sha };
39
+ const verdict = await (0, githubSnapshot_1.gate)(snap, t.file, read.declaredLicense);
40
+ if (!verdict.allowed)
41
+ return { kind: 'license', verdict };
42
+ (0, github_1.rememberRaw)(snap.owner, snap.name, snap.commit, t.file, text);
43
+ return { kind: 'changed', body: read.body, blob: head.sha, verdict };
44
+ }
45
+ /** Longest diff printed per prompt; the rest is counted, not shown. */
46
+ exports.DIFF_LINES = 60;
47
+ /**
48
+ * Unified diff current → upstream for the terminal. Upstream text is cleaned of
49
+ * escape sequences BEFORE it is diffed (colors are added afterwards), and the
50
+ * output is cut at {@link DIFF_LINES} lines.
51
+ */
52
+ function diffPreview(current, upstream, labels) {
53
+ const colored = format_1.c.success.level > 0;
54
+ const lines = (0, diff_1.unifiedDiff)((0, format_1.safeText)(current, true), (0, format_1.safeText)(upstream, true), {
55
+ fromLabel: (0, format_1.safeText)(labels.from),
56
+ toLabel: (0, format_1.safeText)(labels.to),
57
+ colors: colored ? { header: format_1.c.title, hunk: format_1.c.accent, add: format_1.c.success, del: format_1.c.error } : undefined,
58
+ });
59
+ if (lines.length <= exports.DIFF_LINES)
60
+ return lines;
61
+ return [...lines.slice(0, exports.DIFF_LINES), format_1.c.muted(`… ${lines.length - exports.DIFF_LINES} more lines`)];
62
+ }
63
+ /** `Upstream o/r@abc1234 (blob def5678)` — the changelog of an applied update; the next check reads the blob back from it. */
64
+ function upstreamChangelog(repo, commit, blob) {
65
+ return `Upstream ${repo}@${commit.slice(0, 7)} (blob ${blob.slice(0, 7)})`;
66
+ }
67
+ /** The blob an applied update recorded in a changelog, or null. */
68
+ function blobFromChangelog(changelog) {
69
+ const m = (changelog ?? '').match(/^Upstream .*\(blob ([0-9a-f]{7,40})\)/);
70
+ return m ? m[1] : null;
71
+ }
package/dist/program.js CHANGED
@@ -86,14 +86,14 @@ function buildProgram() {
86
86
  .option('-l, --label <name>', 'Copy the version a deployment label points at (e.g. production)')).action(runWithErrorHandler(copy_1.copyCommand));
87
87
  scope(program
88
88
  .command('list')
89
- .description('List your prompts')
90
- .option('-t, --tag <name>', 'Filter by a specific tag')
89
+ .description('List your prompts with their tags')
90
+ .option('-t, --tag <name>', 'Filter by tag; repeat to require several (all must match)', save_1.collectTag, [])
91
91
  .option('-l, --limit <n>', 'Max number of rows (default 30)', '30'))
92
- .addHelpText('after', '\nExamples:\n ple list --tag debug\n ple list --project my-prompts')
92
+ .addHelpText('after', '\nExamples:\n ple list --tag debug\n ple list --tag debug --tag review # only prompts that have both\n ple list --project my-prompts')
93
93
  .action(runWithErrorHandler(list_1.listCommand));
94
94
  program
95
95
  .command('search <keyword>')
96
- .description('Search titles and descriptions (signed out: also local prompt bodies and tags)')
96
+ .description('Search titles and descriptions; also finds prompts only on this machine (incl. body and tags)')
97
97
  .action(runWithErrorHandler(search_1.searchCommand));
98
98
  scope(program
99
99
  .command('log <name>')
@@ -165,15 +165,34 @@ function buildProgram() {
165
165
  .command('sync')
166
166
  .description('Upload your local prompts to your account (one-way, explicit)')
167
167
  .option('--dry-run', 'List what would be uploaded, change nothing')
168
+ .option('--project <repo>', 'Upload into this repo (name, slug, id or short id)')
168
169
  .action(runWithErrorHandler(sync_1.syncCommand));
169
170
  program
170
- .command('import')
171
- .description('Bring in prompts you already have: .claude/commands, SKILL.md, .cursor/commands, ~/.codex/prompts')
171
+ .command('import [source]')
172
+ .description('Bring in prompts from a public GitHub repo (github:owner/repo) or your agent folders (--scan)')
172
173
  .option('--scan', 'Scan this repo and your home folder for agent prompt files')
174
+ .option('--check', 'Check prompts imported from GitHub for upstream changes')
175
+ .option('--apply', 'With --check: add the upstream changes as new versions (nothing is overwritten)')
173
176
  .option('--dry-run', 'Only show what was found, import nothing')
174
177
  .option('-a, --all', 'Import everything new without asking')
175
178
  .option('--project <repo>', 'Import into this repo (signed in)')
176
- .action(runWithErrorHandler((opts) => (0, import_1.importCommand)(opts)));
179
+ .addHelpText('after', [
180
+ '',
181
+ 'Examples:',
182
+ ' ple import github:anthropics/skills --dry-run # what is there, and under which license',
183
+ ' ple import github:anthropics/skills/skills/pdf # one folder; pick 1,3-5 / all',
184
+ ' ple import github:owner/repo@v1.2 --all # a tag, branch or commit; no questions',
185
+ ' ple import --check # did anything change on GitHub since?',
186
+ ' ple import --check --apply # add the changes as new versions',
187
+ ' ple import --scan --dry-run # prompts already on this machine',
188
+ '',
189
+ 'GitHub: public repositories only, and no token is used (without one GitHub allows 60 requests',
190
+ 'an hour per IP address). A file is copied only when it has an open license (MIT, Apache-2.0,',
191
+ 'BSD, ISC, CC0, CC BY …) — the rest are listed with a link. Each prompt keeps a link to its',
192
+ 'source and license; --check never overwrites: an update is a new version, labels stay put.',
193
+ 'Use github:<owner>/<repo>[/path][@ref] — a branch with a "/" in its name needs the @ref form.',
194
+ ].join('\n'))
195
+ .action(runWithErrorHandler((source, opts) => (0, import_1.importCommand)({ ...opts, source })));
177
196
  scope(program
178
197
  .command('export [name]')
179
198
  .description('Export a prompt (or a whole repo with --project) as an AGENTS.md section or an Agent Skill (SKILL.md)')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptlike",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
4
  "description": "Terminal access to your PromptLikeEngineer prompt library - search, read, and copy your saved prompts without leaving the shell.",
5
5
  "bin": {
6
6
  "ple": "dist/index.js"