# barndog init (/docs/cli/init)

## `barndog init` [#barndog-init]

Guides you through workspace connection, authentication, harness selection, organization/team/personal assets, and installation. Enter your cloud or self-hosted workspace URL when prompted, or choose local-only setup. There is no default server URL.

```bash
barndog init
barndog init --server https://barndog.example.com
barndog init --no-browser
barndog init --local
```

| Option           | Description                                                                                                                          |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--server <url>` | Use this server instead of prompting for a URL.                                                                                      |
| `--local`        | Choose harnesses without connecting or signing in. Cannot be combined with `--server` or used on an already connected configuration. |
| `--no-browser`   | Print the sign-in URL and code without opening a browser.                                                                            |

Setup verifies an existing session or starts sign-in when needed, then shows your developer, organization, and role. Network and access failures stop setup.

Choose Claude Code, Codex, or Cursor; detected tools are marked. Harnesses start unchecked, and selecting no harnesses is allowed. Use arrow keys, Space to check or uncheck, and Enter to continue.

### Asset selection [#asset-selection]

On first setup, the organization is checked by default. Only teams you belong to are offered: if you belong to exactly one team, it is checked; if you belong to several, choose explicitly. The current directory and repository do not choose your team. Your personal assets are a separate unchecked source.

For each included source choose **all**, **recommended only**, or **custom**. Custom opens a paginated checkbox list limited to that source. Personal recommendations are your own assets marked recommended in an organization or team set; the prompt shows how many exist. Personal and custom choices are saved as individual selections of current assets; organization/team all or recommended choices remain subscriptions that follow future matching additions.

Setup does not list repositories, other teams, or other developers' assets. After setup, find a repository by name and include its assets if needed:

```bash
barndog sets list --origin repo --search dashboard
barndog sets install --origin repo/dashboard
```

The install command asks whether to include all assets, recommended only, or a custom selection.

Change teams later with `barndog sets switch-team <team>`. Browse assets outside setup with `barndog skills list`, `barndog mcp list`, or `barndog hooks list`, using `--search` and `--origin` filters.

### Knowledge and confirmation [#knowledge-and-confirmation]

Shared organization knowledge is enabled by default without a question. The integration exposes names and descriptions; full content is fetched on demand. Set `knowledge: false` in `~/.barndog/config.yaml` and sync, or run `barndog knowledge disable`. Setup preserves a saved disabled setting.

The final review shows harnesses, sources, individual selections, and knowledge status. Confirm to preflight and install the connected environment, then save `~/.barndog/config.yaml`. Local-only setup saves preferences for the next `barndog sync`.

Declining the review or cancelling before installation preserves saved preferences and installed assets. A completed sign-in is retained. Setup requires an interactive terminal.

## Running it again [#running-it-again]

`barndog init` asks before reopening existing setup. Saved choices are restored; defaults apply only to first setup. Repository subscriptions and selections outside the offered sources are retained, along with exclusions and activation overrides. Changing directories never changes the environment automatically.

Bare `barndog` shows the existing configuration path once setup is complete.
