# kindgi connection-choices

> Connection choices: which connection an agent or a flow, or one of its tools, uses at an app, the company's or your own (set / list / unset)

## `kindgi connection-choices`

**Synopsis**

```sh signature
kindgi connection-choices <command>
```

Connection choices: which connection an agent or a flow, or one of its tools, uses at an app, the company's or your own (set / list / unset).

**Commands**

| Command                                                                                                                                 | Description                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`kindgi connection-choices set`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices-set)     | Choose the connection an agent or a flow of the project uses at the connection's app, or with --tool the one a tool of it uses, in place of the one chosen before. |
| [`kindgi connection-choices list`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices-list)   | List the project's connection choices: the company's and your own, and every person's for a tenant admin.                                                          |
| [`kindgi connection-choices unset`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices-unset) | Remove a connection choice: the company's, a project admin's, or your own.                                                                                         |

**See also**

- [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md)

### `kindgi connection-choices set`

**Synopsis**

```sh signature
kindgi connection-choices set <connection>... (--agent=<id> | --flow=<id>) [--tool=<tool-id> [--need=<name>]] [--default=<connection>] [--mine] [--project=<project-id>] [--app=<app>]
```

Choose the connection an agent or a flow of the project uses at the connection's app, or with --tool the one a tool of it uses, in place of the one chosen before. Several connections make a tool's set, when the tool can take one: a call names one of them, else uses --default. A company choice is a project admin's; --mine makes your own, for your own runs.

**Options**

| Option              | Default                                                                | Description                                                                                               |
| ------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `--agent <value>`   | none (`--agent` or `--flow` is required)                               | The agent it is for, by id.                                                                               |
| `--app <value>`     | none                                                                   | With a name: only connections at this app, by its entry id (`google`).                                    |
| `--default <value>` | none (required with several connections)                               | With several connections: the one a call that names none uses, by id or name; one of them.                |
| `--flow <value>`    | none (`--agent` or `--flow` is required)                               | The flow it is for, by id.                                                                                |
| `--mine`            | off                                                                    | Your own choice, of your own connections, for your own runs.                                              |
| `--need <value>`    | none (required when the tool uses the app twice)                       | With --tool: the tool's name for the connection, when the tool uses the app more than once.               |
| `--project <value>` | the project stored with your key, else the workspace's default project | The project, by id (default: the project stored with your key, else the workspace's default project).     |
| `--tool <value>`    | none (the agent's or flow's own choice)                                | One of the agent's or flow's tools, by id: the choice is that tool's own, ahead of the agent's or flow's. |

Every command also takes the [global flags](https://docs.kindgi.com/v0.8.0/reference/cli.md#global-flags).

**Examples**

Have an agent use the company connection named `support`, in the Default project.

```sh
kindgi connection-choices set support --agent=acme.order-desk
```

Have a flow of a project use one of the project's company Google connections.

```sh
kindgi connection-choices set sales --flow=acme.triage-ticket --project=<project-id> --app=google
```

Have one tool of an agent use the company connection named `sales`, ahead of the agent's own choice.

```sh
kindgi connection-choices set sales --agent=acme.order-desk --tool=acme.mail.send
```

Give a tool that only reads three of your own connections, `work` by default: each call names the one it reads.

```sh
kindgi connection-choices set work home school --agent=acme.calendar-keeper --tool=acme.calendar.events --default=work --mine
```

From [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md):

```sh
pnpm exec kindgi connection-choices set support --agent=acme.mail-desk
pnpm exec kindgi connection-choices set sales --agent=acme.mail-desk --tool=acme.mail.send
```

**See also**

- [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md)
- [`kindgi connection-choices`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices)

### `kindgi connection-choices list`

**Synopsis**

```sh signature
kindgi connection-choices list [--project=<project-id>] [--agent=<id>] [--flow=<id>] [--tool=<tool-id>] [--app=<app>] [--mine] [--include-removed] [--limit=<n>] [--cursor=<c>] [--table]
```

List the project's connection choices: the company's and your own, and every person's for a tenant admin. `--mine` keeps to your own. Removed ones are left out unless `--include-removed`.

**Options**

| Option              | Default                                                                | Description                                                                                           |
| ------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `--agent <value>`   | none                                                                   | Only this agent's.                                                                                    |
| `--app <value>`     | none                                                                   | Only this app's, by its entry id (`google`).                                                          |
| `--cursor <value>`  | none                                                                   | The next page, from `nextCursor`.                                                                     |
| `--flow <value>`    | none                                                                   | Only this flow's.                                                                                     |
| `--include-removed` | off                                                                    | Removed and replaced choices too, with when (`removedAt`).                                            |
| `--limit <value>`   | `25` (at most `100`)                                                   | Page size.                                                                                            |
| `--mine`            | off                                                                    | Only your own, even as a tenant admin.                                                                |
| `--project <value>` | the project stored with your key, else the workspace's default project | The project, by id (default: the project stored with your key, else the workspace's default project). |
| `--tool <value>`    | none                                                                   | Only this tool's own choices, by its id.                                                              |

Every command also takes the [global flags](https://docs.kindgi.com/v0.8.0/reference/cli.md#global-flags).

**Examples**

List a project's connection choices, as a table.

```sh
kindgi connection-choices list --project=<project-id> --table
```

List an agent's choices, removed and replaced ones too.

```sh
kindgi connection-choices list --agent=acme.order-desk --include-removed --table
```

List only your own choices, as a table.

```sh
kindgi connection-choices list --mine --table
```

From [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md):

```sh
pnpm exec kindgi connection-choices list --table
```

**See also**

- [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md)
- [`kindgi connection-choices`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices)

### `kindgi connection-choices unset`

**Synopsis**

```sh signature
kindgi connection-choices unset <choice-id> [--yes]
```

Remove a connection choice: the company's, a project admin's, or your own. A tool's choice gives way to its agent's or flow's. An agent's or flow's gives way to the project's only company connection at the app, and stops with `connection-not-chosen` when there are several; your own gives way to your main connection, else your only one. Asks first, unless --yes.

**Options**

| Option  | Default | Description                    |
| ------- | ------- | ------------------------------ |
| `--yes` | off     | Don't ask first (for scripts). |

Every command also takes the [global flags](https://docs.kindgi.com/v0.8.0/reference/cli.md#global-flags).

**Examples**

Remove a connection choice without being asked (for scripts).

```sh
kindgi connection-choices unset <choice-id> --yes
```

From [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md):

```sh excerpt
pnpm exec kindgi connection-choices unset 8e2a4b13-…
```

**See also**

- [Choose a connection](https://docs.kindgi.com/v0.8.0/guides/connections/choose-a-connection.md)
- [`kindgi connection-choices`](https://docs.kindgi.com/v0.8.0/reference/cli/connection-choices.md#kindgi-connection-choices)
