# ChatGPT Desktop App Configuration File Location: Where Settings Are Stored

> Find the ChatGPT desktop app configuration file location. Learn where your app settings are stored in the config.json file on your operating system.

- Repository: [lencx/ChatGPT](https://github.com/lencx/ChatGPT)
- Tags: api-reference
- Published: 2026-03-06

---

**The ChatGPT desktop app stores its configuration in a JSON file named [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) located within an OS-specific directory under `com.nofwl.chatgpt`, using Tauri's standard configuration directory API.**

The **lencx/ChatGPT** repository provides an open-source desktop client that persists user preferences—such as theme settings, window behavior, and script configurations—to the local filesystem. Understanding the exact **ChatGPT desktop app configuration file location** is essential for troubleshooting, manual backups, or advanced customization of the application.

## Configuration File Location by Operating System

The application determines the base configuration directory using Tauri's `AppHandle::path().config_dir()` method, then appends the bundle identifier `com.nofwl.chatgpt` and the filename [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json). This results in the following **ChatGPT desktop app configuration file locations** across platforms:

- **Windows**: `%APPDATA%\com.nofwl.chatgpt\config.json`
- **macOS**: `$HOME/Library/Application Support/com.nofwl.chatgpt/config.json`
- **Linux**: `$HOME/.config/com.nofwl.chatgpt/config.json`

If the file does not exist when the application launches, the `AppConf::load` function automatically generates a default configuration and persists it to this location.

## How the Configuration Path Is Determined in Code

In [`src-tauri/src/core/conf.rs`](https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/core/conf.rs), the `AppConf` struct implements the `get_conf_path` method to resolve the absolute path dynamically. This ensures the application respects platform conventions for user data storage.

```rust
pub fn get_conf_path(app: &AppHandle) -> Result<PathBuf, Box<dyn std::error::Error>> {
    let config_dir = app
        .path()
        .config_dir()?                      // OS‑specific config base directory
        .join("com.nofwl.chatgpt")          // app‑specific subfolder
        .join("config.json");                // actual file
    Ok(config_dir)
}

```

The `com.nofwl.chatgpt` identifier is defined in [`src-tauri/tauri.conf.json`](https://github.com/lencx/ChatGPT/blob/main/src-tauri/tauri.conf.json) as the bundle identifier, ensuring the configuration directory remains isolated from other applications.

## Reading and Modifying Configuration Programmatically

The Rust backend exposes the `get_app_conf` command (registered in [`src-tauri/src/main.rs`](https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/main.rs)) that allows the frontend—specifically components like [`src/view/Settings.tsx`](https://github.com/lencx/ChatGPT/blob/main/src/view/Settings.tsx)—to retrieve and update settings.

**Reading the current configuration:**

```rust
let app_conf = AppConf::load(&app_handle).expect("Failed to load config");
println!("Current theme: {}", app_conf.theme);

```

**Updating and persisting changes:**

```rust
let mut conf = AppConf::load(&app_handle).unwrap();
conf.theme = "dark".to_string();               // change theme
conf.save(&app_handle).expect("Could not save config");

```

**Loading user scripts from the same directory:**

User scripts are stored in a `scripts` subdirectory within the same configuration folder. The application loads these via:

```rust
let script = AppConf::load_script(&app_handle, "my_script.js");

```

## Related Configuration Files and Directories

Beyond the main [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) file, the `com.nofwl.chatgpt` directory contains additional user data:

| File/Directory | Location | Purpose |
|----------------|----------|---------|
| **config.json** | [`com.nofwl.chatgpt/config.json`](https://github.com/lencx/ChatGPT/blob/main/com.nofwl.chatgpt/config.json) | Primary settings file (theme, window state, language) |
| **scripts/** | `com.nofwl.chatgpt/scripts/` | User-supplied JavaScript files for customizing the ChatGPT web interface |
| **tauri.conf.json** | [`src-tauri/tauri.conf.json`](https://github.com/lencx/ChatGPT/blob/main/src-tauri/tauri.conf.json) | Build-time Tauri configuration defining the bundle identifier |

Modifying [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) while the application is running may cause the app to overwrite your changes on exit, as the `AppConf::save` method is called whenever settings are modified through the UI.

## Summary

- The **ChatGPT desktop app configuration file location** varies by OS but always resides under the `com.nofwl.chatgpt` subdirectory of the system's standard application data folder.
- The path is constructed in [`src-tauri/src/core/conf.rs`](https://github.com/lencx/ChatGPT/blob/main/src-tauri/src/core/conf.rs) within the `AppConf::get_conf_path` function using Tauri's `config_dir` API.
- The file is named [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) and stores JSON-serialized settings including theme preferences and window behavior.
- User scripts are stored in a `scripts` subdirectory adjacent to the configuration file.
- The application automatically creates default settings if the configuration file is missing during startup.

## Frequently Asked Questions

### Can I manually edit the ChatGPT desktop app configuration file?

Yes. You can edit [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) using any text editor when the application is closed. The file uses standard JSON formatting to store settings like `"theme": "dark"` or `"stay_on_top": true`. However, avoid editing the file while the app is running, as the application may overwrite your changes when it saves its internal state on exit or settings update.

### How do I back up my ChatGPT desktop app settings?

Copy the entire `com.nofwl.chatgpt` directory from your OS-specific configuration path. On Windows, archive `%APPDATA%\com.nofwl.chatgpt\`; on macOS, copy `$HOME/Library/Application Support/com.nofwl.chatgpt/`; on Linux, backup `$HOME/.config/com.nofwl.chatgpt/`. This preserves both [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) and any custom scripts in the `scripts` subdirectory.

### Where are user scripts stored in the ChatGPT desktop app?

User scripts are stored in the `scripts` folder inside the same configuration directory as [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json). For example, on macOS, this would be `$HOME/Library/Application Support/com.nofwl.chatgpt/scripts/`. The application loads these JavaScript files via `AppConf::load_script` to inject custom functionality into the ChatGPT web interface.

### How do I reset the ChatGPT desktop app to default settings?

Close the application completely, then delete the [`config.json`](https://github.com/lencx/ChatGPT/blob/main/config.json) file from the configuration directory. When you restart the app, `AppConf::load` will detect the missing file and automatically generate a new configuration with default values. Alternatively, delete the entire `com.nofwl.chatgpt` directory to remove both settings and cached user scripts.