hiregraph 0.1.3 → 0.1.4
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/dist/index.js +82 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3407,9 +3407,89 @@ async function installSkillCommand() {
|
|
|
3407
3407
|
console.log();
|
|
3408
3408
|
}
|
|
3409
3409
|
|
|
3410
|
+
// src/commands/setup.ts
|
|
3411
|
+
import inquirer3 from "inquirer";
|
|
3412
|
+
import { homedir as homedir3 } from "os";
|
|
3413
|
+
import { join as join12 } from "path";
|
|
3414
|
+
import { readFile as readFile10, writeFile as writeFile4, appendFile } from "fs/promises";
|
|
3415
|
+
import { existsSync as existsSync11 } from "fs";
|
|
3416
|
+
async function setupCommand(options) {
|
|
3417
|
+
header("\n HireGraph Setup\n");
|
|
3418
|
+
if (isApiKeyConfigured()) {
|
|
3419
|
+
success(" ANTHROPIC_API_KEY is already set. You're good to go!");
|
|
3420
|
+
info(" Run `hiregraph init` to set up your profile.");
|
|
3421
|
+
return;
|
|
3422
|
+
}
|
|
3423
|
+
console.log(" HireGraph needs an Anthropic API key to power LLM features");
|
|
3424
|
+
console.log(" (job matching, resume tailoring, project classification).\n");
|
|
3425
|
+
console.log(" This is separate from your Claude Code subscription.");
|
|
3426
|
+
console.log(" Get a key at: https://console.anthropic.com/settings/keys\n");
|
|
3427
|
+
console.log(" Anthropic offers free credits for new accounts.");
|
|
3428
|
+
console.log(" HireGraph costs ~$2 for first setup, ~$0.15/day after.\n");
|
|
3429
|
+
let apiKey = options.key;
|
|
3430
|
+
if (!apiKey) {
|
|
3431
|
+
const answer = await inquirer3.prompt([{
|
|
3432
|
+
type: "password",
|
|
3433
|
+
name: "key",
|
|
3434
|
+
message: "Paste your ANTHROPIC_API_KEY:",
|
|
3435
|
+
mask: "*"
|
|
3436
|
+
}]);
|
|
3437
|
+
apiKey = answer.key;
|
|
3438
|
+
}
|
|
3439
|
+
if (!apiKey || !apiKey.startsWith("sk-ant-")) {
|
|
3440
|
+
error(' Invalid key. It should start with "sk-ant-"');
|
|
3441
|
+
return;
|
|
3442
|
+
}
|
|
3443
|
+
process.env.ANTHROPIC_API_KEY = apiKey;
|
|
3444
|
+
const platform = process.platform;
|
|
3445
|
+
if (platform === "win32") {
|
|
3446
|
+
const { execSync } = await import("child_process");
|
|
3447
|
+
try {
|
|
3448
|
+
execSync(`setx ANTHROPIC_API_KEY "${apiKey}"`, { stdio: "pipe" });
|
|
3449
|
+
success(" API key saved to Windows environment variables.");
|
|
3450
|
+
warn(" Restart your terminal for it to take effect everywhere.");
|
|
3451
|
+
} catch {
|
|
3452
|
+
warn(" Could not save to system env. Set it manually:");
|
|
3453
|
+
console.log(` $env:ANTHROPIC_API_KEY = "${apiKey}"`);
|
|
3454
|
+
}
|
|
3455
|
+
} else {
|
|
3456
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
3457
|
+
const rcFile = shell.includes("zsh") ? join12(homedir3(), ".zshrc") : join12(homedir3(), ".bashrc");
|
|
3458
|
+
const exportLine = `
|
|
3459
|
+
export ANTHROPIC_API_KEY="${apiKey}"
|
|
3460
|
+
`;
|
|
3461
|
+
try {
|
|
3462
|
+
if (existsSync11(rcFile)) {
|
|
3463
|
+
const content = await readFile10(rcFile, "utf-8");
|
|
3464
|
+
if (content.includes("ANTHROPIC_API_KEY")) {
|
|
3465
|
+
info(` Key already in ${rcFile}. Updating...`);
|
|
3466
|
+
const updated = content.replace(
|
|
3467
|
+
/export ANTHROPIC_API_KEY="[^"]*"/,
|
|
3468
|
+
`export ANTHROPIC_API_KEY="${apiKey}"`
|
|
3469
|
+
);
|
|
3470
|
+
await writeFile4(rcFile, updated, "utf-8");
|
|
3471
|
+
} else {
|
|
3472
|
+
await appendFile(rcFile, exportLine);
|
|
3473
|
+
}
|
|
3474
|
+
} else {
|
|
3475
|
+
await writeFile4(rcFile, exportLine);
|
|
3476
|
+
}
|
|
3477
|
+
success(` API key saved to ${rcFile}`);
|
|
3478
|
+
warn(" Run `source " + rcFile + "` or restart your terminal.");
|
|
3479
|
+
} catch {
|
|
3480
|
+
warn(" Could not save to shell profile. Set it manually:");
|
|
3481
|
+
console.log(` export ANTHROPIC_API_KEY="${apiKey}"`);
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
console.log();
|
|
3485
|
+
success(" Setup complete! Now run:");
|
|
3486
|
+
info(' hiregraph init --name "Your Name" --email "you@email.com" --role builder');
|
|
3487
|
+
console.log();
|
|
3488
|
+
}
|
|
3489
|
+
|
|
3410
3490
|
// src/index.ts
|
|
3411
3491
|
var program = new Command();
|
|
3412
|
-
program.name("hiregraph").description("Turn your code into job applications. Local-first CLI that scans codebases and builds skill graphs.").version("0.1.
|
|
3492
|
+
program.name("hiregraph").description("Turn your code into job applications. Local-first CLI that scans codebases and builds skill graphs.").version("0.1.4");
|
|
3413
3493
|
program.command("init").description("Set up your builder profile (resume upload + preferences)").option("--name <name>", "Your full name").option("--email <email>", "Your email address").option("--role <role>", "Your role (engineer, pm, designer, founder, builder)").option("--targets <roles>", "Target roles, comma separated").option("--remote <pref>", "Remote preference (Remote, Hybrid, Onsite)").option("--resume <path>", "Path to resume PDF/TXT").option("--compensation <amount>", "Minimum compensation").action(initCommand);
|
|
3414
3494
|
program.command("scan").description("Scan a project and update your skill graph").argument("[path]", "Path to the project directory", ".").action(scanCommand);
|
|
3415
3495
|
program.command("status").description("Show your current skill graph summary").action(statusCommand);
|
|
@@ -3417,6 +3497,7 @@ program.command("jobs").description("Fetch job listings from Greenhouse, Lever,
|
|
|
3417
3497
|
program.command("matches").description("Match your skill graph against fetched jobs").option("--refresh", "Re-fetch jobs before matching").option("--top <n>", "Number of candidates for LLM evaluation (default 50)", parseInt).option("--verbose", "Show detailed reasoning for all matches").action(matchesCommand);
|
|
3418
3498
|
program.command("apply").description("Generate a tailored resume and submit to ATS").argument("[job-id]", "Job ID to apply to").option("--all-above <score>", "Apply to all matches above this score", parseFloat).option("--review", "Review each resume before submitting").option("--dry-run", "Generate resume PDF without submitting").action(applyCommand);
|
|
3419
3499
|
program.command("history").description("View and manage your application history").argument("[action]", 'Action: "update"').argument("[id]", "Application ID").option("--status <status>", "New status (applied, screening, interview, offer, rejected, withdrawn, no-response)").option("--notes <notes>", "Optional notes").action(historyCommand);
|
|
3500
|
+
program.command("setup").description("Set up your Anthropic API key (required for LLM features)").option("--key <key>", "Anthropic API key (starts with sk-ant-)").action(setupCommand);
|
|
3420
3501
|
program.command("install-skill").description("Install the HireGraph skill for Claude Code").action(installSkillCommand);
|
|
3421
3502
|
program.parse();
|
|
3422
3503
|
//# sourceMappingURL=index.js.map
|