Skip to content
Agent Orchestration
Command

/trex.db.setup

Start a fresh PostgreSQL container and run all migrations. If a database already exists, this will tear it down first.

BOOST
From plugin
platform
13111 skills6 agents11 commands3 MCP
Install
$ npx -y skills add ambient-code/platform --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/trex.db.setup

Context preview

What this command does when you run it.

Start a fresh PostgreSQL container and run all migrations. If a database already exists, this will tear it down first.

Command definition

trex.db.setup.md

Set Up Database

Start a fresh PostgreSQL container and run all migrations. If a database already exists, this will tear it down first.

Instructions

1. Check if a PostgreSQL container is already running:

   docker ps -a --filter name=ambient-api-server-postgres --format "{{.Names}} {{.Status}}"

2. If a container exists, tear it down first:

   make db/teardown

3. Start a fresh PostgreSQL container:

   make db/setup

4. Wait for PostgreSQL to be ready:

   sleep 2

5. Build the binary if not already built:

   make binary

6. Run migrations:

   ./ambient-api-server migrate

When to Use This

  • First-time database setup
  • After generating a new Kind (new migration added)
  • After pulling changes that include new migrations
  • When integration tests fail with "relation does not exist" or column errors
  • When the database schema is corrupted or out of sync

Database Connection Details

Connection details are stored in the `secrets/` directory files (`db.host`, `db.port`, `db.name`, `db.user`, `db.password`).

Ships withplatform

Kubernetes-native AI automation platform for intelligent agentic sessions

Get the whole plugin

Other commands on platform.