Documentation
CLI/watch

renamed watch

Monitor folders for new files and process them automatically. Production-ready with health checks, retry handling, and graceful shutdown.

Try it instantly — no install needed:

$ npx @renamed-to/cli watch ~/Downloads --output-dir ~/Organized
renamed watch <directory> [options]

The watch command runs as a long-lived process that monitors directories for new files. When files appear, they're queued and processed with AI renaming, then optionally moved to organized output folders.

Designed for production environments with concurrent workers, exponential retry backoff, and Unix socket health monitoring.

Examples

Watch Downloads and organize to ~/Organized:

$ renamed watch ~/Downloads --output-dir ~/Organized --apply

Watch PDFs only with 4 concurrent workers:

$ renamed watch ~/Documents -p "*.pdf" --concurrency 4

Production mode with JSON logs:

$ renamed watch /data/incoming --apply --log-format json

Options

-o, --output-dir <path>

Move processed files here. AI organizes into subfolders.

-p, --patterns <globs>

Only watch files matching patterns (e.g., "*.pdf *.jpg *.png"). Default: *.pdf *.jpg *.png

-f, --failed-dir <path>

Move files that fail processing here instead of leaving them in place.

-n, --dry-run

Preview mode. See what would happen without processing files.

--concurrency <n>

Parallel workers (1-10). Default: 2.

-c, --config <path>

Path to YAML configuration file.

--log-format <type>

Output format: text, json. Use json for log aggregation.

Production Features

Concurrent workers — Process multiple files in parallel. Configurable from 1-10 based on your hardware.

Retry with backoff — Failed files retry automatically with exponential delays (5s → 10s → 20s).

Graceful shutdown — SIGTERM/SIGINT drains the queue. No files left half-processed.

Health monitoring — Unix socket endpoint for integration with monitoring tools.

Health Check

Query the health endpoint:

$ curl --unix-socket /tmp/renamed.sock http://localhost/health

{
 "status": "healthy",
 "uptime": 847293,
 "queue": {"pending": 3, "processing": 2}
}

Configuration File

For complex setups, use YAML config:

~/.config/renamed/config.yaml
watch:
 patterns: ["*.pdf", "*.jpg", "*.png"]

rateLimit:
 concurrency: 4
 retryAttempts: 3

health:
 enabled: true
 socketPath: /tmp/renamed.sock

See Also