Skip to content

Agent Commands

The katachi CLI manages the agent daemon running on your machine. Here’s every command you need to know.

Start the agent daemon. On first run, guides you through device-flow authentication.

Terminal window
katachi start # Start with defaults
katachi start --port 3001 # Custom port
katachi start --debug # Enable debug logging
katachi start --home ~/my-dir # Custom data directory

The agent runs as a background process via PM2, so it survives terminal closures.

Stop the agent daemon.

Terminal window
katachi stop

This also disconnects the Cloudflare tunnel.

Restart the agent daemon. Preserves the current port configuration.

Terminal window
katachi restart

Check if the agent is running and view tunnel information.

Terminal window
katachi status

Output includes PID, port, memory usage, uptime, and tunnel URL.

View agent logs.

Terminal window
katachi logs # Show recent logs
katachi logs -f # Follow logs in real-time (tail -f)
katachi logs -n 50 # Show last 50 lines

Display version information.

Terminal window
katachi version

Deregister the agent from Katachi servers and remove local credentials.

Terminal window
katachi unregister # Normal: deregister from backend first
katachi unregister --force # Force: remove local credentials even if backend is unreachable
katachi unregister -y # Skip confirmation prompt