Authentication
The CLI authenticates with Discord through your user token.
The simplest path is to store the token once in your system keyring:
dmd logindmd 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:
export DISCORD_TOKEN=<your_token>Or override it for a single command:
dmd clean --token <your_token> --include-ids <id> --dry-runThe active token can be checked with:
dmd whoamiFinding your token
Section titled “Finding your token”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 loginor a session-local environment variable instead of hardcoding it in scripts. dmd logoutremoves the stored keyring token.- On headless systems without a usable keyring, use
DISCORD_TOKENor pass--tokento the command you are running. - Be aware that using automated tooling on Discord may violate Discord’s Terms of Service.
Next step
Section titled “Next step”Continue with First Run to validate your filters and retention settings safely in --dry-run.