AdguardTeam / AdguardTeam/AdGuardCLI
Follow XDG Base Directory specification for user data
- Lenguaje dominante
- Sin datos de lenguaje
- Estrellas
- 160
- Forks
- 6
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Issue Details
Currently, AdGuard CLI stores all user-specific data under:
`~/.local/share/adguard-cli`
This includes configuration files, logs, caches, and runtime/state files.
This layout does not comply with the XDG Base Directory Specification, which is widely followed on Linux systems. - [Source](https://specifications.freedesktop.org/basedir/latest/)
According to the spec:
Configuration files should go in `$XDG_CONFIG_HOME` (`~/.config`)
Cache/logs should go in `$XDG_CACHE_HOME` (`~/.cache`)
Persistent application data should go in `$XDG_DATA_HOME` (`~/.local/share`)
Runtime/state files can go in `$XDG_STATE_HOME` or appropriate runtime paths
While installing binaries under `/opt/adguard-cli` is fine (since it’s not managed by a package manager), mixing config, cache, and data files inside `~/.local/share` causes clutter and makes backups, syncing, and system hygiene harder.
### Proposed solution
Let me use my current install's structure as example for solution.
Currently files under `~/.local/share/adguard-cli` are:
```
AdGuard CLI CA.pem
adguard.conf
browsers.yaml
proxy.yaml
proxy.yaml.bak
https_exclusions.txt
user.txt
SSL/
logs/
userscripts/
/crlitedb
.sentry-native/
version
logs-adguard-cli_2026-01-20_05-24-38.zip
settings-adguard-cli_2026-01-20_05-24-46.zip
```
This is similar to legacy layouts (e.g., old Firefox dumping everything into `~/.mozilla`), which most Linux apps have since moved away from.
Below is the file structure I am proposing
`~/.config/adguard-cli/`
```
adguard.conf
browsers.yaml
proxy.yaml (+ .bak)
https_exclusions.txt
user.txt
```
`~/.cache/adguard-cli/`
```
logs/
logs-adguard-cli_*.zip
settings-adguard-cli_*.zip
any temporary or generated log/output files
```
`~/.local/share/adguard-cli/`
```
*.db
userscripts/
AdGuard CLI CA.pem
SSL/
version
other non-config, non-cache data
```
Also files which change every session but are not cache as per say like
```
adguard.pid
agcli.socket
```
These would be fine in `~/.local/share/adguard-cli/` but would be better off in `~/.local/state/adguard-cli/`
### Alternative solution
Alternative Solution is not caring about the spec.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.