> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meetsilicon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate the CLI

> Log in with browser OAuth, a personal access token, or CI environment variables

## Login

The CLI uses browser-based OAuth login by default, making authentication quick and easy.

### Basic login

```bash theme={null}
silicon login {{ silicon_domain }}
```

where `{{ silicon_domain }}` is the subdomain for your Silicon instance. For example, if you login at `https://petey.meetsilicon.com`, then you would type `silicon login petey` to pop up a login window.

```bash theme={null}
silicon login petey
```

This opens your browser to authenticate. Once authorized, you're logged in and ready to use the CLI.

### Flexible URL formats

The CLI accepts your instance URL in multiple formats, all of these work:

```bash theme={null}
# Just your subdomain (recommended)
silicon login your_subdomain_here

# Full domain without protocol
silicon login your_subdomain_here.meetsilicon.com

# Full URL with protocol
silicon login https://your_subdomain_here.meetsilicon.com

# Any URL from your Silicon instance (useful for copying from browser)
silicon login https://your_subdomain_here.meetsilicon.com/projects/abc123/dashboards
```

You can use your subdomain (for example, `petey` if your instance is at `petey.meetsilicon.com`). If you use the full domain without the `https://` prefix, the prefix is assumed automatically.

### Re-authenticate to a previous instance

Once you've logged in, you can re-authenticate without specifying the URL:

```bash theme={null}
silicon login
```

This uses your previously saved instance URL.

> [accordion] Login with a personal access token (for SSO users)
>
> If you use single sign-on (SSO) in the browser, login with a personal access token.
>
> First, create a new personal access token in the UI by going to Settings > Personal Access Tokens.
>
> Then, run the following command:
>
> ```bash theme={null}
> silicon login your_subdomain_here --token
> ```

> [accordion] Login with environment variables (for CI/CD)
>
> You can use the following environment variables to authenticate yourself on each command:
>
> * **SILICON\_API\_KEY** a personal access token you can generate in the app under the user settings
>
> * **SILICON\_URL** address for your running Silicon instance
>
> * **SILICON\_PROXY\_AUTHORIZATION** if your Silicon instance is behind a proxy like [Cloud IAP](https://cloud.google.com/iap) you can set here `Proxy-Authentication` header value
>
> Example:
>
> ```bash theme={null}
> SILICON_API_KEY=946fedb74003405646867dcacf1ad345 SILICON_URL="https://your_subdomain_here.meetsilicon.com" SILICON_PROXY_AUTHORIZATION="Bearer <JWT_TOKEN>" silicon preview
> ```

## Set active project

When you login you'll be asked to set an active project.

Your active project is just the one that you're working on/developing in. Your organization might just have one project, so that makes your decision easy!

You can change your active project by running:

```bash theme={null}
silicon config set-project
```

Or you can use the `SILICON_PROJECT` environment variable to indicate what project UUID the command should use.

Example:

```bash theme={null}
SILICON_PROJECT="3675b69e-8324-4110-bdca-059031aa8da3" silicon deploy
```

## Now that you've logged in, you're ready to use the CLI

You can see all of the actions available on the CLI by typing this in your terminal:

```bash theme={null}
silicon
```

Some of our favourites are:

* [Automatically generating .yml for your dbt models using silicon generate](https://docs.meetsilicon.com/workflow/cli/generate.md)

* [Testing your changes with developer previews using silicon preview](https://docs.meetsilicon.com/workflow/preview-projects.md)

* [Deploying your changes to production using silicon deploy](https://docs.meetsilicon.com/workflow/cli/deploy.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.