ok - CLI (v0.1.0 - alpha)
ok - a super CLI with super powers
Installation
macOS options:
-
Go toolchain (requires Go 1.22+):
go install github.com/antick/ok@main
Ensure your $GOPATH/bin (usually $HOME/go/bin) is on PATH:
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
ok binary 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
Usage
Get an overview and examples:
ok help
Common 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>
Kill processes on a port (macOS)
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 kill
Behavior:
- Shows a table of processes (COMMAND, USER, PID, NAME) using the port.
- Prompts:
Proceed to kill them? [Y/n]: Enter defaults to Yes.
- Uses
SIGKILL to 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.
Config
It creates ~/.ok/config.yaml file to set preferred defaults.
Update
License
GNU General Public License v3.0