jobkompass-cli 0.1.5 → 0.2.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 +23 -2
  2. package/dist/index.js +138 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,7 @@ Run your JobKompass job search from the terminal — or let an AI agent (Claude
10
10
  `JK_BASE_URL` overrides the target deployment (defaults to the live one).
11
11
 
12
12
  ## For agents
13
- - Run `jk schema` once — it returns every route, param, and type as JSON.
13
+ - Run `jk schema` once — it returns every route, param, and type as JSON, plus `workflows.resumeQuestions` (the never-invent-a-number flow).
14
14
  - Output is JSON whenever stdout is piped. Exit codes: 0 ok, 1 your mistake (read `error.hint`), 2 server/network.
15
15
  - Destructive commands need `--yes`. Nothing ever prompts.
16
16
 
@@ -23,7 +23,28 @@ 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
- Resume templates: `jake` (default) or `mar` (Calibri-style, competencies-forward — use `--core-competencies` and `--early-career`). Run `jk resumes add --help` for all fields.
26
+ ## Resume questions: never invent a number
27
+ Strong bullets carry numbers. Only the human knows them, so the API asks instead of guessing.
28
+
29
+ jk resumes questions --id <baseResumeId> [--job <jobId>] [--ai] # before writing
30
+ jk resumes answer --id <baseResumeId> --answers '[{"id":"<question id>","answer":"about 40 a day"}]'
31
+ jk resumes get --id <baseResumeId> # shows saved bulletAnswers
32
+ jk resumes add ... --job <jobId> [--ai-questions] # response: questions + scorecard
33
+ jk resumes tailor --base <resumeId> --job <jobId> [--template mar] [--instructions "lead with the data work"]
34
+ # server writes it, using saved answers
35
+
36
+ `resumes add` / `update` return `{id, name, fileUrl, questions, questionSource, scorecard, rule}`.
37
+ Questions are built-in by default (free, instant); `--ai-questions` / `--ai` asks the model instead and never rewrites
38
+ your content. Relay questions to your human, save their answers with `jk resumes answer`, and every later resume reuses them.
39
+
40
+ `resumes tailor` saves the same result as tailoring in the app: your saved resume preferences plus `--instructions`,
41
+ your default template (unless `--template`), the app's document name, the "what changed" marks and must-haves shown in
42
+ Documents, and the job's `resumeUsed`. Passing an already-tailored resume as `--base` writes from the original base it
43
+ came from, with that base's saved answers. The raw API also takes `preferences` (a JSON array) to replace the saved ones.
44
+ If `--template` is above your plan, tailoring still runs with `jake` and prints a notice (the `notice` field in `--json`)
45
+ instead of failing.
46
+
47
+ Resume templates: `jake` (default), `joseph` (Calibri-style, competencies-forward: use `--core-competencies` and `--early-career`) or `mar` (Times serif, categorized skills). Joseph and Mar need a paid plan. Run `jk resumes add --help` for all fields.
27
48
 
28
49
  ## Keys
29
50
  A key carries full access to one account's data. Name each key after where it lives
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  // src/index.ts
4
4
  import { Command } from "commander";
5
+ import { readFileSync as readFileSync2 } from "fs";
5
6
 
6
7
  // src/commands.ts
7
8
  var jobWriteOpts = [
@@ -16,6 +17,27 @@ var jobWriteOpts = [
16
17
  { flag: "--coverletter-used <name>", api: "coverLetterUsed", type: "str" },
17
18
  { flag: "--notes <text>", api: "notes", type: "str" }
18
19
  ];
20
+ var prepWriteOpts = [
21
+ { flag: "--job-id <id>", api: "jobId", type: "str" },
22
+ { flag: "--interviewer-name <n>", api: "interviewerName", type: "str" },
23
+ { flag: "--interviewer-role <r>", api: "interviewerRole", type: "str" },
24
+ { flag: "--interviewer-email <e>", api: "interviewerEmail", type: "str" },
25
+ { flag: "--interview-date <d>", api: "interviewDate", type: "str" },
26
+ { flag: "--meeting-link <url>", api: "meetingLink", type: "str" },
27
+ { flag: "--phone-backup <p>", api: "phoneBackup", type: "str" },
28
+ { flag: "--compensation-target <c>", api: "compensationTarget", type: "str" },
29
+ { flag: "--resume-used <name>", api: "resumeUsed", type: "str" },
30
+ { flag: "--status <s>", api: "status", type: "str", desc: "upcoming|ready|completed|archived" },
31
+ { flag: "--elevator-pitch <text>", api: "elevatorPitch", type: "str" },
32
+ { flag: "--role-summary <text>", api: "roleSummary", type: "str" },
33
+ { flag: "--flashcards <json>", api: "flashcards", type: "json", desc: "JSON or @file.json; replaces the array" },
34
+ { flag: "--stories <json>", api: "stories", type: "json", desc: "JSON or @file.json; replaces the array" },
35
+ { flag: "--requirement-matches <json>", api: "requirementMatches", type: "json", desc: "JSON or @file.json" },
36
+ { flag: "--questions <json>", api: "questionsToAsk", type: "json", desc: "JSON or @file.json" },
37
+ { flag: "--traps <json>", api: "trapsAndGuardrails", type: "json", desc: "JSON or @file.json" },
38
+ { flag: "--checklist <json>", api: "checklist", type: "json", desc: "JSON or @file.json" },
39
+ { flag: "--call-notes <text>", api: "callNotes", type: "str" }
40
+ ];
19
41
  var resourceWriteOpts = [
20
42
  { flag: "--description <text>", api: "description", type: "str" },
21
43
  { flag: "--notes <text>", api: "notes", type: "str" },
@@ -99,6 +121,16 @@ var commands = [
99
121
  path: "/agent/resumes/duplicate",
100
122
  opts: [{ flag: "--id <id>", api: "id", type: "str", required: true }]
101
123
  },
124
+ {
125
+ name: "resumes share",
126
+ desc: "Get a public link to a resume's PDF (--off makes it private)",
127
+ method: "POST",
128
+ path: "/agent/resumes/share",
129
+ opts: [
130
+ { flag: "--id <id>", api: "id", type: "str", required: true },
131
+ { flag: "--off", api: "off", type: "bool" }
132
+ ]
133
+ },
102
134
  {
103
135
  name: "resumes delete",
104
136
  desc: "Delete a resume + stored file",
@@ -130,7 +162,9 @@ var commands = [
130
162
  { flag: "--early-career <json>", api: "earlyCareer", type: "json", desc: "(Joseph template) [{title,company,location?,date}]" },
131
163
  { flag: "--additional-info <json>", api: "additionalInfo", type: "json", desc: '{"languages"?:[...],"references"?}' },
132
164
  { flag: "--target-company <name>", api: "targetCompany", type: "str", desc: "Included in the saved resume's name" },
133
- { flag: "--template <id>", api: "template", type: "str", desc: "Template id: jake (default), joseph or mar" }
165
+ { flag: "--template <id>", api: "template", type: "str", desc: "Template id: jake (default), joseph or mar" },
166
+ { flag: "--job <id>", api: "jobId", type: "str", desc: "Saved job this targets: scorecard must-haves + context for --ai-questions" },
167
+ { flag: "--ai-questions", api: "aiQuestions", type: "bool", desc: "Ask the model for sharper questions (slower). Your content is never rewritten" }
134
168
  ]
135
169
  },
136
170
  {
@@ -155,7 +189,48 @@ var commands = [
155
189
  { flag: "--core-competencies <json>", api: "coreCompetencies", type: "json", desc: '(Joseph template) ["Technical Support",...]' },
156
190
  { flag: "--early-career <json>", api: "earlyCareer", type: "json", desc: "(Joseph template) [{title,company,location?,date}]" },
157
191
  { flag: "--additional-info <json>", api: "additionalInfo", type: "json", desc: '{"languages"?:[...],"references"?}' },
158
- { flag: "--template <id>", api: "template", type: "str", desc: "Switch template: jake, joseph or mar" }
192
+ { flag: "--template <id>", api: "template", type: "str", desc: "Switch template: jake, joseph or mar" },
193
+ { flag: "--job <id>", api: "jobId", type: "str", desc: "Saved job this targets: scorecard must-haves + context for --ai-questions" },
194
+ { flag: "--ai-questions", api: "aiQuestions", type: "bool", desc: "Ask the model for sharper questions (slower). Your content is never rewritten" }
195
+ ]
196
+ },
197
+ {
198
+ name: "resumes questions",
199
+ desc: "Questions about bullets missing a number, before generating (ask your human, then 'jk resumes answer')",
200
+ method: "GET",
201
+ path: "/agent/resumes/questions",
202
+ opts: [
203
+ { flag: "--id <id>", api: "id", type: "str", required: true },
204
+ { flag: "--job <id>", api: "jobId", type: "str", desc: "Saved job to target" },
205
+ { flag: "--ai", api: "ai", type: "bool", desc: "Ask the model (slower); default is built-in questions" }
206
+ ]
207
+ },
208
+ {
209
+ name: "resumes answer",
210
+ desc: "Save your human's answers as facts on the base resume (reused by every later resume)",
211
+ method: "POST",
212
+ path: "/agent/resumes/answers",
213
+ opts: [
214
+ { flag: "--id <id>", api: "id", type: "str", required: true, desc: "Resume the questions came from (a tailored resume saves onto its base)" },
215
+ {
216
+ flag: "--answers <json>",
217
+ api: "answers",
218
+ type: "json",
219
+ required: true,
220
+ desc: '[{"id":"<question id>","answer":"..."}] or [{"section","index","bullet","answer"}]; JSON or @file.json'
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ name: "resumes tailor",
226
+ desc: "Server-side tailoring of a resume to a saved job, using saved answers; makes a NEW resume PDF",
227
+ method: "POST",
228
+ path: "/agent/resumes/tailor",
229
+ opts: [
230
+ { flag: "--base <id>", api: "base", type: "str", required: true, desc: "Resume to tailor from (not modified)" },
231
+ { flag: "--job <id>", api: "jobId", type: "str", required: true },
232
+ { flag: "--template <id>", api: "template", type: "str", desc: "jake, joseph or mar (default: your default template, then the base's)" },
233
+ { flag: "--instructions <text>", api: "instructions", type: "str", desc: "One-off instruction (wording and emphasis only, never new facts); added after your saved resume preferences" }
159
234
  ]
160
235
  },
161
236
  // coverletters
@@ -261,6 +336,52 @@ var commands = [
261
336
  confirm: true,
262
337
  opts: [{ flag: "--id <id>", api: "id", type: "str", required: true }]
263
338
  },
339
+ // interview preps
340
+ {
341
+ name: "preps list",
342
+ desc: "List interview prep decks",
343
+ method: "GET",
344
+ path: "/agent/interviewpreps",
345
+ opts: [{ flag: "--job-id <id>", api: "jobId", type: "str" }]
346
+ },
347
+ {
348
+ name: "preps get",
349
+ desc: "Get one interview prep deck in full",
350
+ method: "GET",
351
+ path: "/agent/interviewpreps/get",
352
+ opts: [{ flag: "--id <id>", api: "id", type: "str", required: true }]
353
+ },
354
+ {
355
+ name: "preps add",
356
+ desc: "Create an interview prep deck",
357
+ method: "POST",
358
+ path: "/agent/interviewpreps",
359
+ opts: [
360
+ { flag: "--company <c>", api: "company", type: "str", required: true },
361
+ { flag: "--role <r>", api: "role", type: "str", required: true },
362
+ ...prepWriteOpts
363
+ ]
364
+ },
365
+ {
366
+ name: "preps update",
367
+ desc: "Update an interview prep deck (array flags replace the whole array)",
368
+ method: "PATCH",
369
+ path: "/agent/interviewpreps",
370
+ opts: [
371
+ { flag: "--id <id>", api: "id", type: "str", required: true },
372
+ { flag: "--company <c>", api: "company", type: "str" },
373
+ { flag: "--role <r>", api: "role", type: "str" },
374
+ ...prepWriteOpts
375
+ ]
376
+ },
377
+ {
378
+ name: "preps delete",
379
+ desc: "Delete an interview prep deck",
380
+ method: "DELETE",
381
+ path: "/agent/interviewpreps",
382
+ confirm: true,
383
+ opts: [{ flag: "--id <id>", api: "id", type: "str", required: true }]
384
+ },
264
385
  // threads (read-only)
265
386
  { name: "threads list", desc: "List AI chat threads", method: "GET", path: "/agent/threads", opts: [] },
266
387
  {
@@ -387,9 +508,19 @@ function renderPretty(data) {
387
508
  }
388
509
  return String(data);
389
510
  }
511
+ function formatOutput(data, machine) {
512
+ if (machine) return JSON.stringify(data, null, 2);
513
+ if (data && typeof data === "object" && !Array.isArray(data)) {
514
+ const { notice, ...rest } = data;
515
+ if (typeof notice === "string" && notice) return `Notice: ${notice}
516
+
517
+ ${renderPretty(rest)}`;
518
+ }
519
+ return renderPretty(data);
520
+ }
390
521
  function emit(data, opts = {}) {
391
- const machine = opts.json || !process.stdout.isTTY;
392
- process.stdout.write((machine ? JSON.stringify(data, null, 2) : renderPretty(data)) + "\n");
522
+ const machine = Boolean(opts.json) || !process.stdout.isTTY;
523
+ process.stdout.write(formatOutput(data, machine) + "\n");
393
524
  }
394
525
 
395
526
  // src/dates.ts
@@ -411,7 +542,7 @@ function toIso(d) {
411
542
  // package.json
412
543
  var package_default = {
413
544
  name: "jobkompass-cli",
414
- version: "0.1.5",
545
+ version: "0.2.0",
415
546
  description: "Agent-first CLI for JobKompass \u2014 run your job search from the terminal, or let an AI agent run it for you.",
416
547
  license: "MIT",
417
548
  type: "module",
@@ -475,7 +606,8 @@ function coerceOpt(spec, raw) {
475
606
  // value-less flag
476
607
  case "json":
477
608
  try {
478
- return JSON.parse(String(raw));
609
+ const text = String(raw);
610
+ return JSON.parse(text.startsWith("@") ? readFileSync2(text.slice(1), "utf8") : text);
479
611
  } catch {
480
612
  fatal("invalid_option", `Option ${spec.flag.split(" ")[0]} must be valid JSON`, `Example: '${spec.desc ?? "[...]"}'`, 1);
481
613
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jobkompass-cli",
3
- "version": "0.1.5",
3
+ "version": "0.2.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",