Skip to content

Commit

Permalink
fix: update config file search paths (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
tconbeer authored Feb 22, 2024
1 parent 48eab9d commit 9d4ff08
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/docs/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ Harlequin also provides a tool for creating and editing profiles. For more infor

## Config File Discovery

Harlequin will automatically search the current directory and the user's home directory (`~`) for files named either `.harlequin.toml` or `pyproject.toml`. If it finds multiple files, it will merge the contents of those files, with the current directory taking precedence over the home directory.
Harlequin loads config files from the following locations. If it finds multiple files, it merges them, with items listed first taking priority:

Alternatively, you can specify a custom path to a config file by invoking Harlequin with the `--config-path` option:
1. The file located at the path provided by the `--config-path` CLI option (see below).
2. Files named `harlequin.toml`, `.harlequin.toml`, or `pyproject.toml` in the current working directory.
3. Files named `harlequin.toml`, `.harlequin.toml`, or `config.toml` in the user's default config directory, in the `harlequin` subdirectory. For example:
- Linux: `$XDG_CONFIG_HOME/harlequin/config.toml` or `~/.config/harlequin/config.toml`
- Mac: `~/Library/Application Support/harlequin/config.toml`
- Windows: `~\AppData\Local\harlequin\config.toml`
4. Files named `harlequin.toml`, `.harlequin.toml`, or `pyproject.toml` in the user's home directory (`~`).

### Custom Config Path

You can specify a custom path to a config file by invoking Harlequin with the `--config-path` option:

```bash
harlequin --config-path /path/to/my/file.toml
Expand Down Expand Up @@ -86,7 +96,7 @@ port = 5432

### Using pyproject.toml

If configuring Harlequin using `pyproject.toml`, you must nest the above config under the `tool.harlequin` config. An example `pyproject.toml` file:
If configuring Harlequin using `pyproject.toml`, you must nest the above config under the `tool.harlequin` table. An example `pyproject.toml` file:

```toml
[tool.harlequin]
Expand Down

0 comments on commit 9d4ff08

Please sign in to comment.