@kubernetesjs/cli 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -30
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,61 +1,168 @@
|
|
|
1
1
|
# @kubernetesjs/cli
|
|
2
2
|
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://
|
|
5
|
-
|
|
3
|
+
<p align="center" width="100%">
|
|
4
|
+
<img src="https://github.com/hyperweb-io/interweb-utils/assets/545047/89c743c4-be88-409f-9a77-4b02cd7fe9a4" width="80">
|
|
5
|
+
<br/>
|
|
6
|
+
TypeScript CLI for Kubernetes
|
|
7
|
+
<br />
|
|
8
|
+
<a href="https://github.com/hyperweb-io/kubernetesjs/actions/workflows/ci.yml">
|
|
9
|
+
<img height="20" src="https://github.com/hyperweb-io/kubernetesjs/actions/workflows/ci.yml/badge.svg"/>
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://github.com/hyperweb-io/kubernetesjs/blob/main/LICENSE">
|
|
12
|
+
<img height="20" src="https://img.shields.io/badge/license-MIT-blue.svg"/>
|
|
13
|
+
</a>
|
|
6
14
|
</p>
|
|
7
15
|
|
|
8
|
-
|
|
16
|
+
A command-line interface for interacting with Kubernetes clusters, built with TypeScript.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install -g @kubernetesjs/cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
The CLI provides several commands for managing Kubernetes resources. You can use either `k8s` or `kubernetes` as the command prefix:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
k8s <command> [options]
|
|
30
|
+
# or
|
|
31
|
+
kubernetes <command> [options]
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Options:
|
|
35
|
+
- `--client-url`: Kubernetes API server URL (default: http://localhost:8001)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Available Commands
|
|
39
|
+
|
|
40
|
+
#### Get
|
|
41
|
+
Retrieve information about Kubernetes resources.
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
k8s get <resource> [options]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### Apply
|
|
48
|
+
Apply configurations to your Kubernetes cluster.
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
k8s apply -f <file> [options]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
#### Delete
|
|
55
|
+
Delete resources from your Kubernetes cluster.
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
k8s delete <resource> <name> [options]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
#### Describe
|
|
62
|
+
Show detailed information about a specific resource.
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
k8s describe <resource> <name> [options]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Logs
|
|
69
|
+
View logs from pods.
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
k8s logs <pod-name> [options]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### Port Forward
|
|
76
|
+
Forward ports from pods to your local machine.
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
k8s port-forward <pod-name> <local-port>:<pod-port> [options]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### Exec
|
|
83
|
+
Execute commands in a container.
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
k8s exec <pod-name> -- <command> [options]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### Cluster Info
|
|
90
|
+
Display information about the current cluster.
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
k8s cluster-info
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Config
|
|
97
|
+
Manage Kubernetes configuration.
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
k8s config [options]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Examples
|
|
104
|
+
|
|
105
|
+
### Get Pod Information
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
k8s get pods
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Apply a Configuration File
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
k8s apply -f deployment.yaml
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### View Pod Logs
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
k8s logs my-pod
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Port Forward to a Service
|
|
9
124
|
|
|
10
125
|
```sh
|
|
11
|
-
|
|
126
|
+
k8s port-forward my-pod 8080:80
|
|
12
127
|
```
|
|
13
|
-
## Table of contents
|
|
14
128
|
|
|
15
|
-
|
|
16
|
-
- [Install](#install)
|
|
17
|
-
- [Table of contents](#table-of-contents)
|
|
18
|
-
- [Developing](#developing)
|
|
19
|
-
- [Credits](#credits)
|
|
129
|
+
## Configuration
|
|
20
130
|
|
|
21
|
-
|
|
131
|
+
The CLI uses the default Kubernetes configuration from `~/.kube/config`. You can specify a different configuration file using the `--kubeconfig` option.
|
|
132
|
+
|
|
133
|
+
## Development
|
|
22
134
|
|
|
23
135
|
When first cloning the repo:
|
|
24
136
|
|
|
25
137
|
```sh
|
|
26
138
|
yarn
|
|
27
|
-
#
|
|
139
|
+
# Build the production packages
|
|
28
140
|
yarn build
|
|
29
141
|
```
|
|
30
142
|
|
|
31
|
-
|
|
143
|
+
For development with source maps:
|
|
32
144
|
|
|
33
145
|
```sh
|
|
34
146
|
yarn
|
|
35
|
-
#
|
|
147
|
+
# Build with source maps for better debugging
|
|
36
148
|
yarn build:dev
|
|
37
149
|
```
|
|
38
150
|
|
|
39
|
-
##
|
|
151
|
+
## Related
|
|
40
152
|
|
|
41
|
-
|
|
153
|
+
Checkout these related projects:
|
|
42
154
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| **UI Kits** | [**Interchain UI**](https://github.com/hyperweb-io/interchain-ui) | The Interchain Design System, empowering developers with a flexible, easy-to-use UI kit. |
|
|
51
|
-
| **Testing Frameworks** | [**Starship**](https://github.com/hyperweb-io/starship) | Unified Testing and Development for the Interchain. |
|
|
52
|
-
| **TypeScript Smart Contracts** | [**Create Hyperweb App**](https://github.com/hyperweb-io/create-hyperweb-app) | Build and deploy full-stack blockchain applications with TypeScript |
|
|
53
|
-
| **CosmWasm Contracts** | [**CosmWasm TS Codegen**](https://github.com/CosmWasm/ts-codegen) | Convert your CosmWasm smart contracts into dev-friendly TypeScript classes. |
|
|
155
|
+
* [`schema-typescript`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-typescript)
|
|
156
|
+
Provides robust tools for handling JSON schemas and converting them to TypeScript interfaces with ease and efficiency.
|
|
157
|
+
* [`@schema-typescript/cli`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/cli)
|
|
158
|
+
CLI is the command line utility for `schema-typescript`.
|
|
159
|
+
* [`schema-sdk`](https://github.com/hyperweb-io/schema-typescript/tree/main/packages/schema-sdk)
|
|
160
|
+
Provides robust tools for handling OpenAPI schemas and converting them to TypeScript clients with ease and efficiency.
|
|
161
|
+
* [`starship`](https://github.com/hyperweb-io/starship) Unified Testing and Development for the Interchain.
|
|
54
162
|
|
|
55
163
|
## Credits
|
|
56
164
|
|
|
57
|
-
🛠 Built by Hyperweb
|
|
58
|
-
|
|
165
|
+
🛠 Built by Hyperweb — if you like our tools, please checkout and contribute to [our github ⚛️](https://github.com/hyperweb-io)
|
|
59
166
|
|
|
60
167
|
## Disclaimer
|
|
61
168
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubernetesjs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "KubernetesJS CLI",
|
|
6
6
|
"main": "index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"deepmerge": "^4.3.1",
|
|
43
43
|
"inquirerer": "^2.0.8",
|
|
44
44
|
"js-yaml": "^4.1.0",
|
|
45
|
-
"kubernetesjs": "^0.5.
|
|
45
|
+
"kubernetesjs": "^0.5.2",
|
|
46
46
|
"minimist": "^1.2.8"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "2a067742f0591aecb0481f8cef4285400fa72926"
|
|
49
49
|
}
|