Skip to main content

Module profiles

Module profiles 

Source
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.
BundleSpec
CatalogModel
A model hlock localize may pick for a runtime.
ConfigRoot
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 PATH search list. Tests build one by hand so nothing depends on the real machine.
FileSpec
HarnessProfile
A declarative description of one agent harness.
InstallMethod
LaunchSpec
LocalProvider
How hlock localize points 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
ModelSpec
Probe
What’s installed on this machine for one profile.
ProviderSpec
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).
RuntimeModels
RuntimeProfile
A declarative description of one local inference runtime.
Selection
The outcome of Registry::select: which harness, and why it was chosen.
SkillsSpec
VersionProbe

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.4 or 2026.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 of HLOCK_PROFILE_PATH, then ./.hlock/profiles. Each holds harnesses/*.toml and runtimes/*.toml; a later profile with the same id replaces an earlier one.
python_for
The Python interpreter for code harnesses: an explicit one, HL_PYTHON, then python3.
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.