# kindgi connection-apps

> Registrations at other apps that connections go through; tenant admins only (list / get / add / remove)

## `kindgi connection-apps`

**Synopsis**

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

Registrations at other apps that connections go through; tenant admins only (list / get / add / remove).

**Commands**

| Command                                                                                                                          | Description                                                                                                                                                                                                                                 |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`kindgi connection-apps list`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps-list)     | List the workspace's registrations at other apps.                                                                                                                                                                                           |
| [`kindgi connection-apps get`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps-get)       | One registration, with the redirect and notices addresses to give the app.                                                                                                                                                                  |
| [`kindgi connection-apps add`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps-add)       | Register the workspace's app at Google (`google`), Microsoft (`microsoft`, with `--tenant`), GitHub (`github`, with its four GitHub flags) or LinkedIn (`linkedin`), by its client id and the secrets you stored with `kindgi secrets set`. |
| [`kindgi connection-apps remove`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps-remove) | Remove a registration.                                                                                                                                                                                                                      |

**See also**

- [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md)
- [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md)
- [LinkedIn](https://docs.kindgi.com/v0.5.0/guides/connections/linkedin.md)
- [Microsoft](https://docs.kindgi.com/v0.5.0/guides/connections/microsoft.md)

### `kindgi connection-apps list`

**Synopsis**

```sh signature
kindgi connection-apps list [--include-removed] [--limit=<n>] [--cursor=<c>] [--table]
```

List the workspace's registrations at other apps. Removed ones are left out unless `--include-removed`.

**Options**

| Option              | Default              | Description                                         |
| ------------------- | -------------------- | --------------------------------------------------- |
| `--cursor <value>`  | none                 | The next page, from `nextCursor`.                   |
| `--include-removed` | off                  | Removed registrations too, with when (`removedAt`). |
| `--limit <value>`   | `25` (at most `100`) | Page size.                                          |

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

**Examples**

List the workspace's registrations, as a table.

```sh
kindgi connection-apps list --table
```

List every registration, removed ones too, as a table.

```sh
kindgi connection-apps list --include-removed --table
```

**See also**

- [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md)
- [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md)
- [LinkedIn](https://docs.kindgi.com/v0.5.0/guides/connections/linkedin.md)
- [Microsoft](https://docs.kindgi.com/v0.5.0/guides/connections/microsoft.md)
- [`kindgi connection-apps`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps)

### `kindgi connection-apps get`

**Synopsis**

```sh signature
kindgi connection-apps get <app-id>
```

One registration, with the redirect and notices addresses to give the app. Its secrets show as references.

**Options**

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

**Examples**

Show a registration, with the redirect and notices addresses to give the app.

```sh
kindgi connection-apps get <app-id>
```

**See also**

- [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md)
- [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md)
- [LinkedIn](https://docs.kindgi.com/v0.5.0/guides/connections/linkedin.md)
- [Microsoft](https://docs.kindgi.com/v0.5.0/guides/connections/microsoft.md)
- [`kindgi connection-apps`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps)

### `kindgi connection-apps add`

**Synopsis**

```sh signature
kindgi connection-apps add <app> --client-id=<id> --client-secret-ref=<env>/<name> [--tenant=<directory>] [--projects=<id>,…] [--github-app-id=<n> --slug=<slug> --private-key-ref=<env>/<name> --webhook-secret-ref=<env>/<name>]
```

Register the workspace's app at Google (`google`), Microsoft (`microsoft`, with `--tenant`), GitHub (`github`, with its four GitHub flags) or LinkedIn (`linkedin`), by its client id and the secrets you stored with `kindgi secrets set`. Prints the registration, with the redirect and notices addresses to give the app.

**Options**

| Option                         | Default                                                             | Description                                                                                                                                                                                                                                            |
| ------------------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--client-id <value>`          | required                                                            | The app's OAuth client id.                                                                                                                                                                                                                             |
| `--client-secret-ref <value>`  | required                                                            | The secret holding its client secret: `<env>/<name>`, or `<name>` under the env the runtime serves.                                                                                                                                                    |
| `--github-app-id <value>`      | required for `github`                                               | GitHub: the GitHub App's App ID, a number. Not a registration's id, which `get` and `remove` take.                                                                                                                                                     |
| `--private-key-ref <value>`    | required for `github`                                               | GitHub: the secret holding the GitHub App's private key, as --client-secret-ref.                                                                                                                                                                       |
| `--projects <value>`           | none: every project                                                 | The projects whose connections may use it, comma-separated ids. Default: every project.                                                                                                                                                                |
| `--slug <value>`               | required for `github`                                               | GitHub: the GitHub App's slug.                                                                                                                                                                                                                         |
| `--tenant <value>`             | none: required where the app's entry names no default (`microsoft`) | Microsoft: the directory people sign in at: your Directory (tenant) ID or domain for a single-tenant app, or `organizations`, `common` or `consumers` for a multi-tenant one. Required where the app's entry names no default, as Microsoft's doesn't. |
| `--webhook-secret-ref <value>` | required for `github`                                               | GitHub: the secret holding the GitHub App's webhook secret, as --client-secret-ref.                                                                                                                                                                    |

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

**Examples**

Register the company's Google client, its secret stored first with `kindgi secrets set`.

```sh
kindgi connection-apps add google --client-id=<client-id> --client-secret-ref=production/ACME_GOOGLE_CONNECT_SECRET
```

Register the company's Microsoft Entra app, a single-tenant one, at its own directory.

```sh
kindgi connection-apps add microsoft --client-id=<client-id> --client-secret-ref=production/ACME_MICROSOFT_CONNECT_SECRET --tenant=<tenant-id>
```

Register the company's GitHub App.

```sh
kindgi connection-apps add github --github-app-id=<n> --slug=<slug> --client-id=<client-id> --client-secret-ref=production/ACME_GITHUB_CLIENT_SECRET --private-key-ref=production/ACME_GITHUB_PRIVATE_KEY --webhook-secret-ref=production/ACME_GITHUB_WEBHOOK_SECRET
```

Register the company's LinkedIn app.

```sh
kindgi connection-apps add linkedin --client-id=<client-id> --client-secret-ref=production/ACME_LINKEDIN_CONNECT_SECRET
```

From [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md):

```sh
npx --yes @kindgi/cli@0.2 connection-apps add github --github-app-id=<github-app-id> --slug=<slug> --client-id=<client-id> --client-secret-ref=production/ACME_GITHUB_CLIENT_SECRET --private-key-ref=production/ACME_GITHUB_PRIVATE_KEY --webhook-secret-ref=production/ACME_GITHUB_WEBHOOK_SECRET
```

From [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md):

```sh
npx --yes @kindgi/cli@0.2 connection-apps add google --client-id=<client-id> --client-secret-ref=production/ACME_GOOGLE_CONNECT_SECRET
```

**See also**

- [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md)
- [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md)
- [LinkedIn](https://docs.kindgi.com/v0.5.0/guides/connections/linkedin.md)
- [Microsoft](https://docs.kindgi.com/v0.5.0/guides/connections/microsoft.md)
- [`kindgi connection-apps`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps)

### `kindgi connection-apps remove`

**Synopsis**

```sh signature
kindgi connection-apps remove <app-id> [--with-connections] [--yes]
```

Remove a registration. One with live connections is refused unless --with-connections, which disconnects them too. Asks first, unless --yes.

**Options**

| Option               | Default | Description                                                                             |
| -------------------- | ------- | --------------------------------------------------------------------------------------- |
| `--with-connections` | off     | Disconnect its live connections too: each withdrawn at the app and its token destroyed. |
| `--yes`              | off     | Don't ask first (for scripts).                                                          |

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

**Examples**

Remove a registration and disconnect every connection through it.

```sh
kindgi connection-apps remove <app-id> --with-connections
```

**See also**

- [GitHub](https://docs.kindgi.com/v0.5.0/guides/connections/github.md)
- [Google](https://docs.kindgi.com/v0.5.0/guides/connections/google.md)
- [LinkedIn](https://docs.kindgi.com/v0.5.0/guides/connections/linkedin.md)
- [Microsoft](https://docs.kindgi.com/v0.5.0/guides/connections/microsoft.md)
- [`kindgi connection-apps`](https://docs.kindgi.com/v0.5.0/reference/cli/connection-apps.md#kindgi-connection-apps)
