hired.cli#
Command-line operations for the candidate-knowledge + JD-alignment workflow.
Each function here is a plain, importable operation — no CLI library is imported —
and CLI_FUNCS is the single source of truth for what the hired command
exposes (see hired.__main__, which projects it onto a parser with cw).
Every operation takes a keyword-only user (--user on the command line),
resolved by hired.persistence.resolve_user(): the given name, else
$HIRED_USER, else "me". So a single-candidate setup needs no flag at all,
and several candidates coexist under users/<user>/.
The intelligence stays outside: ingest takes fact records an extractor (the
hired-profile-ingest subagent, or an LLM) already produced, and analyze
takes an analyst-drafted report; the commands validate, derive what is
deterministic, and persist. align is the one exception: it runs the
injected-LLM analyzer (hired.alignment.analyzer) on raw JD text.
>>> import os, json, tempfile
>>> os.environ['HIRED_DATA_DIR'] = tempfile.mkdtemp()
>>> work = tempfile.mkdtemp()
>>> cv = os.path.join(work, 'cv.md')
>>> _ = open(cv, 'w').write('I built ML pipelines in Python.')
>>> recs = os.path.join(work, 'facts.json')
>>> _ = open(recs, 'w').write(json.dumps([{'statement': 'Builds ML pipelines',
... 'category': 'skill', 'quote': 'built ML pipelines'}]))
>>> ingest(recs, source=cv, user='alice')['added']
1
>>> users()
['alice']
>>> facts(user='alice')
['Builds ML pipelines']
Module Attributes
The operations the |
Functions
|
Store a raw source document (CV, bio, publication list...) for a candidate. |
|
Analyse a raw job description (the file |
|
Finalize an analyst-drafted alignment report (JSON) and save it under engagement |
|
Download ESCO (+ O*NET) and build the skill-adjacency taxonomy (tens of minutes). |
|
List a candidate's current (asserted) fact statements. |
|
Add extracted fact records (a JSON list) to a candidate's knowledge base. |
|
List a candidate's engagements (one per company; 1+ roles each). |
|
Render a saved alignment report ( |
|
List the job ids that have an alignment report in engagement |
|
Rank the candidate's skills (comma-separated) by adjacency to |
|
Taxonomy skills matching |
|
Summarize a candidate's knowledge base: counts, pending material, engagements. |
|
Print a candidate's synopsis ( |
|
List the candidates that have data (one |
- hired.cli.CLI_FUNCS = [<function users>, <function status>, <function add_source>, <function ingest>, <function facts>, <function synopsis>, <function jds>, <function analyze>, <function align>, <function reports>, <function report>, <function build_skill_index>, <function skill_lookup>, <function skill_adjacency>]#
The operations the
hiredcommand exposes (SSOT for every surface).
- hired.cli.add_source(path, *, name=None, user=None)[source]#
Store a raw source document (CV, bio, publication list…) for a candidate.
Prints the source key. Its facts are added later with
ingest.- Return type:
- hired.cli.align(jd, *, jd_text, job_id=None, job_title='', company=None, model=None, n_samples=1, nli=False, user=None)[source]#
Analyse a raw job description (the file
jd_text) with an LLM and save the report.The autonomous counterpart of
analyze: an LLM (theaiextra, anOPENAI_API_KEY) decomposes the JD and judges each requirement against the candidate’s facts, every judgment must quote a fact verbatim, and the verdict is computed deterministically. The JD text is stored as the job under engagementjd.job_iddefaults to the file’s name without extension;--n-samples> 1 samples each judgment for calibrated confidence;--nliadds an entailment check on every match.- Return type:
- hired.cli.analyze(report, jd, *, job_id=None, company=None, user=None)[source]#
Finalize an analyst-drafted alignment report (JSON) and save it under engagement
jd.Every requirement is re-classified with the deterministic rubric, bucket counts, blocking gaps and the ranked clarifying questions are rebuilt, and the report is saved (the previous version of the same job’s report is archived). Prints the saved job id and the resulting verdict line.
- Return type:
- hired.cli.build_skill_index(*, embeddings=False, no_onet=False, refresh=False)[source]#
Download ESCO (+ O*NET) and build the skill-adjacency taxonomy (tens of minutes).
--embeddingsalso embeds every label (needshired[embeddings]);--refreshre-downloads instead of reusing cached pages. The data and its CC BY 4.0 attribution (NOTICE.md) go under<data root>/taxonomy/.
- hired.cli.facts(*, category=None, tag=None, user=None)[source]#
List a candidate’s current (asserted) fact statements.
- hired.cli.ingest(records, *, source=None, user=None)[source]#
Add extracted fact records (a JSON list) to a candidate’s knowledge base.
recordsis a JSON file holding a list of{"statement", "category", "tags", "confidence", "quote", "locator", "is_negation"}dicts. With--source(a raw-source key, or a file path, which is stored first) the facts cite that source, their quotes are checked against its text, and a re-ingest of the same source supersedes the facts of the previous one. Without it, the facts are recorded as externally sourced.
- hired.cli.jds(*, user=None)[source]#
List a candidate’s engagements (one per company; 1+ roles each).
- hired.cli.report(jd, job_id=None, *, fmt='markdown', output=None, user=None)[source]#
Render a saved alignment report (
--fmt markdown|html).job_idmay be omitted when the engagement has a single report. With--outputthe rendering is written to that file (and its path printed); otherwise it is printed.- Return type:
- hired.cli.reports(jd, *, user=None)[source]#
List the job ids that have an alignment report in engagement
jd.
- hired.cli.skill_adjacency(requirement, candidate_skills, *, k=3, alpha=0.5)[source]#
Rank the candidate’s skills (comma-separated) by adjacency to
requirement.Each line: blended score, suggested transferability band, and the evidence (shared taxonomy neighbour, relatedness, label similarity).
- hired.cli.skill_lookup(text, *, k=5)[source]#
Taxonomy skills matching
text(score, how matched, label, source, id).
- hired.cli.status(*, user=None)[source]#
Summarize a candidate’s knowledge base: counts, pending material, engagements.