# CLI commands

Every command and flag the CLI has today. Commands that take an app use the one in the current folder when you leave it out.

Install it with `curl -fsSL https://dukoi.com/install | sh` on macOS and Linux, or `irm https://dukoi.com/install.ps1 | iex` in PowerShell on Windows. Run the same line again to update.

## Pairing

- `pair`: Find a phone on this Wi-Fi and link it to this computer. `--host 192.168.0.112` skips the search, `--name kitchen` names it.
- `devices`: List paired phones. The dot marks the last one used.
- `unpair [phone]`: Forget a phone, and ask it to forget this computer.

## Apps

- `deploy [folder]`: Ship an app to the phone. The folder defaults to this one. `--name` sets the app’s name, `--no-health-check` is for apps that open no port.
- `start [app]`: Start an app.
- `stop [app]`: Stop an app. It stays stopped after a reboot.
- `restart [app]`: Restart an app.
- `releases [app]`: List the last 5 releases.
- `rollback [app]`: Go back to the previous release. `--to 0002` picks another.
- `remove [app]`: Delete an app with its releases, data and logs. Asks first; `--yes` skips that.
- `expose [app]`: Give an app a public HTTPS URL. `--domain api.example.com` uses your domain, `--off` removes it.

## Watching

- `ps`: Every app: status, CPU, memory, uptime, restarts and URL.
- `logs [app]`: The last 100 lines, then live. `--lines 500` for more, `--no-follow` to print and exit.
- `status`: Phone health: memory, storage, load, uptime and address.
- `dashboard`: Open the web dashboard on this computer. `--no-open` skips the browser.

## Options for every command

- `--device <name>`: Which phone. Defaults to the last one used.
- `--json`: One JSON object on stdout, for scripts and AI agents.
- `--help, -h`: Show help.
- `--version, -v`: Show the version.

## Exit codes and errors

`0` means it worked, `1` means the command failed and `2` means it was typed wrong. With `--json`, errors come back as `{ "ok": false, "error": { "code", "message", "hint" } }`, and the codes don’t change between versions.
