# config

Show the effective configuration for this directory after overrides, reading files only.

URL: https://coolship.itrocas.com/docs/commands/config

```text
coolship config [flags]
```

`config` shows the discovered configuration file, the selected target, the binding, which credentials would be used, and the preferences file, after applying any overrides. It reads files only: no request is made to Coolify and no token is shown.

```text
$ coolship config --context home
Configuration:    /home/you/my-app/coolship.toml
Git root:         /home/you/my-app
Target:           default
Application root: /home/you/my-app
Context:          home
Project:          Personal
Environment:      production
Application:      fenix-bot
Credentials:      /home/you/.config/coolify/config.json
Instance:         home at https://coolify.example.com
Preferences:      /home/you/.config/coolship/preferences.toml (absent)
Override context: home
```

## Examples

```bash
coolship config
coolship config --target api
coolship config --environment staging --format json
```

Use it to see what `--cwd`, `--config`, `--context`, `--environment`, and `--target` resolve to, or which of the committed context and the `COOLSHIP_URL`/`COOLSHIP_TOKEN` pair applies.

## Preferences

Preferences are one developer's tastes on one machine, as opposed to the configuration in `coolship.toml`, which the team shares and commits. They live in a TOML file Coolship reads but never creates:

* Unix and macOS: `~/.config/coolship/preferences.toml`, or `$XDG_CONFIG_HOME/coolship/preferences.toml` when `XDG_CONFIG_HOME` is an absolute path
* Windows: `%AppData%\coolship\preferences.toml`
* Anywhere: the file `COOLSHIP_PREFERENCES` names, for tests and CI

```toml
verbosity = "normal"   # normal | verbose | debug
build_logs = true      # true streams build logs, false collapses them; absent follows the verbosity
color = "auto"         # auto | always | never
```

`verbosity` is the default when neither `--verbose`, `--debug`, nor `COOLSHIP_VERBOSITY` is given (see [verbosity](https://coolship.itrocas.com/docs/platform/output#verbosity)), and `build_logs` decides the build log when neither `--logs` nor `--no-logs` is given. `color` is read and checked today and takes effect in a later version. Credentials never go in this file: the Coolify URL and token stay in [Coolify CLI's file](https://coolship.itrocas.com/docs/concepts/credentials), so one login serves both tools.

The `Preferences` line shows the path, then `(absent)` when there is no file or the keys it sets, such as `(verbosity verbose, build logs off, color auto)`. An unknown key, a value outside its list, or a file that cannot be read is warned about once at the start of every command and the file is ignored; the line then says `(ignored: …)` with the reason. A broken file never stops a deploy.

## JSON

```json
{
  "config_path": "/home/you/my-app/coolship.toml",
  "config_root": "/home/you/my-app",
  "git_root": "/home/you/my-app",
  "target": "default",
  "app_root": "/home/you/my-app",
  "binding": {
    "context": "home",
    "project": "Personal",
    "environment": "production",
    "application": "fenix-bot",
    "root": "."
  },
  "credential_source": "file",
  "credential_path": "/home/you/.config/coolify/config.json",
  "instance": "home",
  "instance_url": "https://coolify.example.com",
  "overrides": { "context": "home" },
  "preferences": {
    "path": "/home/you/.config/coolship/preferences.toml",
    "present": true,
    "verbosity": "verbose",
    "build_logs": false
  }
}
```

`binding` is the selected table from `coolship.toml`, including any UUID pins and `dev` setting. `credential_source` is `file` when the Coolify CLI configuration supplies the credentials and reflects the environment pair when `COOLSHIP_URL` and `COOLSHIP_TOKEN` do; `git_root`, `credential_path`, `instance`, `instance_url`, `overrides`, and `warnings` are omitted when empty. `preferences` carries `path`, `present`, the keys the file sets (`verbosity`, `build_logs`, `color`; an absent key is omitted), and `error` with the reason when a present file is ignored.

## Exit codes

`0` when the configuration could be resolved; `2` when the directory is not linked, the file is invalid, the target is ambiguous, or the credentials cannot be selected.
