@plentidev/cli-linux-x64 0.0.8

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 ADDED
@@ -0,0 +1,228 @@
1
+ # Plenti CLI
2
+
3
+ CLI for managing internal Plenti utilities.
4
+
5
+ ## Installation
6
+
7
+ The repository is private, but the CLI binary is published on npm.
8
+
9
+ Install it globally:
10
+
11
+ ```bash
12
+ npm install -g @plenti/cli
13
+ ```
14
+
15
+ You can also install a specific version:
16
+
17
+ ```bash
18
+ npm install -g @plenti/cli@0.0.1
19
+ ```
20
+
21
+ The npm package only ships the prebuilt binaries and a small launcher that selects the correct binary for the current platform.
22
+
23
+ ### Manual binary installation
24
+
25
+ If you prefer, you can still manually download the correct binary from the corresponding GitHub Release.
26
+
27
+ ### macOS / Linux / WSL
28
+
29
+ Download the correct file for your platform:
30
+
31
+ - `plenti-<version>-darwin-arm64.tar.gz`
32
+ - `plenti-<version>-darwin-x64.tar.gz`
33
+ - `plenti-<version>-linux-arm64.tar.gz`
34
+ - `plenti-<version>-linux-x64.tar.gz`
35
+ - `plenti-<version>-linux-arm64-musl.tar.gz`
36
+ - `plenti-<version>-linux-x64-musl.tar.gz`
37
+
38
+ Then install the binary:
39
+
40
+ ```bash
41
+ tar -xzf plenti-0.0.1-linux-x64.tar.gz
42
+ chmod +x plenti-linux-x64
43
+ mkdir -p ~/.local/bin
44
+ mv plenti-linux-x64 ~/.local/bin/plenti
45
+ ```
46
+
47
+ If `~/.local/bin` is not in your `PATH`, add this to `~/.zshrc` or `~/.bashrc`:
48
+
49
+ ```bash
50
+ export PATH="$HOME/.local/bin:$PATH"
51
+ ```
52
+
53
+ Verify the installation:
54
+
55
+ ```bash
56
+ plenti --help
57
+ ```
58
+
59
+ Update the installed binary:
60
+
61
+ ```bash
62
+ plenti self-update
63
+ ```
64
+
65
+ ## Requirements
66
+
67
+ You only need [Bun](https://bun.sh) to develop and build the project. End users of the distributed binary do not need Bun.
68
+
69
+ For `plenti self-update`, the machine must also have GitHub access to the private repository. The command supports:
70
+
71
+ - `GITHUB_TOKEN`
72
+ - `GH_TOKEN`
73
+ - authenticated GitHub CLI via `gh auth login`
74
+
75
+ **IMPORTANT**: Installing AWS CLI is required to use the package, including the distributed binary.
76
+
77
+ ```bash
78
+ # Ubuntu/Debian/WSL
79
+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
80
+ unzip awscliv2.zip
81
+ sudo ./aws/install
82
+
83
+ # macOS
84
+ brew install awscli
85
+
86
+ # Verify installation
87
+ aws --version # Should show AWS CLI 2.x
88
+ ```
89
+
90
+ ## Configure AWS SSO
91
+
92
+ After installing AWS CLI, configure SSO access. This is also required when a command needs to authenticate against AWS:
93
+
94
+ ```bash
95
+ aws configure sso --profile dev
96
+ aws configure sso --profile prod
97
+ ```
98
+
99
+ Base configuration required for both profiles:
100
+
101
+ ```txt
102
+ SSO session name (Recommended): plenti
103
+ SSO start URL: https://somosplenti.awsapps.com/start/
104
+ SSO region: us-east-1
105
+ SSO registration scopes: sso:account:access
106
+ CLI default client Region: us-east-1
107
+ CLI default output format: json
108
+ ```
109
+
110
+ Choose the `dev` account in the first command and the `prod` account in the second.
111
+
112
+ The CLI resolves the AWS profile in this order:
113
+
114
+ 1. `--profile dev|prod`
115
+ 2. `PLENTI_AWS_PROFILE`
116
+ 3. `AWS_PROFILE`
117
+
118
+ If `AWS_REGION` or `AWS_DEFAULT_REGION` is not defined, the CLI uses `sa-east-1` by default.
119
+
120
+ ## Development
121
+
122
+ Install dependencies:
123
+
124
+ ```bash
125
+ bun install
126
+ ```
127
+
128
+ Build the binaries:
129
+
130
+ ```bash
131
+ bun run build
132
+ ```
133
+
134
+ Package release-ready assets:
135
+
136
+ ```bash
137
+ bun run build:release
138
+ ```
139
+
140
+ ## Publishing
141
+
142
+ The repository includes a GitHub Actions workflow at `.github/workflows/release.yml` that publishes the npm package automatically when you push a `v*` tag.
143
+
144
+ Flow:
145
+
146
+ ```bash
147
+ bun run typecheck
148
+ git tag v0.0.1
149
+ git push origin v0.0.1
150
+ ```
151
+
152
+ The workflow validates that the tag matches `package.json`, builds the binaries, and publishes `@plenti/cli` to npm.
153
+
154
+ ## Usage
155
+
156
+ Once the binary is installed, use it directly with `plenti`.
157
+
158
+ To pull variables, the repository where you run the command must contain an `env.ssm.ts` file at the project root.
159
+
160
+ That file must export an `SSM_MAPPING` object where:
161
+
162
+ - the key is the environment variable name that will be written to `.env`
163
+ - the value is the AWS SSM parameter name or path
164
+
165
+ Example:
166
+
167
+ ```ts
168
+ export const SSM_MAPPING = {
169
+ DATABASE_URL: '/project/support-portal/DATABASE_URL',
170
+ BACKEND_API_URL: '/project/support-portal/BACKEND_API_URL',
171
+ BACKEND_API_KEY: '/project/support-portal/BACKEND_API_KEY',
172
+ SESSION_SECRET: '/project/support-portal/SESSION_SECRET',
173
+ };
174
+ ```
175
+
176
+ When you run `plenti env pull`, the CLI:
177
+
178
+ 1. reads `env.ssm.ts`
179
+ 2. downloads those parameters from AWS SSM
180
+ 3. generates a `.env` file at the project root
181
+
182
+ Example generated `.env`:
183
+
184
+ ```dotenv
185
+ DATABASE_URL=postgres://...
186
+ BACKEND_API_URL=https://api.example.com
187
+ BACKEND_API_KEY=...
188
+ SESSION_SECRET=...
189
+ ```
190
+
191
+ Show help:
192
+
193
+ ```bash
194
+ plenti --help
195
+ ```
196
+
197
+ Update the installed binary to the latest version:
198
+
199
+ ```bash
200
+ plenti self-update
201
+ ```
202
+
203
+ Update to a specific version:
204
+
205
+ ```bash
206
+ plenti self-update --version 0.0.1
207
+ ```
208
+
209
+ Download environment variables from AWS SSM using `env.ssm.ts`:
210
+
211
+ ```bash
212
+ plenti env pull --profile dev
213
+ ```
214
+
215
+ You can also use `prod`:
216
+
217
+ ```bash
218
+ plenti env pull --profile prod
219
+ ```
220
+
221
+ ## Local Usage
222
+
223
+ If you have not installed the binary yet and you are testing locally from the project, you can run the CLI directly with Bun:
224
+
225
+ ```bash
226
+ bun bin/index.ts --help
227
+ bun bin/index.ts env pull --profile dev
228
+ ```
Binary file
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@plentidev/cli-linux-x64",
3
+ "version": "0.0.8",
4
+ "description": "Official Plenti CLI (plenti-linux-x64)",
5
+ "os": [
6
+ "linux"
7
+ ],
8
+ "cpu": [
9
+ "x64"
10
+ ],
11
+ "libc": [
12
+ "glibc"
13
+ ],
14
+ "files": [
15
+ "bin"
16
+ ],
17
+ "publishConfig": {
18
+ "access": "public"
19
+ }
20
+ }