@laddro/career-cli 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Laddro Digital UG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ # @laddro/career-cli
2
+
3
+ CLI for the [Laddro Career API](https://api.laddro.com/reference). Tailor resumes, generate cover letters, and export PDFs from your terminal.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @laddro/career-cli
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```bash
14
+ # Save your API key
15
+ laddro login laddro_live_...
16
+
17
+ # List your resumes
18
+ laddro resumes
19
+
20
+ # Tailor a resume for a job
21
+ laddro tailor "Senior Frontend Engineer" --job-url https://jobs.example.com/sfe
22
+
23
+ # Generate a cover letter
24
+ laddro cover-letter generate "Product Manager" --job-url https://jobs.example.com/pm
25
+
26
+ # Export as PDF with a different template
27
+ laddro export abc-123 --template COBALT --output my-resume.pdf
28
+
29
+ # Parse and render an existing PDF
30
+ laddro parse ./old-resume.pdf --template GRAPHITE
31
+
32
+ # Browse templates
33
+ laddro templates
34
+ laddro templates GRAPHITE
35
+
36
+ # Configure BYOK
37
+ laddro settings set --provider Anthropic --model claude-sonnet-4-20250514 --key sk-ant-...
38
+ ```
39
+
40
+ ## Commands
41
+
42
+ | Command | Description |
43
+ |---|---|
44
+ | `login <key>` | Save API key to `~/.laddro/config.json` |
45
+ | `logout` | Remove saved API key |
46
+ | `resumes` | List your resumes |
47
+ | `tailor <position>` | Tailor resume for a job |
48
+ | `export <id>` | Export resume as PDF |
49
+ | `parse <file>` | Parse PDF and render with template |
50
+ | `cover-letter list` | List cover letters |
51
+ | `cover-letter generate <position>` | Generate cover letter |
52
+ | `templates [id]` | Browse templates |
53
+ | `settings` | View AI config |
54
+ | `settings set` | Set BYOK provider |
55
+ | `settings remove` | Remove AI config |
56
+
57
+ ## Environment variables
58
+
59
+ | Variable | Description |
60
+ |---|---|
61
+ | `LADDRO_API_KEY` | API key (overrides config file) |
62
+ | `LADDRO_BASE_URL` | Custom API URL |
63
+
64
+ ## Links
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
70
+
71
+ ## License
72
+
73
+ MIT
@@ -0,0 +1,10 @@
1
+ export declare function login(args: string[]): Promise<void>;
2
+ export declare function logout(): Promise<void>;
3
+ export declare function resumes(args: string[]): Promise<void>;
4
+ export declare function tailor(args: string[]): Promise<void>;
5
+ export declare function exportResume(args: string[]): Promise<void>;
6
+ export declare function coverLetter(args: string[]): Promise<void>;
7
+ export declare function parse(args: string[]): Promise<void>;
8
+ export declare function templates(args: string[]): Promise<void>;
9
+ export declare function settings(args: string[]): Promise<void>;
10
+ export declare function help(): void;
@@ -0,0 +1,241 @@
1
+ import { readFileSync } from "fs";
2
+ import { Laddro } from "@laddro/career-sdk";
3
+ import { getApiKey, getBaseUrl, getConfig, saveConfig } from "./config.js";
4
+ import { error, printJSON, printTable, savePDF } from "./output.js";
5
+ function client() {
6
+ const apiKey = getApiKey();
7
+ if (!apiKey)
8
+ error("No API key. Run: laddro login <key>");
9
+ return new Laddro({ apiKey, baseUrl: getBaseUrl() });
10
+ }
11
+ function publicClient() {
12
+ return new Laddro({ baseUrl: getBaseUrl() });
13
+ }
14
+ export async function login(args) {
15
+ const key = args[0];
16
+ if (!key)
17
+ error("Usage: laddro login <api-key>");
18
+ const config = getConfig();
19
+ config.apiKey = key;
20
+ saveConfig(config);
21
+ console.log("API key saved to ~/.laddro/config.json");
22
+ }
23
+ export async function logout() {
24
+ const config = getConfig();
25
+ delete config.apiKey;
26
+ saveConfig(config);
27
+ console.log("API key removed.");
28
+ }
29
+ export async function resumes(args) {
30
+ const c = client();
31
+ const list = await c.resumes.list({ limit: 20 });
32
+ printTable(list.items.map((r) => ({
33
+ id: r.resumeId,
34
+ title: r.title,
35
+ default: r.isDefault ? "✓" : "",
36
+ updated: r.updatedAt.split("T")[0],
37
+ })), ["id", "title", "default", "updated"]);
38
+ if (list.total > list.items.length) {
39
+ console.log(`\n(showing ${list.items.length} of ${list.total})`);
40
+ }
41
+ }
42
+ export async function tailor(args) {
43
+ const c = client();
44
+ const flags = parseFlags(args);
45
+ const positionName = flags.positional[0];
46
+ if (!positionName)
47
+ error("Usage: laddro tailor <position> --job-url <url> [--output <file>]");
48
+ const outputFile = flags.get("output") || flags.get("o") || "tailored.pdf";
49
+ console.log(`Tailoring for: ${positionName}`);
50
+ const pdf = await c.tailor.run({
51
+ resumeId: flags.get("resume") || undefined,
52
+ positionName,
53
+ jobDescription: flags.get("job-description") || undefined,
54
+ jobUrl: flags.get("job-url") || flags.get("job") || undefined,
55
+ mode: flags.get("mode") || undefined,
56
+ language: flags.get("language") || undefined,
57
+ templateId: flags.get("template") || undefined,
58
+ });
59
+ savePDF(pdf, outputFile);
60
+ }
61
+ export async function exportResume(args) {
62
+ const c = client();
63
+ const flags = parseFlags(args);
64
+ const resumeId = flags.positional[0];
65
+ if (!resumeId)
66
+ error("Usage: laddro export <resume-id> [--template GRAPHITE] [--output <file>]");
67
+ const outputFile = flags.get("output") || flags.get("o") || "resume.pdf";
68
+ const pdf = await c.export.pdf({
69
+ resumeId,
70
+ templateId: flags.get("template") || undefined,
71
+ colorId: flags.get("color") || undefined,
72
+ font: flags.get("font") || undefined,
73
+ locale: flags.get("locale") || undefined,
74
+ });
75
+ savePDF(pdf, outputFile);
76
+ }
77
+ export async function coverLetter(args) {
78
+ const c = client();
79
+ const subcommand = args[0];
80
+ if (subcommand === "list" || !subcommand) {
81
+ const list = await c.coverLetters.list({ limit: 20 });
82
+ printTable(list.items.map((cl) => ({
83
+ id: cl.coverLetterId,
84
+ title: cl.title,
85
+ updated: cl.updatedAt.split("T")[0],
86
+ })), ["id", "title", "updated"]);
87
+ return;
88
+ }
89
+ if (subcommand === "generate") {
90
+ const flags = parseFlags(args.slice(1));
91
+ const positionName = flags.positional[0];
92
+ if (!positionName)
93
+ error("Usage: laddro cover-letter generate <position> --job-url <url>");
94
+ const outputFile = flags.get("output") || flags.get("o") || "cover-letter.pdf";
95
+ console.log(`Generating cover letter for: ${positionName}`);
96
+ const pdf = await c.coverLetters.generate({
97
+ resumeId: flags.get("resume") || undefined,
98
+ positionName,
99
+ jobDescription: flags.get("job-description") || undefined,
100
+ jobUrl: flags.get("job-url") || flags.get("job") || undefined,
101
+ language: flags.get("language") || undefined,
102
+ templateId: flags.get("template") || undefined,
103
+ });
104
+ savePDF(pdf, outputFile);
105
+ return;
106
+ }
107
+ error(`Unknown subcommand: cover-letter ${subcommand}. Use: list, generate`);
108
+ }
109
+ export async function parse(args) {
110
+ const c = client();
111
+ const flags = parseFlags(args);
112
+ const filePath = flags.positional[0];
113
+ if (!filePath)
114
+ error("Usage: laddro parse <file.pdf> [--template GRAPHITE] [--output <file>]");
115
+ const outputFile = flags.get("output") || flags.get("o") || "parsed.pdf";
116
+ const fileBuffer = readFileSync(filePath);
117
+ console.log(`Parsing: ${filePath}`);
118
+ const pdf = await c.resumes.parse({
119
+ file: fileBuffer,
120
+ filename: filePath.split("/").pop(),
121
+ templateId: flags.get("template") || undefined,
122
+ locale: flags.get("locale") || undefined,
123
+ colorId: flags.get("color") || undefined,
124
+ font: flags.get("font") || undefined,
125
+ });
126
+ savePDF(pdf, outputFile);
127
+ }
128
+ export async function templates(args) {
129
+ const c = publicClient();
130
+ const templateId = args[0];
131
+ if (templateId) {
132
+ const detail = await c.templates.get(templateId);
133
+ printJSON(detail);
134
+ return;
135
+ }
136
+ const list = await c.templates.list();
137
+ printTable(list.map((t) => ({
138
+ id: t.id,
139
+ name: t.name,
140
+ ats: t.atsScore,
141
+ layout: t.layoutType,
142
+ })), ["id", "name", "ats", "layout"]);
143
+ }
144
+ export async function settings(args) {
145
+ const c = client();
146
+ const subcommand = args[0];
147
+ if (subcommand === "set") {
148
+ const flags = parseFlags(args.slice(1));
149
+ const provider = flags.get("provider");
150
+ const apiKey = flags.get("key");
151
+ if (!provider || !apiKey)
152
+ error("Usage: laddro settings set --provider <name> --key <key> [--model <id>]");
153
+ const result = await c.settings.updateModel({
154
+ provider,
155
+ model: flags.get("model") || undefined,
156
+ apiKey,
157
+ });
158
+ console.log(`AI provider set: ${result.ai?.provider} / ${result.ai?.model}`);
159
+ return;
160
+ }
161
+ if (subcommand === "remove") {
162
+ await c.settings.deleteModel();
163
+ console.log("AI settings removed. Using Laddro defaults.");
164
+ return;
165
+ }
166
+ const result = await c.settings.get();
167
+ if (result.ai) {
168
+ printJSON(result.ai);
169
+ }
170
+ else {
171
+ console.log("No AI provider configured. Using Laddro defaults.");
172
+ }
173
+ }
174
+ export function help() {
175
+ console.log(`laddro — Laddro Career API CLI
176
+
177
+ Commands:
178
+ login <api-key> Save API key
179
+ logout Remove saved API key
180
+ resumes List your resumes
181
+ tailor <position> Tailor resume for a job
182
+ export <resume-id> Export resume as PDF
183
+ parse <file.pdf> Parse and render a PDF resume
184
+ cover-letter list List cover letters
185
+ cover-letter generate Generate a cover letter
186
+ templates [id] Browse templates
187
+ settings View AI settings
188
+ settings set Configure BYOK provider
189
+ settings remove Remove AI config
190
+ help Show this help
191
+
192
+ Flags (vary by command):
193
+ --job-url, --job Job posting URL
194
+ --job-description Job description text
195
+ --resume Resume ID (uses default otherwise)
196
+ --template Template ID (e.g. GRAPHITE)
197
+ --output, -o Output file path
198
+ --language Output language code
199
+ --mode Tailor mode (standard|new)
200
+ --provider AI provider name
201
+ --model AI model ID
202
+ --key AI provider API key
203
+
204
+ Environment:
205
+ LADDRO_API_KEY API key (overrides config file)
206
+ LADDRO_BASE_URL Custom API URL
207
+ `);
208
+ }
209
+ function parseFlags(args) {
210
+ const positional = [];
211
+ const flags = new Map();
212
+ for (let i = 0; i < args.length; i++) {
213
+ const arg = args[i];
214
+ if (arg.startsWith("--")) {
215
+ const key = arg.slice(2);
216
+ const next = args[i + 1];
217
+ if (next && !next.startsWith("--")) {
218
+ flags.set(key, next);
219
+ i++;
220
+ }
221
+ else {
222
+ flags.set(key, "true");
223
+ }
224
+ }
225
+ else if (arg.startsWith("-") && arg.length === 2) {
226
+ const key = arg.slice(1);
227
+ const next = args[i + 1];
228
+ if (next && !next.startsWith("-")) {
229
+ flags.set(key, next);
230
+ i++;
231
+ }
232
+ else {
233
+ flags.set(key, "true");
234
+ }
235
+ }
236
+ else {
237
+ positional.push(arg);
238
+ }
239
+ }
240
+ return { positional, get: (key) => flags.get(key) };
241
+ }
@@ -0,0 +1,9 @@
1
+ interface Config {
2
+ apiKey?: string;
3
+ baseUrl?: string;
4
+ }
5
+ export declare function getConfig(): Config;
6
+ export declare function saveConfig(config: Config): void;
7
+ export declare function getApiKey(): string;
8
+ export declare function getBaseUrl(): string;
9
+ export {};
package/dist/config.js ADDED
@@ -0,0 +1,30 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
2
+ import { homedir } from "os";
3
+ import { join } from "path";
4
+ const CONFIG_DIR = join(homedir(), ".laddro");
5
+ const CONFIG_FILE = join(CONFIG_DIR, "config.json");
6
+ export function getConfig() {
7
+ if (!existsSync(CONFIG_FILE))
8
+ return {};
9
+ try {
10
+ return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
11
+ }
12
+ catch {
13
+ return {};
14
+ }
15
+ }
16
+ export function saveConfig(config) {
17
+ if (!existsSync(CONFIG_DIR))
18
+ mkdirSync(CONFIG_DIR, { recursive: true });
19
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n");
20
+ }
21
+ export function getApiKey() {
22
+ const envKey = process.env.LADDRO_API_KEY;
23
+ if (envKey)
24
+ return envKey;
25
+ const config = getConfig();
26
+ return config.apiKey || "";
27
+ }
28
+ export function getBaseUrl() {
29
+ return process.env.LADDRO_BASE_URL || getConfig().baseUrl || "https://api.laddro.com";
30
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env node
2
+ import { LaddroAPIError } from "@laddro/career-sdk";
3
+ import * as commands from "./commands.js";
4
+ const [command, ...args] = process.argv.slice(2);
5
+ async function run() {
6
+ switch (command) {
7
+ case "login":
8
+ return commands.login(args);
9
+ case "logout":
10
+ return commands.logout();
11
+ case "resumes":
12
+ return commands.resumes(args);
13
+ case "tailor":
14
+ return commands.tailor(args);
15
+ case "export":
16
+ return commands.exportResume(args);
17
+ case "parse":
18
+ return commands.parse(args);
19
+ case "cover-letter":
20
+ return commands.coverLetter(args);
21
+ case "templates":
22
+ return commands.templates(args);
23
+ case "settings":
24
+ return commands.settings(args);
25
+ case "help":
26
+ case "--help":
27
+ case "-h":
28
+ case undefined:
29
+ return commands.help();
30
+ default:
31
+ console.error(`Unknown command: ${command}`);
32
+ console.error("Run 'laddro help' for usage.");
33
+ process.exit(1);
34
+ }
35
+ }
36
+ run().catch((err) => {
37
+ if (err instanceof LaddroAPIError) {
38
+ console.error(`error: ${err.message} (${err.status})`);
39
+ }
40
+ else {
41
+ console.error(`error: ${err.message || err}`);
42
+ }
43
+ process.exit(1);
44
+ });
@@ -0,0 +1,6 @@
1
+ export declare function printJSON(data: unknown): void;
2
+ export declare function printTable(rows: Record<string, unknown>[], columns?: string[]): void;
3
+ export declare function savePDF(data: ArrayBuffer | bytes, outputPath: string): void;
4
+ export declare function error(message: string): never;
5
+ type bytes = Uint8Array;
6
+ export {};
package/dist/output.js ADDED
@@ -0,0 +1,28 @@
1
+ import { writeFileSync } from "fs";
2
+ export function printJSON(data) {
3
+ console.log(JSON.stringify(data, null, 2));
4
+ }
5
+ export function printTable(rows, columns) {
6
+ if (rows.length === 0) {
7
+ console.log("(no results)");
8
+ return;
9
+ }
10
+ const keys = columns || Object.keys(rows[0]);
11
+ const widths = keys.map((k) => Math.max(k.length, ...rows.map((r) => String(r[k] ?? "").length)));
12
+ const header = keys.map((k, i) => k.padEnd(widths[i])).join(" ");
13
+ const sep = widths.map((w) => "-".repeat(w)).join(" ");
14
+ console.log(header);
15
+ console.log(sep);
16
+ for (const row of rows) {
17
+ const line = keys.map((k, i) => String(row[k] ?? "").padEnd(widths[i])).join(" ");
18
+ console.log(line);
19
+ }
20
+ }
21
+ export function savePDF(data, outputPath) {
22
+ writeFileSync(outputPath, Buffer.from(data));
23
+ console.log(`Saved: ${outputPath}`);
24
+ }
25
+ export function error(message) {
26
+ console.error(`error: ${message}`);
27
+ process.exit(1);
28
+ }
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
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",
5
+ "type": "module",
6
+ "bin": {
7
+ "laddro": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "dev": "tsc --watch",
15
+ "prepublishOnly": "npm run build"
16
+ },
17
+ "keywords": [
18
+ "laddro",
19
+ "career",
20
+ "resume",
21
+ "cli",
22
+ "cover-letter"
23
+ ],
24
+ "author": "Laddro <support@laddro.com>",
25
+ "license": "MIT",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/laddro-app/laddro-career-cli"
29
+ },
30
+ "homepage": "https://docs.laddro.com",
31
+ "engines": {
32
+ "node": ">=18"
33
+ },
34
+ "dependencies": {
35
+ "@laddro/career-sdk": "file:../laddro-career-sdk-ts",
36
+ "tsx": "^4.21.0"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.19.18",
40
+ "typescript": "^5.9.3"
41
+ }
42
+ }