jobkompass-cli 0.2.0 → 0.3.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/README.md +14 -0
- package/dist/index.js +37 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,20 @@ Run your JobKompass job search from the terminal — or let an AI agent (Claude
|
|
|
23
23
|
jk resumes list
|
|
24
24
|
jk resources add --title "Salary guide" --url "https://..."
|
|
25
25
|
|
|
26
|
+
## Folders
|
|
27
|
+
Resumes can be filed into the same folders you see in Documents (one folder per resume).
|
|
28
|
+
Moving only changes the folder: content is never touched and nothing is deleted.
|
|
29
|
+
|
|
30
|
+
jk folders list # id, name, resumeCount, coverLetterCount
|
|
31
|
+
jk resumes move --folder "archived resumes" --ids <id1>,<id2> # moves right away (--dry-run to preview)
|
|
32
|
+
jk resumes move --folder "archived resumes" --all-except-favorites # DRY RUN: lists what would move
|
|
33
|
+
jk resumes move --folder "archived resumes" --all-except-favorites --yes # actually moves
|
|
34
|
+
|
|
35
|
+
`--folder` takes an id or an exact name (case-insensitive); an unknown or ambiguous name is an error, so pass the id.
|
|
36
|
+
`--all-except-favorites` selects every resume not starred as a favorite and is always a dry run unless `--yes`.
|
|
37
|
+
Returns `{dryRun, folder, moved, skipped, alreadyInFolder, counts: {moved, skipped, alreadyInFolder, total}}`;
|
|
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
|
+
|
|
26
40
|
## Resume questions: never invent a number
|
|
27
41
|
Strong bullets carry numbers. Only the human knows them, so the API asks instead of guessing.
|
|
28
42
|
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import { Command } from "commander";
|
|
|
5
5
|
import { readFileSync as readFileSync2 } from "fs";
|
|
6
6
|
|
|
7
7
|
// src/commands.ts
|
|
8
|
+
function parseList(raw) {
|
|
9
|
+
return [...new Set(raw.split(",").map((s) => s.trim()).filter(Boolean))];
|
|
10
|
+
}
|
|
8
11
|
var jobWriteOpts = [
|
|
9
12
|
{ flag: "--compensation <c>", api: "compensation", type: "str" },
|
|
10
13
|
{ flag: "--keywords <json>", api: "keywords", type: "json", desc: '["kw1","kw2"]' },
|
|
@@ -233,6 +236,21 @@ var commands = [
|
|
|
233
236
|
{ flag: "--instructions <text>", api: "instructions", type: "str", desc: "One-off instruction (wording and emphasis only, never new facts); added after your saved resume preferences" }
|
|
234
237
|
]
|
|
235
238
|
},
|
|
239
|
+
{
|
|
240
|
+
name: "resumes move",
|
|
241
|
+
desc: "File resumes into a folder (only the folder changes; nothing is deleted). Bulk is a dry run unless --yes",
|
|
242
|
+
method: "POST",
|
|
243
|
+
path: "/agent/resumes/move",
|
|
244
|
+
opts: [
|
|
245
|
+
{ flag: "--folder <name|id>", api: "folder", type: "str", required: true, desc: "Folder id or exact name (case-insensitive); see 'jk folders list'" },
|
|
246
|
+
{ flag: "--ids <ids>", api: "resumeIds", type: "list", desc: "Comma-separated resume ids" },
|
|
247
|
+
{ flag: "--all-except-favorites", api: "allExceptFavorites", type: "bool", desc: "Every resume that is not a favorite (dry run unless --yes)" },
|
|
248
|
+
{ flag: "--dry-run", api: "dryRun", type: "bool", desc: "Show what would move; change nothing" },
|
|
249
|
+
{ flag: "--yes", api: "confirm", type: "bool", desc: "Confirm a bulk move (--all-except-favorites)" }
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
// folders
|
|
253
|
+
{ name: "folders list", desc: "List document folders with resume/cover letter counts", method: "GET", path: "/agent/folders", opts: [] },
|
|
236
254
|
// coverletters
|
|
237
255
|
{ name: "coverletters list", desc: "List cover letters (metadata)", method: "GET", path: "/agent/coverletters", opts: [] },
|
|
238
256
|
{
|
|
@@ -508,8 +526,24 @@ function renderPretty(data) {
|
|
|
508
526
|
}
|
|
509
527
|
return String(data);
|
|
510
528
|
}
|
|
529
|
+
function isMoveResult(data) {
|
|
530
|
+
const d = data;
|
|
531
|
+
return Boolean(d && typeof d === "object" && typeof d.dryRun === "boolean" && d.counts && d.folder && Array.isArray(d.moved));
|
|
532
|
+
}
|
|
533
|
+
function renderMove(r) {
|
|
534
|
+
const verb = r.dryRun ? "DRY RUN: would move" : "Moved";
|
|
535
|
+
const lines = [
|
|
536
|
+
`${verb} ${r.counts.moved} of ${r.counts.total} resume(s) into '${r.folder.name}' (${r.folder.id}).`,
|
|
537
|
+
`Already in folder: ${r.counts.alreadyInFolder}. Skipped: ${r.counts.skipped}.`
|
|
538
|
+
];
|
|
539
|
+
if (r.moved.length) lines.push("", ...r.moved.map((m) => ` ${m.id} ${m.name}`));
|
|
540
|
+
if (r.skipped.length) lines.push("", "Skipped:", ...r.skipped.map((s) => ` ${s.id} ${s.name ?? ""} (${s.reason})`));
|
|
541
|
+
if (r.hint) lines.push("", r.hint);
|
|
542
|
+
return lines.join("\n");
|
|
543
|
+
}
|
|
511
544
|
function formatOutput(data, machine) {
|
|
512
545
|
if (machine) return JSON.stringify(data, null, 2);
|
|
546
|
+
if (isMoveResult(data)) return renderMove(data);
|
|
513
547
|
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
514
548
|
const { notice, ...rest } = data;
|
|
515
549
|
if (typeof notice === "string" && notice) return `Notice: ${notice}
|
|
@@ -542,7 +576,7 @@ function toIso(d) {
|
|
|
542
576
|
// package.json
|
|
543
577
|
var package_default = {
|
|
544
578
|
name: "jobkompass-cli",
|
|
545
|
-
version: "0.
|
|
579
|
+
version: "0.3.0",
|
|
546
580
|
description: "Agent-first CLI for JobKompass \u2014 run your job search from the terminal, or let an AI agent run it for you.",
|
|
547
581
|
license: "MIT",
|
|
548
582
|
type: "module",
|
|
@@ -604,6 +638,8 @@ function coerceOpt(spec, raw) {
|
|
|
604
638
|
case "bool":
|
|
605
639
|
return true;
|
|
606
640
|
// value-less flag
|
|
641
|
+
case "list":
|
|
642
|
+
return parseList(String(raw));
|
|
607
643
|
case "json":
|
|
608
644
|
try {
|
|
609
645
|
const text = String(raw);
|
package/package.json
CHANGED