Skip to main content

Synopsis

Display the current effective configuration after merging user config, project config, and environment variables.

Usage

watercooler config show [options]

Options

--project-path
string
Project directory for config discovery. Defaults to current directory.
--json
boolean
Output configuration as JSON instead of TOML
--sources
boolean
Show config source files and their priority order instead of values

Examples

Show current configuration

watercooler config show
Output:
# Watercooler Configuration (resolved)

[paths]
threads_dir = "./watercooler"
code_root = "."

[agents]
default_agent = "Team"
default_role = "implementer"

[mcp]
transport = "stdio"
port = 3000

[validation]
fail_on_violation = false
strict_mode = false

Show configuration as JSON

watercooler config show --json
Output:
{
  "paths": {
    "threads_dir": "./watercooler",
    "code_root": "."
  },
  "agents": {
    "default_agent": "Team",
    "default_role": "implementer"
  },
  "mcp": {
    "transport": "stdio",
    "port": 3000
  },
  "validation": {
    "fail_on_violation": false,
    "strict_mode": false
  }
}

Show config sources

watercooler config show --sources
Output:
Config sources (in priority order):

  ✓ project: /path/to/project/.watercooler/config.toml
  ✓ user: /home/username/.watercooler/config.toml
  ✗ system: /etc/watercooler/config.toml (not found)

Environment variables override all file configs.

Show config for specific project

watercooler config show --project-path ~/projects/myapp

Pipe to file

watercooler config show --json > current-config.json

Configuration Resolution

Settings are merged in this priority order (highest first):
  1. Environment variables
    • WATERCOOLER_DIR
    • WATERCOOLER_MCP_PORT
    • WATERCOOLER_TRANSPORT
    • etc.
  2. Project config
    • .watercooler/config.toml in project root
  3. User config
    • ~/.watercooler/config.toml
  4. Built-in defaults

Output Formats

TOML (default)

  • Human-readable
  • Matches source file format
  • Includes comments
  • Suitable for copying sections

JSON (--json)

  • Machine-readable
  • No comments
  • Easier to parse programmatically
  • Useful for scripts and integrations

Sources (--sources)

  • Shows which config files exist
  • Displays file paths
  • Indicates priority order
  • Useful for debugging config issues

Common Use Cases

Verify configuration

# Check what settings are active
watercooler config show

Debug config issues

# See which files are being used
watercooler config show --sources

# Check specific setting
watercooler config show --json | jq '.paths.threads_dir'

Compare environments

# Development
watercooler config show --json > dev-config.json

# Production
watercooler config show --json --project-path /var/app > prod-config.json

# Compare
diff dev-config.json prod-config.json

Extract specific values

# Get threads directory
watercooler config show --json | jq -r '.paths.threads_dir'

# Get MCP port
watercooler config show --json | jq -r '.mcp.port'

Generate documentation

# Export current config for team
watercooler config show > docs/watercooler-config.toml

Environment Variable Overrides

Environment variables take highest priority:
# Override threads directory
export WATERCOOLER_DIR=/custom/threads
watercooler config show
# Will show threads_dir = "/custom/threads"

# Override MCP port
export WATERCOOLER_MCP_PORT=8080
watercooler config show --json | jq '.mcp.port'
# Output: 8080

Error Handling

Config error

watercooler config show
Output:
❌ Config error: Invalid port number in /home/user/.watercooler/config.toml
Solution: Fix the error in the config file or use watercooler config validate for details.

No config files found

If no config files exist, shows built-in defaults:
# Watercooler Configuration (resolved)
# Using built-in defaults - no config files found

[paths]
threads_dir = "./watercooler"
# ...

Integration Examples

Shell script

#!/bin/bash
THREADS_DIR=$(watercooler config show --json | jq -r '.paths.threads_dir')
echo "Threads directory: $THREADS_DIR"

Python script

import json
import subprocess

result = subprocess.run(
    ["watercooler", "config", "show", "--json"],
    capture_output=True,
    text=True
)
config = json.loads(result.stdout)
print(f"Threads dir: {config['paths']['threads_dir']}")

Build docs developers (and LLMs) love