Skip to main content

Command line

Installing the SDK adds a hajer command. python -m hajer is the same program, which is useful when the console script is not on your PATH.

hajer doctor [--json] # check the SDK's configuration and connectivity
hajer attach-path # print the directory to put on PYTHONPATH for attach mode
hajer eval ... # run eval suites (see the Evals docs)

No command accepts a credential as an argument. They read HAJER_* variables from the environment, the same way the SDK does.

hajer doctor​

Run doctor first when traces are not arriving. It reports what the SDK in this environment is configured to do, and whether it can:

hajer doctor
hajer 0.2.0
otel opentelemetry-sdk 1.45.0
traces https://api.hajer.ai/api/teams/<team-id>/otel/v1/traces (auth: bearer)
redaction redaction-rules@6
base url https://api.hajer.ai/api/health -> 200 (keyless GET)
inert no
eval engine {...}

setting variable source value
api_key HAJER_API_KEY env set
team_id HAJER_TEAM_ID env <team-id>
base_url HAJER_BASE_URL default https://api.hajer.ai
environment HAJER_ENVIRONMENT env production
...
LineMeaning
hajerThe installed SDK version.
otelThe installed OpenTelemetry SDK version, or missing: pip install 'hajer[otel]' to export spans.
tracesWhere spans would be exported, and whether the key is sent (auth: bearer) or not (auth: none). If nowhere, the reason, for example nowhere: HAJER_API_KEY and HAJER_TEAM_ID absent: no span leaves this process.
redactionThe bundled redaction catalog. See Content capture and redaction.
base urlThe result of one unauthenticated GET of {HAJER_BASE_URL}/api/health: an HTTP status, or no answer. Any status, including 401, means something is listening.
inertyes when nothing will be sent to Hajer, followed by the reason.
eval engineThe state of the hajer eval engine. See Evals CLI.

The table lists every HAJER_* setting with its variable, its source (env or default) and the value in force. The API key is never printed: its value is set or absent. An invalid HAJER_ENVIRONMENT shows as ignored: invalid.

doctor sends no spans. Its only network request is the health check, which waits up to HAJER_TRACE_EXPORT_TIMEOUT_MS.

note

If a HAJER_* variable has an invalid value, doctor exits with a HajerConfigError naming the variable. See Configuration.

JSON output​

hajer doctor --json

prints the same facts as one JSON document, for scripts and support requests:

{
"version": "0.2.0",
"otel": "opentelemetry-sdk 1.45.0",
"traces": "nowhere: HAJER_API_KEY and HAJER_TEAM_ID absent: no span leaves this process",
"redactionCatalog": "redaction-rules@6",
"baseUrl": "https://api.hajer.ai",
"baseUrlPath": "/api/health",
"baseUrlAnswers": true,
"baseUrlStatus": 200,
"inert": true,
"inertBecause": "HAJER_API_KEY and HAJER_TEAM_ID absent: no span leaves this process",
"settings": [
{"name": "api_key", "variable": "HAJER_API_KEY", "source": "default", "value": "absent"}
],
"evals": {}
}

The settings array has one entry per setting; it is shortened here. evals describes the eval engine.

hajer attach-path​

Prints the directory containing the SDK's sitecustomize.py, on one line. Put it on PYTHONPATH with HAJER_ATTACH=1 to attach a process without changing its code:

PYTHONPATH="$(python -m hajer attach-path)" HAJER_ATTACH=1 python -m your_app

Python imports only the first sitecustomize module it finds. If your environment already has one, this directory shadows it when it comes first on PYTHONPATH. In that case, don't use attach-path; add import hajer.autoattach to your own sitecustomize or entry point instead. See Attach mode.

hajer eval​

Runs your repository's promptfoo suites on a pinned engine and can upload the results to Hajer. See Evals CLI.