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 provisionTips for Automation
- Always use
--jsonflag for machine-parseable output - Use
localdns provisionto auto-detect and register projects - Use
localdns doctor --fixto auto-repair common issues - Ports 7100-7899 are the safe auto-assign range
- The REST API at
localhost:1111can be used directly for more control