Services

Kibaco can start and stop services defined in the workspace config. A service can be a Docker container, a Compose-backed service, or a command-backed external service such as Supabase local development.

kibaco init can infer services from common Compose files:

  • compose.yaml
  • compose.yml
  • docker-compose.yaml
  • docker-compose.yml
  • docker.yaml
  • docker.yml

It reads service images, ports, environment, volumes, and depends_on. For common services such as PostgreSQL, MySQL, Redis, Meilisearch, Mailpit, and MailHog, Kibaco can also infer a simple health check when the Compose file does not define one.

Services inferred from a Compose file are started and stopped through Docker Compose. This lets Compose resolve .env, env_file, variable substitution, networks, volumes, and other service details. Kibaco still starts application commands itself and routes them through its local proxy.

kibaco init can also infer a Supabase command service when it finds supabase/config.toml and package scripts named supabase:start, supabase:stop, and supabase:status.

If the workspace already exists, import Compose services without editing .kibaco/config.json directly:

kibaco config import-compose docker-compose.yml --attach web

For one-off service edits, update the service and then attach or detach it from projects:

kibaco config set-service redis --image redis:7 --port 6379:6379
kibaco config set-service postgres --env POSTGRES_DB=app --env POSTGRES_PASSWORD=postgres
kibaco config attach-service web redis postgres
kibaco config detach-service web redis
kibaco services up
kibaco services restart postgres
kibaco services status
kibaco logs postgres
kibaco services logs postgres --tail 200 --follow
kibaco services down

When a project lists services, kibaco dev starts those services before running the project command.

Command Services

Use type: "command" for services that are not a single Docker container from Kibaco's point of view:

{
  "name": "supabase",
  "type": "command",
  "start": "pnpm supabase:start",
  "stop": "pnpm supabase:stop",
  "status": "pnpm supabase:status",
  "logs": "pnpm supabase:logs",
  "mode": "oneshot",
  "stopOnExit": false,
  "healthCheck": {
    "type": "tcp",
    "host": "127.0.0.1",
    "port": 54321
  },
  "urls": [
    { "name": "api", "url": "http://127.0.0.1:54321" },
    { "name": "db", "url": "tcp://127.0.0.1:54322" },
    { "name": "studio", "url": "http://127.0.0.1:54323" }
  ]
}

For mode: "oneshot", Kibaco runs status first when available, runs start only when the service is not already running, then waits for the health check before starting dependent projects. When stopOnExit is false, the service is left running after kibaco dev exits. Set it to true when the service should be stopped with the dev session.

Health Checks

A service can define a health check:

{
  "healthCheck": {
    "type": "tcp",
    "host": "127.0.0.1",
    "port": 5432
  }
}

Kibaco waits for the health check before starting dependent project commands.