CandidLens

Docs · Get started

CLI reference

candidlens is a zero-runtime-dependency CLI published on npm — run it with npx on Node ≥ 20. The full pipeline, from a terminal. Up to 1.4.x it was published as hirelens, which now forwards to it.

Setup

export CANDIDLENS_API_URL=http://localhost:4000     # the API
export CANDIDLENS_CONFIG_DIR=~/.candidlens            # optional; cookie storage

npx candidlens login you@example.com

login prompts for your password (or set CANDIDLENS_PASSWORD for scripts). Accounts are created in the web UI or via the sign-up API; the CLI signs existing accounts in. Sessions persist to ~/.candidlens/; a session saved in ~/.hirelens/ by the CLI's old name, hirelens, is still read.

In CI, skip login and set CANDIDLENS_COOKIE to a session cookie as a name=value pair (locally better-auth.session_token=…). It is the same cookie session the web app uses, and it wins over a saved login. The old name HIRELENS_COOKIE still works.

Commands

CommandWhat it does
candidlens login <email>Authenticate; stores the session cookie
candidlens whoamiPrint the signed-in email
candidlens logoutClear the session saved on this machine
candidlens org listList your organizations
candidlens org create "Acme Hiring"Create an organization (becomes the active tenant)
candidlens org use <orgId>Switch the active organization
candidlens jobs listList jobs in the active organization
candidlens jobs create "Senior Backend" --jd jd.mdCreate a job from a JD file (or stdin if omitted)
candidlens rubric list <jobId>List rubric versions
candidlens rubric derive <jobId>LLM-derives the rubric from the JD
candidlens rubric import <jobId> --file r.jsonImport a rubric JSON as a new version
candidlens score <jobId> ./resumesUpload + score + ranked table
candidlens versionPrint the version

score flags

candidlens score <jobId> ./resumes --breakdown   # per-criterion scores + evidence
candidlens score <jobId> ./resumes --json        # machine-readable output

score takes a folder or a list of files. From a folder it uploads the files directly inside it (not subfolders) that end in .pdf, .docx, .txt or .md, and skips hidden files. A file you name with any other type stops the command. Uploading the same resume text to a job twice doesn't add a second candidate; the line says duplicate.

It then scores every candidate on the job against the latest rubric version, prints a ranked table, and writes the run to the API (audit-chained, like any product run). Derive or import a rubric first; without one the API answers 409 no_rubric.

$ npx candidlens score <jobId> ./resumes
↑ alex-kim.md → created
↑ jane-doe.pdf → created
↑ sam-lee.docx → created
Scored 3/3 (failed: 0) — run 9b2f4c1e-5d7a-4e3b-8f60-2a1c7d9e4b18
RANK  CANDIDATE     OVERALL
────  ────────────  ───────
   1  jane-doe.pdf       82
   2  sam-lee.docx       74
   3  alex-kim.md        61

The upload and Scored lines go to stderr; the table goes to stdout. Candidates are named by their file name, and OVERALL is the weighted score out of 100. With --json, stdout holds only { "runId", "ranked": [{ "rank", "candidateId", "name", "overall" }] }.

Known gotcha: jobs create without --jd reads the description from stdin, which never closes in a scripted shell — always pass --jd <file> (or pipe input) outside interactive use.

Example end-to-end

npx candidlens org create "Acme Hiring"
npx candidlens jobs create "Senior Backend Engineer" --jd jd.md
npx candidlens rubric derive <jobId>
npx candidlens score <jobId> ./resumes --breakdown

LLM commands (rubric derive, score) require CANDIDLENS_LLM_* configuration on the API side — the CLI itself holds no keys.

Running from source

pnpm --filter candidlens dev <command>
pnpm --filter candidlens dev whoami

The dev script runs node src/main.ts, so Node runs the TypeScript source directly with no build step. That needs a Node version that strips types by default (22.18 or newer); the published package runs on Node 20 or newer. pnpm runs the script in apps/cli, so give file paths that are absolute or relative to that folder.