@penvhq/cli 0.16.2 → 1.0.0-alpha.3
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 +23 -0
- package/bin/penv.js +34 -0
- package/package.json +18 -46
- package/dist/bin.cjs +0 -58470
- package/dist/bin.cjs.map +0 -1
- package/dist/chunk-5UQEMWMW.js +0 -552
- package/dist/chunk-5UQEMWMW.js.map +0 -1
- package/dist/index.cjs +0 -7704
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1249
- package/dist/index.d.ts +0 -1249
- package/dist/index.js +0 -7356
- package/dist/index.js.map +0 -1
- package/dist/install.cjs +0 -587
- package/dist/install.cjs.map +0 -1
- package/dist/install.d.cts +0 -175
- package/dist/install.d.ts +0 -175
- package/dist/install.js +0 -31
- package/dist/install.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# @penvhq/cli
|
|
2
|
+
|
|
3
|
+
penv reads the `.env` you already have, writes a small committed schema next to it, validates every value before your process starts, generates types for your language, and configures your coding agent's harness so it cannot read the file.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm i -g @penvhq/cli
|
|
7
|
+
|
|
8
|
+
penv init # reads .env, writes .env.schema, gitignores .env
|
|
9
|
+
penv run -- npm run dev # validates, injects, masks
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This package is a launcher. The binary itself arrives in one of six platform packages (`@penvhq/cli-linux-x64`, `-linux-arm64`, `-darwin-x64`, `-darwin-arm64`, `-win32-x64`, `-win32-arm64`), and npm installs the one your machine matches.
|
|
13
|
+
|
|
14
|
+
`npm i -g @penvhq/cli` is how this install upgrades. `penv upgrade` refuses here, because the binary belongs to the package npm put it in.
|
|
15
|
+
|
|
16
|
+
Without Node, install the binary on its own:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
curl -fsSL https://penv.cloud/install | sh # macOS, Linux
|
|
20
|
+
irm https://penv.cloud/install.ps1 | iex # Windows
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Docs at [penv.cloud](https://penv.cloud). MIT.
|
package/bin/penv.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// npm installs one of the six @penvhq/cli-<platform> packages and skips the rest,
|
|
5
|
+
// so this shim runs whichever one landed. There is no postinstall step.
|
|
6
|
+
const { spawnSync } = require("node:child_process");
|
|
7
|
+
|
|
8
|
+
const pkg = `@penvhq/cli-${process.platform}-${process.arch}`;
|
|
9
|
+
const inside = `${pkg}/bin/penv${process.platform === "win32" ? ".exe" : ""}`;
|
|
10
|
+
|
|
11
|
+
let binary;
|
|
12
|
+
try {
|
|
13
|
+
binary = require.resolve(inside);
|
|
14
|
+
} catch {
|
|
15
|
+
process.stderr.write(
|
|
16
|
+
`penv: ${pkg} is missing, and npm skips an optional dependency it could not install without saying so. ` +
|
|
17
|
+
`Reinstall with npm i -g @penvhq/cli, or install without npm: curl -fsSL https://penv.cloud/install | sh, ` +
|
|
18
|
+
`or on Windows irm https://penv.cloud/install.ps1 | iex\n`,
|
|
19
|
+
);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
24
|
+
if (result.error) {
|
|
25
|
+
process.stderr.write(`penv: ${binary} could not be run: ${result.error.message}\n`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
// Re-raised rather than translated, so a caller sees the signal that stopped penv.
|
|
29
|
+
if (result.signal) {
|
|
30
|
+
process.kill(process.pid, result.signal);
|
|
31
|
+
// Reached only when the signal was ignored, so there is still a code to answer with.
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
CHANGED
|
@@ -1,56 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@penvhq/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "penv
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
|
+
"description": "penv, the CLI of penv.cloud: validate your .env, type it, and keep it out of your coding agent's reach.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"directory": "packages/cli"
|
|
6
|
+
"homepage": "https://penv.cloud",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
10
9
|
},
|
|
11
|
-
"homepage": "https://github.com/Itzfeminisce/penvhq#readme",
|
|
12
|
-
"type": "module",
|
|
13
|
-
"main": "./dist/index.cjs",
|
|
14
|
-
"module": "./dist/index.js",
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
10
|
"bin": {
|
|
17
|
-
"penv
|
|
18
|
-
},
|
|
19
|
-
"exports": {
|
|
20
|
-
".": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"import": "./dist/index.js",
|
|
23
|
-
"require": "./dist/index.cjs"
|
|
24
|
-
},
|
|
25
|
-
"./install": {
|
|
26
|
-
"types": "./dist/install.d.ts",
|
|
27
|
-
"import": "./dist/install.js",
|
|
28
|
-
"require": "./dist/install.cjs"
|
|
29
|
-
},
|
|
30
|
-
"./package.json": "./package.json"
|
|
11
|
+
"penv": "bin/penv.js"
|
|
31
12
|
},
|
|
32
13
|
"files": [
|
|
33
|
-
"
|
|
14
|
+
"bin/penv.js"
|
|
34
15
|
],
|
|
35
|
-
"
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@penvhq/
|
|
40
|
-
"@penvhq/
|
|
41
|
-
"@penvhq/
|
|
42
|
-
"@penvhq/runtime": "0.16.2"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"zod": "^4.4.3"
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"@penvhq/cli-linux-x64": "1.0.0-alpha.3",
|
|
18
|
+
"@penvhq/cli-linux-arm64": "1.0.0-alpha.3",
|
|
19
|
+
"@penvhq/cli-darwin-x64": "1.0.0-alpha.3",
|
|
20
|
+
"@penvhq/cli-darwin-arm64": "1.0.0-alpha.3",
|
|
21
|
+
"@penvhq/cli-win32-x64": "1.0.0-alpha.3",
|
|
22
|
+
"@penvhq/cli-win32-arm64": "1.0.0-alpha.3"
|
|
46
23
|
},
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"@penvhq/provider-github": "0.16.2",
|
|
51
|
-
"@penvhq/provider-vault": "0.16.2"
|
|
52
|
-
},
|
|
53
|
-
"scripts": {
|
|
54
|
-
"build": "tsup"
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/Itzfeminisce/penvhq.git"
|
|
55
27
|
}
|
|
56
|
-
}
|
|
28
|
+
}
|