Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Pratyay360/podman-ts/llms.txt
Use this file to discover all available pages before exploring further.
PodmanClient is the top-level class exported from podman-ts. Every operation — listing containers, pulling images, creating networks — starts by instantiating this class. It owns all resource managers and handles connection resolution automatically.
Creating a client
With no arguments,PodmanClient connects to the local Podman socket using the default resolution order.
Client options
Full URL to the Podman service. Supports
http+unix://, http://, and tcp://. When provided, it takes precedence over connection and the active service. SSH (ssh://) is not directly supported — use an SSH tunnel and connect via tcp:// or http+unix:// instead.Named connection from
containers.conf or podman-connections.json. The SDK reads these files via PodmanConfig at construction time and resolves the URL from the matching service entry. Ignored when baseUrl is set.API version string used as a path prefix for all requests (e.g.
/v5.0.0/libpod/...). Override this if you are connecting to an older Podman service.Request timeout in milliseconds. When set, an
AbortSignal.timeout() is attached to every fetch call. Requests that exceed the timeout throw a network-level error.Path to an SSH identity file. Relevant only when you have set up an SSH tunnel — the library itself does not initiate SSH connections.
Default connection resolution
WhenbaseUrl is not provided, the constructor resolves the connection in this order:
Named connection
If
connection is set, PodmanConfig looks up the service in podman-connections.json (or the legacy containers.conf TOML). A missing connection name throws immediately.Active Podman machine
If no
connection is given, PodmanConfig checks whether the active service is a Podman machine (IsMachine: true). If it is, the machine’s URL is used.new PodmanClient() does not read CONTAINER_HOST or DOCKER_HOST. To pick up those environment variables, use PodmanClient.fromEnv() or the fromEnv() shorthand instead.Resource managers
All resource managers are lazily instantiated on first access and share the same underlyingAPIClient.
| Property | Manager | Description |
|---|---|---|
client.containers | ContainersManager | Create, list, inspect, run, and remove containers. See Containers. |
client.images | ImagesManager | Pull, push, build, search, and manage images. See Images. |
client.pods | PodsManager | Create and manage pods (groups of containers). See Pods. |
client.networks | NetworksManager | Create and manage container networks. See Networks. |
client.volumes | VolumesManager | Create and manage persistent volumes. See Volumes. |
client.secrets | SecretsManager | Store and retrieve secrets. See Secrets. |
client.manifests | ManifestsManager | Create and push multi-architecture manifest lists. See Manifests. |
client.quadlets | QuadletsManager | Install and manage systemd Quadlet unit files. See Quadlets. |
client.events | EventsManager | Stream real-time events from the Podman service. See Events. |
client.system | SystemManager | Ping, info, version, disk usage, and registry login. See System. |
client.kube | KubeManager | Generate and apply Kubernetes YAML. See Kube. |
client.artifacts | ArtifactsManager | Manage OCI artifacts. See Artifacts. |
Convenience properties
These top-level getters delegate to the correspondingSystemManager methods and return promises directly:
Low-level access
client.api exposes the underlying APIClient for arbitrary libpod or Docker-compatible requests. Use this for endpoints not yet covered by the high-level managers.
APIClient exposes get, post, put, patch, delete, head, and options methods, all returning an APIResponse<T>. Call .raiseForStatus() on the response to convert HTTP error codes into typed exceptions.
DockerClient alias
DockerClient is an exported alias for PodmanClient. It exists for projects migrating from Docker SDK patterns where the client class is named DockerClient.
fromEnv factory
UsePodmanClient.fromEnv() (or the shorthand fromEnv()) when the service URL should come from an environment variable. It checks CONTAINER_HOST first, then DOCKER_HOST, and falls back to the default socket path if neither is set.
Disposal
Callclient.close() when you are done with the client. It is currently a no-op (Bun’s fetch has no persistent connection pool to drain), but the method is available now so code that calls it remains forward-compatible.
PodmanClient also implements Symbol.dispose, which means it works with the using keyword from the Explicit Resource Management proposal: