brush supports an optional TOML configuration file that allows you to customize shell behavior without command-line arguments.
brush looks for the configuration file at:
- Linux/macOS:
${XDG_CONFIG_HOME}/brush/config.toml* - Windows:
%APPDATA%\brush\config.toml
Note
On Linux/macOS falls back to ~/.config/brush/config.toml if XDG_CONFIG_HOME is undefined.
You can override this location with the --config flag:
brush --config /path/to/custom/config.tomlTo disable configuration file loading entirely, use:
brush --no-configSettings are applied in the following order (later values override earlier ones):
- Defaults - Built-in default values
- Configuration file - Values from
config.toml - Command-line arguments - Flags passed to brush
The configuration file uses TOML format. All settings are optional; brush uses sensible defaults for any unspecified values.
[ui]
syntax-highlighting = true
[experimental]
zsh-hooks = true
terminal-shell-integration = trueUser interface settings.
| Setting | Type | Default | CLI flag | Description |
|---|---|---|---|---|
syntax-highlighting |
boolean | see below | --enable-highlighting |
Enable syntax highlighting in the input line |
The default value of
syntax-highlightingdepends on howbrush-shellwas built:truewhen built with theexperimentalCargo feature,falseotherwise. CLI flags take precedence over the configuration file.
Experimental features that may change or be removed in future versions. Each setting has an equivalent command-line flag; CLI flags take precedence over the configuration file. See the experimental features reference for details on each feature.
| Setting | Type | Default | CLI flag | Description |
|---|---|---|---|---|
zsh-hooks |
boolean | false |
--enable-zsh-hooks |
Enable zsh-style preexec/precmd hooks |
terminal-shell-integration |
boolean | false |
--enable-terminal-integration |
Enable terminal shell integration |
A JSON Schema for the configuration file is available at schemas/config.schema.json. This can be used with editors that support schema-based validation and autocompletion for TOML files.
To enable schema validation in VS Code with the Even Better TOML extension, add this to your config.toml:
#:schema https://raw.githubusercontent.com/reubeno/brush/main/schemas/config.schema.json
[ui]
syntax-highlighting = trueThe #:schema directive tells the editor where to find the schema for validation and autocompletion.
Many editors support JSON Schema for TOML files. Consult your editor's documentation for how to associate a schema with a file. You can reference the schema via:
- URL:
https://raw.githubusercontent.com/reubeno/brush/main/schemas/config.schema.json - Local path: Point to
schemas/config.schema.jsonin your brush source checkout
A sample configuration file is available at samples/config.toml in the brush repository. You can copy this file to get started:
# Linux/macOS
mkdir -p ~/.config/brush
cp samples/config.toml ~/.config/brush/config.tomlbrush ignores unknown settings in the configuration file. This allows configuration files to be shared across different versions of brush without causing errors.
If the configuration file cannot be read or parsed, brush logs an error message and continues with default settings. The shell will still start normally.