Data directories and environment variables
Effective paths
The base configuration directory defaults to ~/.mogick; MOGICK_CONFIG_DIR overrides it. The base data directory defaults to the configuration base; MOGICK_DATA_DIR overrides it.
In 26.9.11, active runtime profiles can add profiles/<profile-id>/ under both bases. In this documentation, <config-dir> and <data-dir> mean the effective directories after profile selection, not necessarily ~/.mogick. Do not copy files to the base directory without checking the active profile.
| Path | Purpose |
|---|---|
<config-dir>/config.json | Global non-secret settings |
<config-dir>/auth.json | Global credentials; never publish |
<config-dir>/mcp.json | Global MCP configuration |
<config-dir>/skills/ | Global Mogick Skills |
<data-dir>/sessions.sqlite | Default stable-channel session database |
<data-dir>/sessions.<channel>.sqlite | Default non-stable-channel session database |
<data-dir>/mogick-state.sqlite | Runtime state database |
<db-path>.payloads/ | Payload files associated with the actual session database |
<database directory>/last-session.txt | Last-session pointer |
.mogick/config.json, .mogick/auth.json, .mogick/mcp.json | Project settings relative to the launch working directory |
.mogick/skills/ | Project Skills |
An explicit memory.db_path overrides the default database path; it is not automatically renamed per channel. Switching profile or channel can therefore change which sessions are visible. Missing history after a switch does not by itself mean deletion.
Environment variables
| Variable | Scope |
|---|---|
MOGICK_CONFIG_DIR | Base for global configuration and Skills |
MOGICK_DATA_DIR | Base for default data, falling back to the configuration base |
MOGICK_CONFIG_FILE | Main configuration file only; does not relocate auth, MCP, Skills or data |
MOGICK_RUNTIME_ENV | Runtime preset selection |
MOGICK_TUI_THEME | auto, dark, or light |
MW_LOG_LEVEL | Log level |
MOGICK_UPGRADE_URL | Update-service override |
Project .mogick/ remains relative to the current working directory. Environment variables are not a generic override mechanism for every JSON field.
Configuration precedence
Built-in defaults and runtime presets are overlaid by global and project settings. Most scalar fields override individually; a non-empty project llm.providers[] replaces the provider array. Agent tool settings resolve by agent and tool. Project auth and MCP definitions have their own merge rules. See Configuration reference.
Backup scope
Stop all Mogick processes using the database before making a consistent backup. Preserve the actual session database and its matching .payloads/ directory, the effective data/state directory, and required global/project configuration. Include the workspace files separately if you need to restore the project.
Do not assume that copying only sessions.sqlite, or exporting a transcript, creates a complete backup. Treat credentials and conversation payloads as sensitive. Record the version, profile, channel and original paths; verify a restore in an isolated location before relying on it. This page does not promise cross-version migration compatibility.