Skip to content

dhan config

Manage non-secret preferences stored at %AppData%\dhan-cli\config.json (or ~/.config/dhan-cli/config.json on macOS/Linux). Never store secrets here.

Terminal window
dhan config set <key> <value> --json --no-color
dhan config get [key] --json --no-color

config get with no key dumps all preferences.

Key Default Purpose
baseUrl https://api.dhan.co/v2/ Override the trading API base URL. Use only for controlled testing.
authBaseUrl https://auth.dhan.co/ Override the auth base URL.
redirectPort 17890 Loopback callback port for auth login / auth partner-login.
Terminal window
dhan config set redirectPort 17890 --json --no-color
dhan config set baseUrl https://api.dhan.co/v2/ --json --no-color
dhan config get baseUrl --json --no-color
dhan config get --json --no-color