jobkompass-cli 0.3.0 → 0.4.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.
Files changed (3) hide show
  1. package/README.md +12 -1
  2. package/dist/index.js +22 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ Run your JobKompass job search from the terminal — or let an AI agent (Claude
24
24
  jk resources add --title "Salary guide" --url "https://..."
25
25
 
26
26
  ## Folders
27
- Resumes can be filed into the same folders you see in Documents (one folder per resume).
27
+ Resumes and cover letters can be filed into the same folders you see in Documents (one folder per document).
28
28
  Moving only changes the folder: content is never touched and nothing is deleted.
29
29
 
30
30
  jk folders list # id, name, resumeCount, coverLetterCount
@@ -37,6 +37,17 @@ Moving only changes the folder: content is never touched and nothing is deleted.
37
37
  Returns `{dryRun, folder, moved, skipped, alreadyInFolder, counts: {moved, skipped, alreadyInFolder, total}}`;
38
38
  on a dry run `moved` lists what would move. Favorites and ids that aren't yours come back in `skipped` with a reason.
39
39
 
40
+ Cover letters work the same way:
41
+
42
+ jk coverletters move --folder "Archive - Cover Letters" --ids <id1>,<id2> # moves right away (--dry-run to preview)
43
+ jk coverletters move --folder "Archive - Cover Letters" --all # DRY RUN: every letter not already in the folder
44
+ jk coverletters move --folder "Archive - Cover Letters" --all --unfiled-only # DRY RUN: only letters in no folder yet
45
+ jk coverletters move --folder "Archive - Cover Letters" --all --unfiled-only --yes # actually moves
46
+
47
+ `--all` is always a dry run unless `--yes`. Letters already in the folder come back in `alreadyInFolder`;
48
+ with `--unfiled-only`, letters filed in another folder come back in `skipped` as `in_other_folder`.
49
+ Same result shape as `jk resumes move`.
50
+
40
51
  ## Resume questions: never invent a number
41
52
  Strong bullets carry numbers. Only the human knows them, so the API asks instead of guessing.
42
53
 
package/dist/index.js CHANGED
@@ -253,6 +253,21 @@ var commands = [
253
253
  { name: "folders list", desc: "List document folders with resume/cover letter counts", method: "GET", path: "/agent/folders", opts: [] },
254
254
  // coverletters
255
255
  { name: "coverletters list", desc: "List cover letters (metadata)", method: "GET", path: "/agent/coverletters", opts: [] },
256
+ {
257
+ name: "coverletters move",
258
+ desc: "File cover letters into a folder (only the folder changes; nothing is deleted). Bulk is a dry run unless --yes",
259
+ method: "POST",
260
+ path: "/agent/coverletters/move",
261
+ itemNoun: "cover letter",
262
+ opts: [
263
+ { flag: "--folder <name|id>", api: "folder", type: "str", required: true, desc: "Folder id or exact name (case-insensitive); see 'jk folders list'" },
264
+ { flag: "--ids <ids>", api: "coverLetterIds", type: "list", desc: "Comma-separated cover letter ids" },
265
+ { flag: "--all", api: "all", type: "bool", desc: "Every cover letter not already in the folder (dry run unless --yes)" },
266
+ { flag: "--unfiled-only", api: "unfiledOnly", type: "bool", desc: "With --all: only cover letters in no folder yet" },
267
+ { flag: "--dry-run", api: "dryRun", type: "bool", desc: "Show what would move; change nothing" },
268
+ { flag: "--yes", api: "confirm", type: "bool", desc: "Confirm a bulk move (--all)" }
269
+ ]
270
+ },
256
271
  {
257
272
  name: "coverletters get",
258
273
  desc: "Get a cover letter with content",
@@ -530,10 +545,10 @@ function isMoveResult(data) {
530
545
  const d = data;
531
546
  return Boolean(d && typeof d === "object" && typeof d.dryRun === "boolean" && d.counts && d.folder && Array.isArray(d.moved));
532
547
  }
533
- function renderMove(r) {
548
+ function renderMove(r, itemNoun = "resume") {
534
549
  const verb = r.dryRun ? "DRY RUN: would move" : "Moved";
535
550
  const lines = [
536
- `${verb} ${r.counts.moved} of ${r.counts.total} resume(s) into '${r.folder.name}' (${r.folder.id}).`,
551
+ `${verb} ${r.counts.moved} of ${r.counts.total} ${itemNoun}(s) into '${r.folder.name}' (${r.folder.id}).`,
537
552
  `Already in folder: ${r.counts.alreadyInFolder}. Skipped: ${r.counts.skipped}.`
538
553
  ];
539
554
  if (r.moved.length) lines.push("", ...r.moved.map((m) => ` ${m.id} ${m.name}`));
@@ -541,9 +556,9 @@ function renderMove(r) {
541
556
  if (r.hint) lines.push("", r.hint);
542
557
  return lines.join("\n");
543
558
  }
544
- function formatOutput(data, machine) {
559
+ function formatOutput(data, machine, itemNoun) {
545
560
  if (machine) return JSON.stringify(data, null, 2);
546
- if (isMoveResult(data)) return renderMove(data);
561
+ if (isMoveResult(data)) return renderMove(data, itemNoun);
547
562
  if (data && typeof data === "object" && !Array.isArray(data)) {
548
563
  const { notice, ...rest } = data;
549
564
  if (typeof notice === "string" && notice) return `Notice: ${notice}
@@ -554,7 +569,7 @@ ${renderPretty(rest)}`;
554
569
  }
555
570
  function emit(data, opts = {}) {
556
571
  const machine = Boolean(opts.json) || !process.stdout.isTTY;
557
- process.stdout.write(formatOutput(data, machine) + "\n");
572
+ process.stdout.write(formatOutput(data, machine, opts.itemNoun) + "\n");
558
573
  }
559
574
 
560
575
  // src/dates.ts
@@ -576,7 +591,7 @@ function toIso(d) {
576
591
  // package.json
577
592
  var package_default = {
578
593
  name: "jobkompass-cli",
579
- version: "0.3.0",
594
+ version: "0.4.0",
580
595
  description: "Agent-first CLI for JobKompass \u2014 run your job search from the terminal, or let an AI agent run it for you.",
581
596
  license: "MIT",
582
597
  type: "module",
@@ -695,7 +710,7 @@ function register(spec) {
695
710
  }
696
711
  try {
697
712
  const data = spec.method === "GET" || spec.method === "DELETE" ? await apiRequest(spec.method, spec.path, { query: payload }) : await apiRequest(spec.method, spec.path, { body: payload });
698
- emit(data, { json: Boolean(program.opts().json) });
713
+ emit(data, { json: Boolean(program.opts().json), itemNoun: spec.itemNoun });
699
714
  } catch (err) {
700
715
  if (err instanceof CliError) fatal(err.code, err.message, err.hint, err.exitCode);
701
716
  throw err;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jobkompass-cli",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Agent-first CLI for JobKompass — run your job search from the terminal, or let an AI agent run it for you.",
5
5
  "license": "MIT",
6
6
  "type": "module",