Install and Quick Start
Install
Linux and macOS use the shell installer:
curl -fsSL https://knot.clay.li/i/install.sh | shWindows uses the PowerShell installer:
irm https://knot.clay.li/i/install.ps1 | iexBuild from source:
go build -o knot ./cmd/knot
mkdir -p ~/.local/bin
mv knot ~/.local/bin/Recommended: Enable Shell Completion
Enable completion right after installation. Knot completion covers commands, subcommands, server aliases, and some arguments. Without it, daily SSH, SFTP, copy, and forwarding workflows are noticeably slower.
Bash
Enable it for the current shell:
source <(knot completion bash)Enable it persistently:
mkdir -p ~/.local/share/bash-completion/completions
knot completion bash > ~/.local/share/bash-completion/completions/knotZsh
Enable it for the current shell:
autoload -U compinit && compinit
source <(knot completion zsh)Enable it persistently:
mkdir -p ~/.zfunc
knot completion zsh > ~/.zfunc/_knot
printf '\nfpath=(~/.zfunc $fpath)\nautoload -U compinit\ncompinit\n' >> ~/.zshrcFish
Enable it for the current shell:
knot completion fish | sourceEnable it persistently:
mkdir -p ~/.config/fish/completions
knot completion fish > ~/.config/fish/completions/knot.fishPowerShell
Enable it for the current shell:
knot completion powershell | Out-String | Invoke-ExpressionEnable it persistently:
New-Item -Type File -Path $PROFILE -Force
Add-Content -Path $PROFILE -Value 'knot completion powershell | Out-String | Invoke-Expression'See Shell Completion and Version for the command reference.
Create Your First Server
The most common non-interactive form:
knot add web-prod --host 1.2.3.4 --user deploy --key deploy-key --tags prodIf you do not provide the full set of parameters, knot add starts a guided prompt:
knot add web-prodConnect
The full command is:
knot ssh web-prodThe root command rewrites an unknown first argument into an SSH connection, so day to day you can write:
knot web-prodThis shortcut belongs to knot ssh [alias]; it is not documented as a separate command.
Remote Exec
knot exec web-prod "uptime"
knot exec web-prod "systemctl status nginx" --jsonknot exec preserves the remote command exit code, which makes it suitable for scripts and automation.
File Transfer
knot cp ./dist/. web-prod:/var/www/html/
knot cp web-prod:/var/log/nginx/access.log ./Remote paths use the alias:/path form. When the source directory ends with /., Knot copies the directory contents.
Common Global Flags
| Flag | Default | Description |
|---|---|---|
--json | false | Output JSON for scripts and automation. |
--host-key-policy | empty | Host key policy: fail, accept-new, strict, or insecure-skip. |
-h, --help | false | Show help for the current command. |