Elixir/OTP core for H (hiness on Hex, :harness OTP application).
H runs coding-agent sessions in a supervised local daemon with branched
conversations, file-backed WAL commits, and synchronized terminal (hi) and
browser (hiweb) clients.
Start or embed the daemon
- Call
H.serve/1to start a standalone daemon instance with loopback HTTP, a private Unix domain socket (api.sock), and owner-token authentication. - Configure
config :harness, data_dir: "/path/to/store"to start the supervised daemon instance inside an existing OTP application (seeH.Application) and callH.Daemondirectly in the same BEAM VM. - Implement
H.Extension,H.Harness,H.Tool,H.ExecutionEnv,H.Storage, orH.Providerto extend H at startup.
Operator manual and installation
This HexDocs package documents the Elixir module API, typespecs, and behaviour contracts. Read the operator manual, walkthroughs, and signed binary release guides on hiness.dev:
Summary
Functions
Computes the local Unix domain socket path inside the private data directory. Use a shorter data directory or disable the socket if the path exceeds the OS limit.
@spec serve(keyword()) :: {:ok, %{ url: String.t(), urls: [String.t()], port: non_neg_integer(), api_socket: nil | String.t(), data_dir: String.t() }} | {:error, term()}
Starts the H daemon with TCP and <data_dir>/api.sock, publishes
<data_dir>/daemon.json, and prints the bound API URLs.
Options:
:data_dir- storage root directory (default"~/.local/share/h"):port- HTTP port (default4100):bind_addresses- IPv4 tuples (default from<data_dir>/network.json, or loopback):api_socket- bind local Unix domain socket (defaulttrue):idle_session_timeout_ms- unload quiet local file-backed sessions (default300_000;:infinitydisables):provider-H.Providermodule (defaultH.Provider.ReqLLM):provider_config- map forwarded to provider (default%{}):auto_compaction- scoped input token thresholds (see Local HTTP and SSE protocol):environments- optional map/list ofH.EnvRegistryspecs:harnesses- optional trustedH.Harnessregistrations:no_extensions- bypass<data_dir>/extensions.jsonand all path packages