Skip to main content
Commands for managing containerized lab services.

detect_container_runtime

Detects installed container runtime (Docker or Podman).
runtime
RuntimeInfo
required

RuntimeInfo

binary
'docker' | 'podman'
required
Detected runtime
version
string
required
Version string from --version
const runtime = await invoke<RuntimeInfo>('detect_container_runtime');
console.log(`Using ${runtime.binary} ${runtime.version}`);

check_container_runtime

Pre-flight check for container runtime availability. Always performs a fresh probe.
result
RuntimeCheck
required
Discriminated union:
  • { kind: 'ready', binary: string, version: string }
  • { kind: 'missing' }
const check = await invoke<RuntimeCheck>('check_container_runtime');
if (check.kind === 'missing') {
  // Show installation instructions
}

compose_up

Starts services defined in a Docker Compose file, streaming health status.
compose_path
string
required
Absolute path to docker-compose.yaml
on_event
Channel<ServiceEvent>
required
Event channel for service status updates
result
void
required
Emits events via channel until all services are healthy or timeout occurs

ServiceEvent

Discriminated union:
import { Channel } from '@tauri-apps/api/core';

const channel = new Channel<ServiceEvent>();
channel.onmessage = (event) => {
  if (event.event === 'serviceHealthy') {
    console.log(`${event.name} is ready`);
  } else if (event.event === 'allHealthy') {
    console.log('All services ready');
  }
};

await invoke('compose_up', {
  composePath: '/path/to/docker-compose.yaml',
  onEvent: channel
});

compose_down

Stops and removes services from a Compose file.
compose_path
string
required
Absolute path to docker-compose.yaml
remove_volumes
boolean
required
If true, removes named volumes (equivalent to docker compose down -v)
await invoke('compose_down', {
  composePath: '/path/to/docker-compose.yaml',
  removeVolumes: true
});

container_list

Lists containers for a Compose project.
compose_path
string
required
containers
ContainerInfo[]
required

ContainerInfo

id
string
required
Container ID
name
string
required
Container name
image
string
required
Image name
status
string
required
Status string (e.g., 'Up 5 minutes')
health
string
required
Health status: 'healthy' | 'unhealthy' | 'starting' | ''
ports
string
required
Port mappings (e.g., '0.0.0.0:5432->5432/tcp')

container_logs

Streams logs from a container.
container_name
string
required
Container name (not ID)
on_log
Channel<LogEvent>
required
Event channel for log lines

LogEvent

Discriminated union:
const channel = new Channel<LogEvent>();
channel.onmessage = (event) => {
  if (event.event === 'line') {
    console.log(event.data);
  }
};

await invoke('container_logs', {
  containerName: 'postgres-1',
  onLog: channel
});

container_action

Performs an action on a container.
container_name
string
required
action
ContainerAction
required
One of: 'start' | 'stop' | 'restart'
await invoke('container_action', {
  containerName: 'postgres-1',
  action: 'restart'
});

Build docs developers (and LLMs) love