LocalDNS.wtf
CLI Reference

CLI Overview

Complete command-line reference for the localdns CLI tool.

CLI Reference

The localdns CLI is the primary interface for managing your local development domains. All commands follow the pattern:

localdns <command> [arguments] [options]

Command Groups

Domain Management

add, remove, list, open - Add, remove, and manage domain mappings.

Daemon Control

start, stop, status, ensure, install - Control the LocalDNS daemon.

Service Management

service set, service restart-policy, service type, service depends, service health, service list - Manage startup policies, dependencies, and health checks.

Power Management

mode, sleep, wake, suspend, power, stats, optimize, migrate - Control run modes, dormancy, and resource usage.

Project Discovery

provision, index, search - Auto-detect projects and manage the project index.

Diagnostics

doctor, debug, ports, config - System health checks, debugging, and configuration.

Quick Reference

# Add a domain
localdns add myapp.local --cmd "npm start"

# List all domains
localdns list --json

# Check status
localdns status

# Run diagnostics
localdns doctor --fix

# Auto-provision current project
localdns provision

Tips for Automation

  1. Always use --json flag for machine-parseable output
  2. Use localdns provision to auto-detect and register projects
  3. Use localdns doctor --fix to auto-repair common issues
  4. Ports 7100-7899 are the safe auto-assign range
  5. The REST API at localhost:1111 can be used directly for more control