# Manage configuration

The `config` command manages workspace configuration objects — the same things
you create in the Jitsu UI. Under the hood it calls
`/api/{workspaceId}/config/{type}` (see [Management API](/docs/api)).

## Two equivalent invocation styles

Both forms produce identical results — pick whichever reads better:

```bash
jitsu-cli config <noun> <verb> [args]      # noun-first
jitsu-cli config <verb> <noun> [args]      # verb-first
```

```bash
jitsu-cli config destinations list -w my-ws
jitsu-cli config list destinations -w my-ws
```

## Resources

| Noun | Aliases | Kind |
|---|---|---|
| `workspaces` | `workspace` | Workspace |
| `destinations` | `destination`, `dest` | Config object |
| `streams` | `stream` | Config object |
| `functions` | `function`, `fn` | Config object |
| `services` | `service` | Config object — Airbyte connectors |
| `domains` | `domain` | Config object |
| `misc` | — | Config object — free-form |
| `notifications` | `notification` | Config object |
| `connections` | `connection`, `link`, `links` | Connection (link) |
| `profile-builders` | `profile-builder` | Profile builder |

## Verbs

| Verb | Applies to | Notes |
|---|---|---|
| `list` | All | |
| `get <id>` | Config objects, workspaces | Connections have no per-id GET; use `list` |
| `create` | All | Body via `-f`, `--json`, or `--field=value` |
| `update <id>` | All | Deep-merges into the existing object |
| `delete <id>` | All | Aliased as `rm`. Config objects accept `--cascade` and `--strict` |
| `test` | `destinations`, `streams`, `services` | Test connectivity for a config |

## Providing the body

`create`, `update`, and `test` need a body. There are three sources, merged in
this order: file → JSON → ad-hoc field flags.

**From a file** (YAML or JSON, `-` for stdin):

```bash
jitsu-cli config destinations create -f ./dest.yaml -w my-ws
cat dest.json | jitsu-cli config destinations create -f - -w my-ws
```

**Inline JSON:**

```bash
jitsu-cli config streams create --json '{"name":"website","domain":"example.com"}' -w my-ws
```

**Ad-hoc field flags** (any `--<dotted.path>=<value>`):

```bash
jitsu-cli config destinations create -w my-ws \
  --name=warehouse \
  --destinationType=postgres \
  --credentials.host=db.example.com \
  --credentials.port=5432 \
  --credentials.password=secret
```

Values that start with `[`, `{`, `"`, or look like a number / boolean / null
are parsed as JSON. Everything else is a plain string. Combine sources to
override file defaults from the command line:

```bash
jitsu-cli config destinations create -f ./template.yaml --credentials.host=prod-db
```

## Connection-specific options

`connections delete` lets you identify a link either by id or by endpoints:

```bash
jitsu-cli config connections delete <link-id> -w my-ws
jitsu-cli config connections delete --from <streamId> --to <destId> -w my-ws
```

`connections update` accepts an optional id — if omitted, the link is
identified by `fromId` + `toId` in the body (upsert semantics).

## Config object delete options

```bash
jitsu-cli config destinations delete <id> -w my-ws --cascade   # also delete linked connections
jitsu-cli config destinations delete <id> -w my-ws --strict    # refuse if linked connections exist
```

## Output formats

```bash
jitsu-cli config destinations list -w my-ws -o json   # default depends on command
jitsu-cli config destinations get <id> -w my-ws -o yaml
jitsu-cli config destinations list -w my-ws -o table
```

Pipe to `jq` for further filtering — the decorative banner is written to
stderr, so `... | jq '.[].name'` works without filtering.