@kubernetesjs/cli
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

@kubernetesjs/cli


TypeScript CLI for Kubernetes

A command-line interface for interacting with Kubernetes clusters, built with TypeScript.

Installation

npm install -g @kubernetesjs/cli

Usage

The CLI provides several commands for managing Kubernetes resources. You can use either k8s or kubernetes as the command prefix:

k8s <command> [options]
# or
kubernetes <command> [options]

Options:

Available Commands

Get

Retrieve information about Kubernetes resources.

k8s get <resource> [options]

Apply

Apply configurations to your Kubernetes cluster.

k8s apply -f <file> [options]

Delete

Delete resources from your Kubernetes cluster.

k8s delete <resource> <name> [options]

Describe

Show detailed information about a specific resource.

k8s describe <resource> <name> [options]

Logs

View logs from pods.

k8s logs <pod-name> [options]

Port Forward

Forward ports from pods to your local machine.

k8s port-forward <pod-name> <local-port>:<pod-port> [options]

Exec

Execute commands in a container.

k8s exec <pod-name> -- <command> [options]

Cluster Info

Display information about the current cluster.

k8s cluster-info

Config

Manage Kubernetes configuration.

k8s config [options]

Examples

Get Pod Information

k8s get pods

Apply a Configuration File

k8s apply -f deployment.yaml

View Pod Logs

k8s logs my-pod

Port Forward to a Service

k8s port-forward my-pod 8080:80

Configuration

The CLI uses the default Kubernetes configuration from ~/.kube/config. You can specify a different configuration file using the --kubeconfig option.

Development

When first cloning the repo:

yarn
# Build the production packages
yarn build

For development with source maps:

yarn
# Build with source maps for better debugging
yarn build:dev

Related

Checkout these related projects:

  • schema-typescript
    Provides robust tools for handling JSON schemas and converting them to TypeScript interfaces with ease and efficiency.
  • @schema-typescript/cli
    CLI is the command line utility for schema-typescript.
  • schema-sdk
    Provides robust tools for handling OpenAPI schemas and converting them to TypeScript clients with ease and efficiency.
  • starship Unified Testing and Development for the Interchain.

Credits

🛠 Built by Hyperweb — if you like our tools, please checkout and contribute to our github ⚛️

Disclaimer

AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.

No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.

Package Sidebar

Install

npm i @kubernetesjs/cli

Weekly Downloads

104

Version

0.2.2

License

SEE LICENSE IN LICENSE

Unpacked Size

147 kB

Total Files

51

Last publish

Collaborators

  • anmol1696
  • pyramation