2026-05-11 00:45:43 -07:00
---
title: "ktx connection"
2026-05-13 15:04:50 +02:00
description: "List and test configured data sources."
2026-05-11 00:45:43 -07:00
---
2026-05-13 15:04:50 +02:00
Inspect configured connections in your KTX project. Connections define how KTX
reaches your data warehouse, BI tools, and context sources. Use `ktx setup` to
add, remove, or reconfigure connections.
2026-05-11 00:45:43 -07:00
2026-05-11 16:43:08 -07:00
## Command signature
2026-05-11 00:45:43 -07:00
```bash
ktx connection <subcommand> [options]
```
## Subcommands
| Subcommand | Description |
|-----------|-------------|
| `list` | List configured connections |
| `test <connectionId>` | Test a configured connection |
## Options
2026-05-13 15:04:50 +02:00
The `connection` command has command-level options for listing and testing
existing connections.
2026-05-11 00:45:43 -07:00
2026-05-13 15:04:50 +02:00
### `connection list`
2026-05-11 00:45:43 -07:00
| Flag | Description | Default |
|------|-------------|---------|
| `--json` | Print JSON output | `false` |
2026-05-13 15:04:50 +02:00
### `connection test`
2026-05-11 00:45:43 -07:00
| Flag | Description | Default |
|------|-------------|---------|
2026-05-13 15:04:50 +02:00
| `--json` | Print JSON output | `false` |
2026-05-11 00:45:43 -07:00
## Examples
```bash
# List all configured connections
ktx connection list
# Test a connection
ktx connection test my-warehouse
2026-05-13 15:04:50 +02:00
```
2026-05-11 00:45:43 -07:00
2026-05-13 15:04:50 +02:00
## Setup-managed connections
2026-05-11 00:45:43 -07:00
2026-05-13 15:04:50 +02:00
Run `ktx setup` when you need to add or reconfigure a connection. Interactive
setup includes the rich Notion page picker for selected root pages and the
Metabase mapping prompts for BI-to-warehouse mappings.
2026-05-11 16:43:08 -07:00
## Output
2026-05-13 15:04:50 +02:00
Commands with `--json` return machine-readable JSON suitable for scripts and
agents.
2026-05-11 16:43:08 -07:00
```json
{
"connections": [
{
"id": "my-warehouse",
2026-05-13 19:37:25 +02:00
"driver": "postgres"
2026-05-11 16:43:08 -07:00
}
]
}
```
## Common errors
| Error | Cause | Recovery |
|-------|-------|----------|
2026-05-13 15:04:50 +02:00
| Connection test fails | Credentials, network access, database, warehouse, or schema is invalid | Verify the same URL with the database's native client, then rerun `ktx setup` and reconfigure the connection |
| Mapping validation fails during setup | BI database mappings do not point at valid warehouse connections | Rerun `ktx setup` and update the source mapping selections |
| Notion page picker cannot run | The terminal is non-interactive or Notion discovery failed | Rerun interactive `ktx setup`, or use non-interactive setup flags with explicit root page ids |