1.0.0 • Published 7 months ago

@conectate/cli v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

ct-cli

CLI for managing common aliases and functions, based on specific zsh configurations.

Features

Provides the following commands:

  • ct ka [file] [...options]: Alias for kubectl apply -f [file] [...options]
  • ct k [...args]: Alias for kubectl [...args]
  • ct killports <port-or-range>: Kills processes on a port range (e.g., 4000-4010).
  • ct completion <shell>: Generates shell completion script (bash or zsh).

Installation

  1. Clone the repository (or navigate to the directory if already created).
  2. Install dependencies:
    pnpm install
  3. Build the project:
    pnpm build
  4. Link the binary globally (or use it directly via node dist/index.js or ./dist/index.js after making it executable):
    pnpm link --global
    This makes the ct command available in your terminal.

Important: After installation, configure shell autocompletion for a better experience. See the Autocompletion Setup section below.

Usage

# Examples
ct k get pods
ct ka my-deployment.yaml
ct killports 4000
ct killports 4000-4010


# Get help
ct --help
ct k --help

Autocompletion Setup

Bash:

Add the following to your ~/.bashrc or ~/.bash_profile:

# ct completion
eval "$(ct completion bash)"

Zsh:

Add the following to your ~/.zshrc:

# ct completion
autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
eval "$(ct completion zsh)"
# Note: The generated script might need adjustments for optimal zsh completion.
# Consider using commander's native zsh completion features if needed.

Remember to restart your shell or source your configuration file (source ~/.bashrc or source ~/.zshrc) after adding the completion setup.

Development

Run in watch mode:

pnpm dev
1.0.0

7 months ago