> For the complete documentation index, see [llms.txt](https://cloakedkeys.gitbook.io/ofsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloakedkeys.gitbook.io/ofsc/getting-started/advanced-customization.md).

# Advanced Customization

Environment variables are a way for advanced users to have more control over certain aspects of the program

**Default Values:** All environment variables keys are listed in the `ofscraper/utils/of_env/values` folder. This folder contains separate folders/files for different types of value. Each default can be overridden with its `OFSC_<NAME>` variable (for example `OFSC_DISCORD_ASYNC`), or with the bare key name.

> ℹ️ **Environment variables only change built-in defaults. They do not override a value that is set in `config.json`.**

#### Configuration Precedence

When determining the final value for any configuration setting, the program follows a specific order of precedence. Items higher on this list will **override** items lower on the list:

***

1. Explicit `.env` File (`--env-files` option, or `advanced_options.env_files` in `config.json`): Values loaded from the `.env` file(s) specified by the `--env-files` option. When the option is used, it replaces `advanced_options.env_files`. If this option is provided multiple times on the command line (e.g., `ofscraper --env-files a.env --env-files b.env`), all specified files are loaded in the order they are declared in the command. Values from files loaded later will take precedence over those from files loaded earlier. These values also override any conflicting values from earlier source.
2. Automatic `.env` File (via `load_dotenv`): Values loaded from a default `.env` file. This is typically initiated by a function call within the application's source code (e.g., `load_dotenv()`). The function searches upward from the program's install folder (from the working folder only in the standalone binaries).
3. System Environment Variables: Values already set in your operating system's environment (e.g., via `export VAR=VALUE` on Linux/macOS, or `set VAR=VALUE` on Windows Command Prompt). These are present before any `.env` files are loaded.
4. Hardcoded Defaults: Default values defined directly within the program's source code. These are used only if a setting is not found via any of the above methods.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cloakedkeys.gitbook.io/ofsc/getting-started/advanced-customization.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
