A background tool that watches a directory and automatically organizes files according to the Johnny Decimal system.
- Watches a directory tree for new files.
- Moves files into the correct Johnny Decimal folders based on filename.
- Fully configurable via command line arguments, environment variables, or an optional YAML config file (
.jd.yamlby default). - Exclusion patterns and dry-run mode supported.
- Runs as a daemon or in the foreground (configurable).
You can run the daemon with just command line flags or environment variables. A config is not required.
jdd --root ~/Documents --log-level debug --dry-runexport JDD_ROOT=~/Documents
export JDD_LOG_LEVEL=info
jddCreate a config file (e.g., .jd.yaml):
root: "." # Directory to watch (relative to config file location)
log_level: "info" # Log level: debug, info, warn, error
exclude:
- ".git/**"
- "tmp/**"
dry_run: false # If true, no files will be moved
daemonize: false # Run in foreground (set to true to daemonize)
delay: 1s # Duration to wait before processing new filesThen run:
jdd --config .jd.yamlOr let it pick up the default .jd.yaml in the current directory.
If you use Nix, you can install JDD with:
nix-shell -p jddOr add it to your environment:
nix-env -iA nixpkgs.jddIf you have Go 1.17+ installed, you can install JDD directly from the command line:
go install github.com/mahyarmirrashed/jdd@latestYou can also download pre-built binaries from the GitHub Releases page.
- The config file is optional—all settings can be provided via CLI flags or environment variables.
- By default, the daemon watches the directory specified in
root, resolved relative to the config file’s location (if used), or as given by the flag/env. - Exclude patterns use glob syntax.
- Log output goes to
jdd.logif daemonized, otherwise to stdout.