# The Configuration File A single configuration file named `unshackle.yaml` controls almost everything about how unshackle behaves. It sets where unshackle saves downloads, which CDM it uses, your credentials, proxies, filename templates, and more. This page gives where that file lives, how unshackle finds it, and the shape of its contents. It also gives the directory layout unshackle makes around it, and how to edit values from the command line. !!! note "Where the exhaustive key list lives" This page is an overview. For the complete, key-by-key breakdown of every setting, its type, and its default, see the [Configuration Reference](../reference/configuration/index.md). ## The config filename The main configuration file is always named `unshackle.yaml`. It uses plain YAML. You can open and edit it in any text editor, or manage individual values with the [`unshackle cfg`](#editing-the-config-with-unshackle-cfg) command. The file only needs to contain the keys you want to change from their defaults, with one exception: `dl` needs an [`output_template`](../reference/configuration/output.md#output_template) to name its files, and stops with an error without one. [`unshackle setup`](installation.md#what-unshackle-setup-does) writes a first config that has one. ## Where the config file lives When unshackle starts, it searches a fixed list of locations and uses the **first one that exists**. In order of priority: | # | Location | Typical path | |---|----------|--------------| | 1 | The unshackle package folder | `/unshackle/unshackle.yaml` (a `uv` tool install: `.../site-packages/unshackle/unshackle.yaml`) | | 2 | The parent of the package folder | `/unshackle.yaml` (a `uv` tool install: `.../site-packages/unshackle.yaml`) | | 3 | Your OS user-config directory | see the table below | Where the file belongs depends on how you installed unshackle: - **Git clone (recommended).** Keep the file at `unshackle/unshackle.yaml` inside the clone, which is location 1. [`unshackle setup`](installation.md#what-unshackle-setup-does) writes a new config there, and it stays with the clone when you update it. - **`uv` tool install.** Use location 3, your per-user config directory. A `uv` tool upgrade replaces the package folder, so a file at location 1 or 2 is lost. `unshackle setup` writes a new config there. The path of the per-user config directory depends on your operating system: === "Linux" ```text ~/.config/unshackle/unshackle.yaml ``` === "Windows" ```text %LOCALAPPDATA%\unshackle\unshackle.yaml ``` === "macOS" ```text ~/Library/Application Support/unshackle/unshackle.yaml ``` !!! tip "Not sure which file is being used?" Operate `unshackle env info`. It prints the path unshackle loaded the config from, or tells you that it found none. It also prints every directory unshackle currently uses. unshackle reads the config once, when it starts. If you edit the file, the change takes effect on the next command. ## Top-level structure `unshackle.yaml` is a flat map of top-level config keys. Each config key configures one area of the program. You include only the config keys you want to change. Everything else falls back to its default. Here is a small, realistic example that sets a download location, filename templates, a release tag, a default CDM, and one service's credentials: ```yaml title="unshackle.yaml" # Where finished downloads are written directories: downloads: ~/Videos/unshackle # How dl names movie and episode files (dl needs this key) output_template: movies: "{title}.{year}.{quality}.{source}.WEB-DL.{audio_full}.{video}-{tag?}" series: "{title}.{season_episode}.{episode_name?}.{quality}.{source}.WEB-DL.{audio_full}.{video}-{tag?}" # Release group tag appended to filenames tag: MYGRP # Default Widevine/PlayReady device to use, with per-service overrides cdm: default: my_device_l3 EXAMPLE: my_device_l1 # Per-service login details (service tag -> "username:password") credentials: EXAMPLE: my_email@example.com:hunter2 # Default HTTP headers merged into every request headers: Accept-Language: en-US,en;q=0.9 ``` The [quick index](../reference/configuration/index.md#quick-index) of the Configuration Reference lists every top-level key, grouped by area, with a link to its types and defaults. !!! warning "Unknown keys are silently ignored" unshackle does not validate your config against a schema. If you misspell a config key, unshackle skips it and uses the default. You will not get an error. Examine the config key names (and their nesting) if a setting does not seem to apply. ## Setting download defaults (`dl:`) If you always pass the same `dl` flags (a language, a resolution, a codec), put them under a `dl:` config key once and unshackle applies them to every download. An explicit flag on the command line still wins. ```yaml title="unshackle.yaml" dl: lang: [en] # -l en quality: [1080] # -q 1080 sub_format: srt # convert subtitles to SRT ``` The [`dl` reference](../reference/configuration/download.md#dl) gives how a flag becomes a config key, the keys that do not follow that rule, per-service defaults and the order in which the values apply. ## The directory layout The `directories` config key controls where unshackle reads and writes its files. Each directory has a default, and a path can use `~` for your home directory: ```yaml title="unshackle.yaml" directories: downloads: ~/Videos/unshackle temp: /mnt/fast/unshackle-temp ``` The [Directories reference](../reference/configuration/directories.md) lists every directory with its default, the directories that you cannot move, and how the `services` list loads services from local folders and Git repositories. The `filenames` config key on the same page changes the names of unshackle's own working and log files. ## Editing the config with `unshackle cfg` You do not have to edit `unshackle.yaml` by hand. The `unshackle cfg` command reads and writes individual values for you, creating the config file (and its parent directory) if it does not exist yet. **Read a single value** by passing its config key. Nested config keys use dot notation: ```console $ unshackle cfg tag $ unshackle cfg cdm.default ``` **Set a value** by passing a config key and a value: ```console $ unshackle cfg tag MYGRP $ unshackle cfg cdm.default my_device_l3 ``` unshackle parses the value as a Python literal, so write booleans as `True`/`False` and quote the strings inside a list (`"['en']"`). unshackle stores anything that is not valid Python literal syntax as a plain string: ```console $ unshackle cfg update_checks False $ unshackle cfg vault_timeout 30 ``` **Remove a value** with `--unset`: ```console $ unshackle cfg cdm.default --unset ``` **Show everything** currently set with `--list`: ```console $ unshackle cfg --list ``` When it writes, `unshackle cfg` targets the config file that unshackle loaded. If none exists yet, it makes `unshackle.yaml` in the `unshackle` package folder (location 1 above): - **Git clone.** That is `unshackle/unshackle.yaml` in the clone, which is the correct place. - **`uv` tool install.** A tool upgrade replaces the package folder and deletes that file. Run `unshackle setup` first, which writes the config to your user config directory, or make the file there yourself. Then `unshackle cfg` writes to it. !!! warning "Editing with `cfg` strips comments" Because `unshackle cfg` rewrites the whole file when it saves, a write removes any comments in `unshackle.yaml`. If you keep important notes as comments, edit the file by hand instead, or keep those notes elsewhere. ## Next steps - Browse the [Configuration Reference](../reference/configuration/index.md) for every config key and default. - Set up your first download in [Downloading](../guide/downloading.md). - Learn how unshackle discovers and updates services in [Creating a Service](../dev/creating-a-service.md).