Current Behavior
Socket paths can only be overridden via environment variables:
TOOLHIVE_DOCKER_SOCKET
TOOLHIVE_PODMAN_SOCKET
TOOLHIVE_COLIMA_SOCKET
These are checked in pkg/container/docker/sdk/client_unix.go before falling back to auto-detection of standard socket locations. There is no way to persist this configuration in the ToolHive config file (~/.config/toolhive/config.yaml), meaning users with non-standard socket paths must set environment variables in every shell session or wrapper script.
Proposed Change
Add socket path fields to the Config struct in pkg/config/config.go, allowing users to configure them once via thv config or by editing the YAML file directly:
container_runtime:
docker_socket: /run/user/1000/docker.sock
podman_socket: /run/user/1000/podman/podman.sock
colima_socket: /home/user/.colima/custom/docker.sock
Socket resolution in findPlatformContainerSocket would check sources in this order, preserving existing precedence:
- Environment variable (existing)
- Config file (new)
- Auto-detection of standard paths (existing)
Motivation
Configuring environment variables across GUI and CLI apps can be a bad experience, because there are various ways env variables can be set up, and not all of them are accessible by both GUI and CLI processes - it can actually even depend on how the process is launched.
Misconfiguration is hard to spot, but can lead to confusing, unexpected experiences. This is not user friendly, because users should not need to have a deep understanding of how their operating system handles environment variables across different ways of launching apps just to be able to use ToolHive.
See [this Discord thread for a concrete user report that illustrates the problem.
Current Behavior
Socket paths can only be overridden via environment variables:
TOOLHIVE_DOCKER_SOCKETTOOLHIVE_PODMAN_SOCKETTOOLHIVE_COLIMA_SOCKETThese are checked in
pkg/container/docker/sdk/client_unix.gobefore falling back to auto-detection of standard socket locations. There is no way to persist this configuration in the ToolHive config file (~/.config/toolhive/config.yaml), meaning users with non-standard socket paths must set environment variables in every shell session or wrapper script.Proposed Change
Add socket path fields to the
Configstruct inpkg/config/config.go, allowing users to configure them once viathv configor by editing the YAML file directly:Socket resolution in
findPlatformContainerSocketwould check sources in this order, preserving existing precedence:Motivation
Configuring environment variables across GUI and CLI apps can be a bad experience, because there are various ways env variables can be set up, and not all of them are accessible by both GUI and CLI processes - it can actually even depend on how the process is launched.
Misconfiguration is hard to spot, but can lead to confusing, unexpected experiences. This is not user friendly, because users should not need to have a deep understanding of how their operating system handles environment variables across different ways of launching apps just to be able to use ToolHive.
See [this Discord thread for a concrete user report that illustrates the problem.