# getstream init

Link the current directory to one of your apps. Each directory links independently, so separate checkouts can target different apps.

```bash
getstream init
```

Interactively, `init` prompts for an organization and an app, then offers to install the [Stream agent skills](https://getstream.io/cli/docs/commands/skills/). With no account session it runs the browser sign-in first. On confirmation it writes the app's key, secret and app id to `.stream/creds.yaml` (mode `600`), the file every other command reads, and adds `.stream/` to `.gitignore`. The file carries a `# Stream app: <name> (<id>)` comment naming the app it holds.

## Headless

Without a TTY, `init` cannot show the pickers. It writes a command file instead, `.stream/init-<id>.yaml`, listing the apps in each of your organizations plus commented options for creating a new app or a new organization and an optional `skills:` block. Uncommenting one choice and applying it with `--command` links the app as the interactive flow does, then deletes the command file.

```bash
getstream init --command .stream/init-<id>.yaml
```

This path still needs an account session to list your apps, so it is not how the CLI runs in CI. See [Use the CLI in CI](https://getstream.io/cli/docs/ci/), where the pipeline sets `STREAM_API_KEY` and `STREAM_API_SECRET` from secrets and skips `init`.

## Flags

| Flag               | Effect                                                                                                          |
| ------------------ | --------------------------------------------------------------------------------------------------------------- |
| `--command <file>` | Apply a filled-in command file and link the app. Hidden from `--help`; the headless flow above is its only use. |

## See also

- [Manual quickstart](https://getstream.io/cli/docs/manual-quickstart/): the init step in context
- [`getstream open`](https://getstream.io/cli/docs/commands/open/): open the linked app in the [Dashboard](https://getstream.io/signin/)
- [Projects and credentials](https://getstream.io/cli/docs/concepts/projects-and-credentials/): what `init` writes and how it's used

---

For the most recent version of this documentation, visit [https://getstream.io/cli/docs/commands/init/](https://getstream.io/cli/docs/commands/init/).