Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add astro preferences CLI reference #5512

Merged
merged 10 commits into from
Dec 5, 2023
38 changes: 38 additions & 0 deletions src/content/docs/en/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Commands
info List info about your current Astro setup.
preview Preview your build locally.
sync Generate content collection types.
preferences Configure user preferences.
telemetry Configure telemetry settings.

Global Flags
Expand Down Expand Up @@ -287,6 +288,43 @@ Adapter @astrojs/vercel/serverless
Integrations none
```

## `astro preferences`

Manage user preferences with the `astro preferences` command. User preferences are specific to individual Astro users, unlike the `astro.config.mjs` file which changes behavior for everyone working on a project.

User preferences are scoped to the current project by default, stored in a local `.astro/settings.json` file. Using the `--global` flag, user preferences can also be applied to every Astro project on the current machine. Global user preferences are stored in an operating system-specific location.
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved

To disable the devOverlay in a specific Astro project:

```shell
astro preferences disable devOverlay
```

To disable the devOverlay in all Astro projects on the current machine:

```shell
astro preferences disable --global devOverlay
```

The devOverlay can later be enabled with:

```shell
astro preferences enable devOverlay
```
natemoo-re marked this conversation as resolved.
Show resolved Hide resolved

The `reset` command resets a preference to it's default value:
natemoo-re marked this conversation as resolved.
Show resolved Hide resolved

```shell
astro preferences reset devOverlay
```

The `list` command prints all current user preferences. It also supports a machine-readable `--json` output.
sarah11918 marked this conversation as resolved.
Show resolved Hide resolved

```shell
astro preferences list
```


sarah11918 marked this conversation as resolved.
Show resolved Hide resolved
## `astro telemetry`

Sets telemetry configuration for the current CLI user. Telemetry is anonymous data that provides the Astro team insights into which Astro features are most often used. For more information see [Astro's telemetry page](https://astro.build/telemetry/).
Expand Down
Loading