Move config file to XDG config dir

This commit is contained in:
Jan Bader
2026-07-20 20:41:24 +02:00
parent f603bbb8b8
commit 12aa0d4e21
3 changed files with 86 additions and 8 deletions
+10 -3
View File
@@ -18,11 +18,18 @@ A small command-line helper for managing Docspell import folders, archiving file
- A running Docspell instance.
- A password command, for example [`pass`](https://www.passwordstore.org/), that prints the Docspell password to stdout.
- FUSE support for the `mount` command, including `fusermount` or `fusermount3` for unmounting.
- A configuration file at `~/docspell-cli.json`.
- A configuration file at `${XDG_CONFIG_HOME:-~/.config}/docspell-cli/config.json`.
## Configuration
Create `~/docspell-cli.json`. See [docspell-cli-example.json](./docspell-cli-example.json) for a complete example.
Create `${XDG_CONFIG_HOME:-~/.config}/docspell-cli/config.json`. See [docspell-cli-example.json](./docspell-cli-example.json) for a complete example.
```bash
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/docspell-cli"
cp docspell-cli-example.json "${XDG_CONFIG_HOME:-$HOME/.config}/docspell-cli/config.json"
```
For compatibility, the legacy `~/docspell-cli.json` file is still read if the XDG config file does not exist, but the tool will print a warning asking you to move it.
```json
{
@@ -84,7 +91,7 @@ Uploaded files are not archived immediately. They are re-checked on the next run
## Read-only FUSE mount
The `mount` subcommand exposes Docspell search results as a read-only filesystem. It uses the same `~/docspell-cli.json` file and password command as the import/archive command.
The `mount` subcommand exposes Docspell search results as a read-only filesystem. It uses the same XDG config file and password command as the import/archive command.
Set `mountPath` in the config to define the default mount point and `mountQuery` to define the default Docspell query.