Value Formats
This page explains how dmd parses values.
Use it when you need to know:
- what shape a CLI flag expects
- what shape
dmd profile add --set key=valueaccepts - what you can write by hand in a profile inside
config.json - how profile commands normalize stored values
Time Deltas
Section titled “Time Deltas”Time deltas are used by:
--keep-within--fetch-within- profile fields
keep_withinandfetch_within
For cleanup runs, these values are relative durations measured backwards from the time the command runs.
For example, --keep-within 2w means “keep items newer than two weeks before this run starts”, and --fetch-within 1d6h means “fetch items newer than 30 hours before this run starts”.
There are two supported styles.
Key/value style
Section titled “Key/value style”weeks=2,days=3,hours=1Rules:
- units must be unique
- negative values are not allowed
- unit names use full words:
weeks,days,hours,minutes,seconds
Common examples:
weeks=1days=14hours=12,minutes=30
Compact suffix style
Section titled “Compact suffix style”2w3d4h5m6sSupported suffixes:
| Suffix | Meaning |
|---|---|
w | weeks |
d | days |
h | hours |
m | minutes |
s | seconds |
Common examples:
1w14d12h30m2w3d
Both 0 and 0.0 are treated as zero duration.
Booleans
Section titled “Booleans”CLI boolean flags use normal flag syntax:
--dry-run--no-dry-run--preserve-cache--no-preserve-cacheProfile --set values and hand-written profile config entries accept:
truefalseWhen profile commands rewrite the profile, booleans are stored as JSON booleans:
{ "dry_run": true}Nullable Values
Section titled “Nullable Values”Some CLI options can be reset to unlimited/no value:
dmd clean --profile nightly-dms --fetch-within nonedmd clean --profile nightly-dms --max-messages noneFor profile updates, none is an operation:
dmd profile update nightly-dms --set fetch_within=nonedmd profile update nightly-dms --set max_messages=noneThat removes the stored field from the profile.
Do not store null in profile config. If a profile should not set a value, omit the field.
String Lists
Section titled “String Lists”String lists are used by profile fields such as:
include_idsexclude_ids
Profile --set accepts:
--set include_ids=123,456--set include_ids="123 456"--set include_ids='["123","456"]'For include_ids and exclude_ids, values may be full Discord IDs or unique ID suffixes when set through dmd profile add or dmd profile update.
Profile commands resolve them through Discord before writing config, and store full IDs.
Hand-written profile config accepts the same list shapes:
{ "include_ids": ["123", "456"]}When profile commands rewrite the profile, string lists are stored as JSON arrays.
Number Ranges
Section titled “Number Ranges”Number ranges are used by:
retry_time_bufferfetch_sleep_timedelete_sleep_time
They accept one or two numbers.
Profile --set accepts:
--set retry_time_buffer=25--set retry_time_buffer=25,35--set retry_time_buffer="25 35"--set retry_time_buffer='[25,35]'Hand-written profile config accepts the same input shapes.
When profile commands rewrite the profile, number ranges are stored as JSON arrays:
{ "retry_time_buffer": [25.0, 35.0]}Redaction Values
Section titled “Redaction Values”The normal CLI flag uses space-separated values:
--redact-sensitive--redact-sensitive 4--redact-sensitive 0 4--redact-sensitive 4 4-r 4Profile --set and hand-written profile config accept:
--set redact_sensitive=true--set redact_sensitive=false--set redact_sensitive=4--set redact_sensitive=0,4--set redact_sensitive="0 4"--set redact_sensitive='[0,4]'--set redact_names=falseWhen profile commands rewrite the profile:
trueandfalseare stored as JSON booleans- suffix-only windows are stored as one-item JSON arrays, for example
[4] - prefix/suffix windows are stored as two-item JSON arrays, for example
[0, 4]
Profile Config Normalization
Section titled “Profile Config Normalization”Profile config has two concepts:
- accepted input shape: what the parser accepts
- stored shape: what
dmd profile addanddmd profile updatewrite back
The parser is intentionally flexible for hand-written config, but profile commands prefer canonical JSON.
Normalization rules:
- time deltas are validated and kept as the string you provided, for example
"2w"or"days=3" - lists and ranges are normalized to JSON arrays, for example
"123,456"becomes["123", "456"] - booleans and integers are normalized to JSON booleans and numbers
noneis only a profile-update operation, not a stored config valuenullis not supported in profiles
Prefer the canonical JSON shape when editing config by hand.