Skip to content

Commit

Permalink
Add astro preferences CLI reference (#5512)
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
  • Loading branch information
2 people authored and ematipico committed Jan 26, 2024
1 parent 46d16b9 commit 3e9f742
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 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,44 @@ 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.
For example, to disable the devToolbar in a specific Astro project:
```shell
astro preferences disable devToolbar
```
To disable the devToolbar in all Astro projects on the current machine:
```shell
astro preferences disable --global devToolbar
```
The devToolbar can later be enabled with:
```shell
astro preferences enable devToolbar
```
The `reset` command resets a preference to its default value:
```shell
astro preferences reset devOverlay
```
The `list` command prints the current settings of all configurable user preferences. It also supports a machine-readable `--json` output.
```shell
astro preferences list
```
## `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

0 comments on commit 3e9f742

Please sign in to comment.