Файли
openidea/docs/en/reference/data-directories.mdx
T
l0ng-ai f91b87d790 feat: move configuration, user data and logs with environment variables (#3035)
OPENIDEA_CONFIG_DIR, OPENIDEA_DATA_DIR and OPENIDEA_LOG_DIR take an absolute path, like OPENIDEA_LOCAL_DATA_DIR, and the IDE uses <path>/<identifier> under it. Every place that resolved these directories now goes through ide_host::data_dirs (app state, invalidate caches, window zoom and window state, the MCP stdio bridge, logging, the openidea-plugin CLI), and the frontend takes the user data directory from app_info instead of Tauri's appDataDir. A relative path for the configuration or user data shows an error and exits.

Closes #2814
2026-11-13 09:53:08 +08:00

93 рядки
5.8 KiB
Plaintext
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
---
title: "Data directories and logs"
description: "Where OpenIDEA keeps its settings, user data, caches, downloaded tools and logs, and how to move the rebuildable data to another drive."
---
OpenIDEA's application id is `ai.l0ng.openidea`, and every directory below is named after it.
## Locations
| | macOS | Windows | Linux |
| ------------------------ | ------------------------------------------------ | -------------------------------------- | -------------------------------------- |
| Configuration | `~/Library/Application Support/ai.l0ng.openidea` | `%APPDATA%\ai.l0ng.openidea` | `~/.config/ai.l0ng.openidea` |
| User data | `~/Library/Application Support/ai.l0ng.openidea` | `%APPDATA%\ai.l0ng.openidea` | `~/.local/share/ai.l0ng.openidea` |
| Local data (rebuildable) | `~/Library/Application Support/ai.l0ng.openidea` | `%LOCALAPPDATA%\ai.l0ng.openidea` | `~/.local/share/ai.l0ng.openidea` |
| Logs | `~/Library/Logs/ai.l0ng.openidea` | `%LOCALAPPDATA%\ai.l0ng.openidea\logs` | `~/.local/share/ai.l0ng.openidea/logs` |
On macOS and Linux some of these are the same folder. **About OpenIDEA** shows the configuration directory and has **Open Configuration Folder**.
### Configuration
- `settings.toml`: your global settings. See the [settings reference](/en/reference/settings).
- `recent.json`, `recent-groups.json`: recent projects and their groups.
- `languages/`: language definitions you added or overrode.
### User data
- `plugins/`: installed plugins.
- `scratches/`: scratch files.
- `history/`: Local History of every project.
- `project-trust.json`: trusted projects and locations.
### Local data
Everything here can be downloaded or rebuilt, so it is safe to delete while OpenIDEA is closed:
- `tools/`: language servers, debug adapters, formatters and JDKs that OpenIDEA installed.
- `language-server-runtimes/`: runtimes the language servers run on.
- `index/`: the symbol index of each project.
- `cache/`: build tool sync results (Maven, Gradle) and other caches.
- `lsp/`: language server workspaces, such as the Java server's import data.
- `notebook-runtime/`, `server/`: the notebook runtime and remote-development server downloads.
- `agents/tools/`, `agents/registry.json`: agent tools and the agent registry.
To clear caches from inside the IDE, use **File › Invalidate Caches…**. The symbol index and syntax caches are always rebuilt; you can also check **Clear file system cache and Local History**, **Clear language server workspaces (Java import data and indexes)** and **Clear build tool caches (Maven / Gradle sync results)**. Choose **Invalidate and Restart**: the caches are removed at the next start, before any project opens.
## Project folder
Each project keeps its own files in `.openidea/` at the project root:
- `settings.toml`: settings saved with **This project** selected.
- `run.toml`: run configurations stored as project files, meant to be committed.
- `run.local.toml`: run configurations kept to yourself. OpenIDEA adds it to `.openidea/.gitignore`.
- `workspace.json`: the projects of a workspace.
## Move the local data
The local data can grow large (JDKs, language servers, indexes). To keep it on another drive, set `OPENIDEA_LOCAL_DATA_DIR` to an absolute path before starting OpenIDEA. The IDE then uses `<OPENIDEA_LOCAL_DATA_DIR>/ai.l0ng.openidea` and creates it if missing.
On Windows, for example:
```bat
setx OPENIDEA_LOCAL_DATA_DIR "E:\OpenIDEA"
```
On macOS and Linux, set it in the environment OpenIDEA starts from.
- If the path is relative or can't be written to, OpenIDEA shows an error and exits instead of falling back to the default location.
- Configuration, user data and logs stay where they are unless you move them too (see below). Logs are still written when the variable is wrong, so you can find out why.
- Existing data is not moved. Either let OpenIDEA download and rebuild it, or quit OpenIDEA and move only `tools/`, `language-server-runtimes/`, `index/`, `cache/`, `lsp/`, `notebook-runtime/`, `server/`, `logs/`, `agents/tools/`, `agents/registry.json` and the top-level `java-usages-*.jar` / `java-usages-*.tmp` files, keeping their relative paths. Leave everything else in place.
## Move configuration, user data or logs
Each of the other directories has its own variable, set the same way as `OPENIDEA_LOCAL_DATA_DIR`: an absolute path, read when OpenIDEA starts. OpenIDEA then uses `<path>/ai.l0ng.openidea` and creates it if missing.
| Variable | Moves |
| --------------------- | ------------- |
| `OPENIDEA_CONFIG_DIR` | Configuration |
| `OPENIDEA_DATA_DIR` | User data |
| `OPENIDEA_LOG_DIR` | Logs |
- Set only the ones you want to move; the rest keep their default locations. Pointing several variables at the same path is fine.
- If the configuration or user data path is relative or can't be used, OpenIDEA shows an error and exits instead of falling back to the default location. A wrong log path only turns off the log file.
- Existing files are not moved. To keep your settings, plugins and history, quit OpenIDEA and copy the old folder's contents to the new location first.
## Logs
OpenIDEA writes one log file per day, `openidea.<date>.log`, and keeps the last 7. Panics are written to the current log too.
- Open the folder with **Help › Show Log in Finder** (macOS), **Help › Show Log in Explorer** (Windows) or **Help › Show Log in Files** (Linux). The same link is in **About OpenIDEA**.
- For more detail, start OpenIDEA with the `RUST_LOG` environment variable set, for example `RUST_LOG=debug`. The default is `info`, with debug output from the app itself.
Attach the log when you [report a problem](/en/reference/troubleshooting#report-a-problem).