@laddro/career-cli 0.1.0 → 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.
package/README.md CHANGED
@@ -63,10 +63,10 @@ laddro settings set --provider Anthropic --model claude-sonnet-4-20250514 --key
63
63
 
64
64
  ## Links
65
65
 
66
- - [Laddro](https://laddro.com) — AI-powered career tools
67
- - [API Reference](https://api.laddro.com/reference) — Interactive docs
68
- - [Documentation](https://docs.laddro.com) — Guides and tutorials
69
- - [GitHub](https://github.com/laddro-app) — All SDKs and tools
66
+ - [laddro.com](https://laddro.com)
67
+ - [API Reference](https://api.laddro.com/reference)
68
+ - [Docs](https://docs.laddro.com)
69
+ - [GitHub](https://github.com/laddro-app)
70
70
 
71
71
  ## License
72
72
 
package/dist/commands.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import { readFileSync } from "fs";
2
+ import { execSync } from "child_process";
3
+ import { createInterface } from "readline";
2
4
  import { Laddro } from "@laddro/career-sdk";
3
5
  import { getApiKey, getBaseUrl, getConfig, saveConfig } from "./config.js";
4
6
  import { error, printJSON, printTable, savePDF } from "./output.js";
@@ -12,14 +14,35 @@ function publicClient() {
12
14
  return new Laddro({ baseUrl: getBaseUrl() });
13
15
  }
14
16
  export async function login(args) {
15
- const key = args[0];
16
- if (!key)
17
- error("Usage: laddro login <api-key>");
17
+ const flags = parseFlags(args);
18
+ let key = flags.get("token") || flags.positional[0];
19
+ if (!key) {
20
+ const url = "https://console.laddro.com/api-keys";
21
+ console.log(`Opening ${url}`);
22
+ try {
23
+ const cmd = process.platform === "darwin" ? "open" : "xdg-open";
24
+ execSync(`${cmd} ${url}`, { stdio: "ignore" });
25
+ }
26
+ catch { }
27
+ console.log("Copy your API key from the console and paste it here.\n");
28
+ key = await prompt("API key: ");
29
+ if (!key)
30
+ error("No key provided.");
31
+ }
18
32
  const config = getConfig();
19
33
  config.apiKey = key;
20
34
  saveConfig(config);
21
35
  console.log("API key saved to ~/.laddro/config.json");
22
36
  }
37
+ function prompt(question) {
38
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
39
+ return new Promise((resolve) => {
40
+ rl.question(question, (answer) => {
41
+ rl.close();
42
+ resolve(answer.trim());
43
+ });
44
+ });
45
+ }
23
46
  export async function logout() {
24
47
  const config = getConfig();
25
48
  delete config.apiKey;
@@ -47,7 +70,7 @@ export async function tailor(args) {
47
70
  error("Usage: laddro tailor <position> --job-url <url> [--output <file>]");
48
71
  const outputFile = flags.get("output") || flags.get("o") || "tailored.pdf";
49
72
  console.log(`Tailoring for: ${positionName}`);
50
- const pdf = await c.tailor.run({
73
+ const result = await c.tailor.runDetailed({
51
74
  resumeId: flags.get("resume") || undefined,
52
75
  positionName,
53
76
  jobDescription: flags.get("job-description") || undefined,
@@ -56,7 +79,8 @@ export async function tailor(args) {
56
79
  language: flags.get("language") || undefined,
57
80
  templateId: flags.get("template") || undefined,
58
81
  });
59
- savePDF(pdf, outputFile);
82
+ savePDF(result.data, outputFile);
83
+ printArtifactMetadata(result.metadata);
60
84
  }
61
85
  export async function exportResume(args) {
62
86
  const c = client();
@@ -93,7 +117,7 @@ export async function coverLetter(args) {
93
117
  error("Usage: laddro cover-letter generate <position> --job-url <url>");
94
118
  const outputFile = flags.get("output") || flags.get("o") || "cover-letter.pdf";
95
119
  console.log(`Generating cover letter for: ${positionName}`);
96
- const pdf = await c.coverLetters.generate({
120
+ const result = await c.coverLetters.generateDetailed({
97
121
  resumeId: flags.get("resume") || undefined,
98
122
  positionName,
99
123
  jobDescription: flags.get("job-description") || undefined,
@@ -101,11 +125,21 @@ export async function coverLetter(args) {
101
125
  language: flags.get("language") || undefined,
102
126
  templateId: flags.get("template") || undefined,
103
127
  });
104
- savePDF(pdf, outputFile);
128
+ savePDF(result.data, outputFile);
129
+ printArtifactMetadata(result.metadata);
105
130
  return;
106
131
  }
107
132
  error(`Unknown subcommand: cover-letter ${subcommand}. Use: list, generate`);
108
133
  }
134
+ function printArtifactMetadata(metadata) {
135
+ if (!metadata.resumeId && !metadata.coverLetterId)
136
+ return;
137
+ console.log("");
138
+ if (metadata.resumeId)
139
+ console.log(`Resume ID: ${metadata.resumeId}`);
140
+ if (metadata.coverLetterId)
141
+ console.log(`Cover letter ID: ${metadata.coverLetterId}`);
142
+ }
109
143
  export async function parse(args) {
110
144
  const c = client();
111
145
  const flags = parseFlags(args);
@@ -172,10 +206,11 @@ export async function settings(args) {
172
206
  }
173
207
  }
174
208
  export function help() {
175
- console.log(`laddro Laddro Career API CLI
209
+ console.log(`laddro - Laddro Career API CLI
176
210
 
177
211
  Commands:
178
- login <api-key> Save API key
212
+ login Open browser to get API key
213
+ login --token <key> Save API key directly
179
214
  logout Remove saved API key
180
215
  resumes List your resumes
181
216
  tailor <position> Tailor resume for a job
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@laddro/career-cli",
3
- "version": "0.1.0",
4
- "description": "CLI for the Laddro Career API — tailor resumes, generate cover letters, export PDFs from the terminal",
3
+ "version": "0.2.0",
4
+ "description": "CLI for the Laddro Career API",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "laddro": "./dist/index.js"
@@ -12,7 +12,10 @@
12
12
  "scripts": {
13
13
  "build": "tsc",
14
14
  "dev": "tsc --watch",
15
- "prepublishOnly": "npm run build"
15
+ "prepublishOnly": "npm run build",
16
+ "changeset": "changeset",
17
+ "release": "npm run build && changeset publish",
18
+ "version": "changeset version"
16
19
  },
17
20
  "keywords": [
18
21
  "laddro",
@@ -32,10 +35,10 @@
32
35
  "node": ">=18"
33
36
  },
34
37
  "dependencies": {
35
- "@laddro/career-sdk": "file:../laddro-career-sdk-ts",
36
- "tsx": "^4.21.0"
38
+ "@laddro/career-sdk": "^0.2.0"
37
39
  },
38
40
  "devDependencies": {
41
+ "@changesets/cli": "^2.31.0",
39
42
  "@types/node": "^22.19.18",
40
43
  "typescript": "^5.9.3"
41
44
  }