Expand description
Harness and runtime profiles: declarative descriptions of agent harnesses (Claude Code, Codex, Pi, OpenCode, …) and local inference runtimes (Ollama, LM Studio, vLLM, …).
A profile says where a harness keeps its config, how to find its model, MCP
servers, skills and plugins, how it was installed, and how to relocate its
config root for an isolated session. Built-in profiles ship inside the crate
(profiles/); users add or override them with TOML files in a profile
directory (see profile_dirs), so new harnesses need no code change.
Structs§
- ApiKey
- An API provider a harness supports, and the environment variable holding its key.
- Bundle
Spec - Catalog
Model - A model
hlock localizemay pick for a runtime. - Config
Root - Where the harness keeps its user-level config, and the variable that moves it.
- Ctx
- The slice of the process environment that profiles read: home and working
directories, environment variables, and the
PATHsearch list. Tests build one by hand so nothing depends on the real machine. - File
Spec - Harness
Profile - A declarative description of one agent harness.
- Install
Method - Launch
Spec - Local
Provider - How
hlock localizepoints a harness at a local OpenAI-compatible endpoint: values to set (by JSON pointer) in one of the profile’s files. Strings and keys may use{provider},{model},{base_url}and{host}. - McpSpec
- Model
Spec - Probe
- What’s installed on this machine for one profile.
- Provider
Spec - Registry
- All known profiles: the built-ins, overridden or extended by user profile dirs.
- RunSpec
- How hlock runs a code harness (a framework agent or a custom script).
- Runtime
Models - Runtime
Profile - A declarative description of one local inference runtime.
- Selection
- The outcome of
Registry::select: which harness, and why it was chosen. - Skills
Spec - Version
Probe
Functions§
- detect_
install - Infer how a binary was installed from its real path.
- extract_
version - The first dotted version number in
text, e.g.2.1.4or2026.05.28-a70ca7c. ANSI escape sequences are skipped. - parse_
harness - parse_
runtime - probe_
harness - probe_
runtime - profile_
dirs - Profile directories, lowest precedence first:
~/.config/hlock/profiles, each entry ofHLOCK_PROFILE_PATH, then./.hlock/profiles. Each holdsharnesses/*.tomlandruntimes/*.toml; a later profile with the sameidreplaces an earlier one. - python_
for - The Python interpreter for code harnesses: an explicit one,
HL_PYTHON, thenpython3. - python_
package_ versions - Installed versions of
pypi:packages, read with one interpreter call. - run_
capture - Run a command with a timeout, returning stdout+stderr on success.
- source_
spec - Format a reproducible source spec for an install method.