ok - a super CLI with super powers
macOS options:
-
Go toolchain (requires Go 1.22+):
go install github.com/antick/ok@main
Ensure your
$GOPATH/bin(usually$HOME/go/bin) is onPATH:echo 'export PATH="$HOME/go/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
-
Local build:
git clone https://github.com/antick/ok.git cd ok go build -o ok . ./ok help
-
From GitHub Releases (when available):
- Download the latest
okbinary for macOS (arm64 or amd64) from the Releases page. - Make it executable and place it on your PATH:
chmod +x ok && mv ok /usr/local/bin/ok
- Download the latest
Get an overview and examples:
ok helpCommon commands:
ok copy <source> [to] <destination>
ok build <input_file> [as/to] <output_file>
ok move <source> [to] <destination>
ok remove <file_or_directory> [--permanent|-p]
ok docker
ok kill [--port] <port>Find and kill processes listening on a TCP port. This uses lsof under the hood (equivalent to lsof -iTCP:<port> -sTCP:LISTEN), shows the list of matching processes, and asks for confirmation before killing with SIGKILL (-9).
Examples:
# Find what is using port 3000 and kill after confirmation
ok kill --port 3000
# You can also specify the port as a positional argument
ok kill 3000
# If you omit the port, the help menu is shown
ok killBehavior:
- Shows a table of processes (COMMAND, USER, PID, NAME) using the port.
- Prompts:
Proceed to kill them? [Y/n]:Enter defaults to Yes. - Uses
SIGKILLto ensure processes exit. - If nothing is listening, it prints a friendly message.
Notes:
- Requires
lsof(available by default on macOS). - You may need elevated privileges to kill some processes.
It creates ~/.ok/config.yaml file to set preferred defaults.
- If installed via Go:
This fetches and installs the latest version from main branch.
go install github.com/antick/ok@main
- If installed from GitHub Releases: re-download the latest binary and replace the existing
/usr/local/bin/ok.
GNU General Public License v3.0