hiregraph 0.1.2 → 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/README.md CHANGED
@@ -12,7 +12,28 @@ Open Source | Local-First | Bring Your Own Key
12
12
  npm install -g hiregraph
13
13
  ```
14
14
 
15
- That's it. No account. No sign up. HireGraph reads `ANTHROPIC_API_KEY` from your environment — the same key Claude Code or Cursor already uses.
15
+ ### For Claude Code users (recommended)
16
+
17
+ ```bash
18
+ npm install -g hiregraph
19
+ hiregraph install-skill
20
+ ```
21
+
22
+ Then open Claude Code and say: *"Set up hiregraph and scan my projects"*. Claude Code handles everything — no manual commands needed.
23
+
24
+ ### Or install the skill directly
25
+
26
+ ```bash
27
+ npx skills add https://github.com/c0ncepT23/hiregraph --skill hiregraph --yes --global
28
+ ```
29
+
30
+ ### API Key
31
+
32
+ HireGraph reads `ANTHROPIC_API_KEY` from your environment. Set it once:
33
+
34
+ - **Mac/Linux:** `export ANTHROPIC_API_KEY="sk-ant-..."` (add to `~/.bashrc` or `~/.zshrc`)
35
+ - **Windows:** Add `ANTHROPIC_API_KEY` to System Environment Variables
36
+ - **Claude Code:** Already set automatically
16
37
 
17
38
  ## Quick Start
18
39
 
package/dist/index.js CHANGED
@@ -3294,9 +3294,202 @@ function getTimeAgo2(isoDate) {
3294
3294
  return `${days}d ago`;
3295
3295
  }
3296
3296
 
3297
+ // src/commands/install-skill.ts
3298
+ import { homedir as homedir2 } from "os";
3299
+ import { join as join11 } from "path";
3300
+ import { mkdir as mkdir2, writeFile as writeFile3 } from "fs/promises";
3301
+ import { existsSync as existsSync10 } from "fs";
3302
+ import { dirname as dirname2 } from "path";
3303
+ import { fileURLToPath as fileURLToPath2 } from "url";
3304
+ var __dirname2 = dirname2(fileURLToPath2(import.meta.url));
3305
+ var SKILL_DIR = join11(homedir2(), ".claude", "skills", "hiregraph");
3306
+ var SKILL_CONTENT = `---
3307
+ name: hiregraph
3308
+ description: "Use when the user wants to scan projects for skills, find jobs, match against job listings, generate resumes, apply to jobs, or track applications. Triggered by: job search, resume, skill graph, apply to jobs, find matches, hiregraph, scan project skills."
3309
+ ---
3310
+
3311
+ # HireGraph \u2014 CLI Job Application Tool
3312
+
3313
+ HireGraph is a globally installed CLI tool. You MUST use the \`hiregraph\` CLI commands to interact with it.
3314
+
3315
+ ## CRITICAL RULES
3316
+
3317
+ 1. **ONLY use \`hiregraph\` CLI commands.** NEVER manually read, write, or edit files in \`~/.hiregraph/\`. The CLI manages all data.
3318
+ 2. **NEVER use interactive mode.** Always pass \`--name\`, \`--email\`, \`--role\` flags to \`hiregraph init\`. Interactive prompts (inquirer) do not work in the Bash tool.
3319
+ 3. **Ask the user** for their name, email, and role BEFORE running \`hiregraph init\`. Do not guess or make up values.
3320
+ 4. **Check installation first.** If \`hiregraph\` is not found, run \`npm install -g hiregraph\`.
3321
+
3322
+ ## Commands
3323
+
3324
+ ### 1. Initialize profile (MUST use flags)
3325
+ \`\`\`bash
3326
+ hiregraph init --name "Full Name" --email "user@email.com" --role builder --targets "Founding Engineer, Full-Stack" --remote Remote
3327
+ \`\`\`
3328
+
3329
+ With resume:
3330
+ \`\`\`bash
3331
+ hiregraph init --name "Full Name" --email "user@email.com" --role engineer --resume /path/to/resume.pdf
3332
+ \`\`\`
3333
+
3334
+ Valid roles: \`engineer\`, \`pm\`, \`designer\`, \`founder\`, \`builder\`
3335
+
3336
+ ### 2. Scan projects
3337
+ \`\`\`bash
3338
+ hiregraph scan /absolute/path/to/project
3339
+ hiregraph scan .
3340
+ \`\`\`
3341
+
3342
+ ### 3. View skill graph
3343
+ \`\`\`bash
3344
+ hiregraph status
3345
+ \`\`\`
3346
+
3347
+ ### 4. Fetch jobs
3348
+ \`\`\`bash
3349
+ hiregraph jobs
3350
+ hiregraph jobs --refresh
3351
+ hiregraph jobs --limit 10
3352
+ \`\`\`
3353
+
3354
+ ### 5. Match against jobs
3355
+ \`\`\`bash
3356
+ hiregraph matches
3357
+ hiregraph matches --verbose
3358
+ \`\`\`
3359
+
3360
+ ### 6. Apply to jobs
3361
+ \`\`\`bash
3362
+ hiregraph apply <job-id> --dry-run # safe: generates PDF only
3363
+ hiregraph apply <job-id> # submits to ATS
3364
+ hiregraph apply --all-above 8 # batch apply
3365
+ \`\`\`
3366
+
3367
+ ### 7. Track applications
3368
+ \`\`\`bash
3369
+ hiregraph history
3370
+ hiregraph history update <app-id> --status interview
3371
+ \`\`\`
3372
+
3373
+ ## Workflow
3374
+
3375
+ When the user wants to use hiregraph, follow this exact sequence:
3376
+
3377
+ 1. Check if installed: \`which hiregraph || npm list -g hiregraph\`
3378
+ 2. If not installed: \`npm install -g hiregraph\`
3379
+ 3. Ask user for: name, email, role (engineer/pm/designer/founder/builder)
3380
+ 4. Run: \`hiregraph init --name "..." --email "..." --role ...\`
3381
+ 5. Ask which projects to scan, then run: \`hiregraph scan <path>\` for each
3382
+ 6. Show results: \`hiregraph status\`
3383
+ 7. If user wants jobs: \`hiregraph jobs\` then \`hiregraph matches\`
3384
+ 8. If user wants to apply: \`hiregraph apply <job-id> --dry-run\` first, then without --dry-run
3385
+
3386
+ ## Remember
3387
+
3388
+ - NEVER write to ~/.hiregraph/ directly. Always use CLI commands.
3389
+ - NEVER run \`hiregraph init\` without --name and --email flags.
3390
+ - NEVER skip asking the user for their details before init.
3391
+ - All hiregraph commands are non-interactive and safe to run via the Bash tool.
3392
+ - Cost: ~$0.003 per scan, ~$0.15 per match run, ~$1.50 first-time job parsing.
3393
+ `;
3394
+ async function installSkillCommand() {
3395
+ header("\n HireGraph \u2014 Install Claude Code Skill\n");
3396
+ if (!existsSync10(join11(homedir2(), ".claude"))) {
3397
+ warn(" Claude Code not detected (~/.claude/ not found).");
3398
+ info(" Install Claude Code first: https://claude.ai/code");
3399
+ return;
3400
+ }
3401
+ await mkdir2(SKILL_DIR, { recursive: true });
3402
+ await writeFile3(join11(SKILL_DIR, "SKILL.md"), SKILL_CONTENT, "utf-8");
3403
+ success(" Skill installed to ~/.claude/skills/hiregraph/SKILL.md");
3404
+ console.log();
3405
+ info(" Now open Claude Code and say:");
3406
+ info(' "Set up hiregraph and scan my projects for job matching"');
3407
+ console.log();
3408
+ }
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
+
3297
3490
  // src/index.ts
3298
3491
  var program = new Command();
3299
- program.name("hiregraph").description("Turn your code into job applications. Local-first CLI that scans codebases and builds skill graphs.").version("0.1.2");
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");
3300
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);
3301
3494
  program.command("scan").description("Scan a project and update your skill graph").argument("[path]", "Path to the project directory", ".").action(scanCommand);
3302
3495
  program.command("status").description("Show your current skill graph summary").action(statusCommand);
@@ -3304,5 +3497,7 @@ program.command("jobs").description("Fetch job listings from Greenhouse, Lever,
3304
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);
3305
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);
3306
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);
3501
+ program.command("install-skill").description("Install the HireGraph skill for Claude Code").action(installSkillCommand);
3307
3502
  program.parse();
3308
3503
  //# sourceMappingURL=index.js.map