Skip to content

Authentication

The CLI authenticates with Discord through your user token.

The simplest path is to store the token once in your system keyring:

Terminal window
dmd login

dmd login validates the token before storing it. Use dmd login --replace when you want to replace the stored token.

You can also use a token from the environment:

Terminal window
export DISCORD_TOKEN=<your_token>

Or override it for a single command:

Terminal window
dmd clean --token <your_token> --include-ids <id> --dry-run

The active token can be checked with:

Terminal window
dmd whoami

You can use this external guide to obtain your Discord token:

  • Keep the token private. Anyone with the token can act as your Discord user.
  • Prefer dmd login or a session-local environment variable instead of hardcoding it in scripts.
  • dmd logout removes the stored keyring token.
  • On headless systems without a usable keyring, use DISCORD_TOKEN or pass --token to the command you are running.
  • Be aware that using automated tooling on Discord may violate Discord’s Terms of Service.

Continue with First Run to validate your filters and retention settings safely in --dry-run.