envprism 0.3.0-dev-main.31-20bc427 → 0.3.0-dev.27-b88a5f0
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 +44 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,48 +20,21 @@
|
|
|
20
20
|
bunx envprism
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
That's it. Point `envprism` at a directory containing `.env*` files and it opens a side-by-side matrix: rows are variable keys, columns are files. Differences light up, missing keys are obvious, and you can edit cells in place — comments, blank lines, and key order survive the round trip.
|
|
23
|
+
That's it. Point `envprism` at a directory containing `.env*` files and it opens a side-by-side matrix view: rows are variable keys, columns are files. Differences light up, missing keys are obvious, and you can edit cells in place — comments, blank lines, and key order survive the round trip.
|
|
24
24
|
|
|
25
25
|
## 🤔 Why
|
|
26
26
|
|
|
27
27
|
Most projects accumulate a fistful of env files — `.env`, `.env.example`, `.env.staging`, `.env.production` — and no good way to see them together. You `diff` two at a time, miss the third, and ship a deploy where `REDIS_URL` was set everywhere except staging. The example file rots because nobody updates it when they add a key. Secrets get pasted into screenshots.
|
|
28
28
|
|
|
29
|
-
envprism treats the whole set as one thing
|
|
29
|
+
envprism treats the whole set as one thing. Every file becomes a column, every variable a row, and the gaps jump out at a glance: this key is missing here, that value drifts there, this one is still a `CHANGEME` placeholder. Edit a cell and the write-back is byte-exact — comments, blank lines, key order, and quoting all survive. Secret values stay masked, so the view is safe to share.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
One set of variables, refracted into many environment views.
|
|
32
32
|
|
|
33
33
|
> [!IMPORTANT]
|
|
34
|
-
> envprism runs on **[Bun](https://bun.sh/)** 1.3
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
bun add -g envprism # install globally
|
|
38
|
-
bunx envprism # …or run without installing
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
bunx envprism # open the TUI in the current directory
|
|
43
|
-
bunx envprism tui path/to/repo # scan another directory
|
|
44
|
-
bunx envprism diff path/to/repo # non-interactive drift report
|
|
45
|
-
bunx envprism diff --json | jq # structured drift report
|
|
46
|
-
bunx envprism diff --check # exit 1 if any file drifts from base (CI)
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
Inside the TUI, press `?` for the full keybinding reference.
|
|
34
|
+
> `envprism` runs on **[Bun](https://bun.sh/)** 1.3+. The TUI is powered by [opentui](https://opentui.com/), which links to a native Zig core via `bun:ffi`. Node has no equivalent built-in FFI, so `npx envprism` will not work — install Bun first.
|
|
50
35
|
|
|
51
36
|
## ✨ Features
|
|
52
37
|
|
|
53
|
-
- **🧮 Matrix view** — every `.env*` file becomes a column, every variable a row, so n-way differences are visible at a glance.
|
|
54
|
-
- **🎨 Diff at a glance** — per-cell icons flag values that differ, keys that are missing or extra, and unfilled placeholders like `CHANGEME`.
|
|
55
|
-
- **🙈 Secret masking** — token / secret / password-like values render as `•••• (N)`, so the matrix is safe to screen-share.
|
|
56
|
-
- **✏️ Edit in place** — edit any cell with `e`; editing a key a file doesn't have yet creates it. Also add (`a`), delete (`d`), and sync a value to every file (`=`).
|
|
57
|
-
- **💾 Byte-exact write-back** — `Ctrl-S` rewrites only the keys you changed; comments, blank lines, key order, quoting, and `export` prefixes survive intact.
|
|
58
|
-
- **📂 Sections & filtering** — group by comment banner or key prefix (`g`), fold sections (`c`), filter keys live (`/`), or show only drifting keys (`v`).
|
|
59
|
-
- **↩️ Undo** — `Ctrl-Z` walks back the last edits, adds, and deletes.
|
|
60
|
-
- **🧪 CI-friendly diff** — `envprism diff` prints a text or JSON (`--json`) drift report, or just sets an exit code (`--check`) for pre-commit hooks and CI.
|
|
61
|
-
|
|
62
|
-
<details>
|
|
63
|
-
<summary>Full feature list</summary>
|
|
64
|
-
|
|
65
38
|
### Discovery & comparison
|
|
66
39
|
|
|
67
40
|
- **🔍 Auto-discovery** — finds every `.env*` file in the current directory (or in `--paths a b c`); skips editor swap files and backups.
|
|
@@ -78,7 +51,7 @@ Inside the TUI, press `?` for the full keybinding reference.
|
|
|
78
51
|
### Editing & write-back
|
|
79
52
|
|
|
80
53
|
- **✏️ Edit-or-add** — `e` / `Enter` opens an edit popover on any cell; if the key isn't in that file yet, save creates it. The popover renders every file's current value as context next to the input.
|
|
81
|
-
- **➕ Add variable** — `a` walks key + value across two prompts; the key name
|
|
54
|
+
- **➕ Add variable** — `a` walks key + value across two prompts; the parser's `[A-Za-z_][A-Za-z0-9_]*` rule guards the key name.
|
|
82
55
|
- **➖ Delete variable** — `d` removes the focused key from the focused file.
|
|
83
56
|
- **🆕 New `.env*` file** — `n` scaffolds a new file next to the base; saved with the rest on `Ctrl-S`.
|
|
84
57
|
- **🔁 Sync-to-all** — `=` copies the focused cell's value into every file (create or update); `Ctrl-A` inside the edit popover applies what you're typing to every file at once.
|
|
@@ -98,11 +71,48 @@ Inside the TUI, press `?` for the full keybinding reference.
|
|
|
98
71
|
|
|
99
72
|
- **🧪 `envprism diff`** — non-interactive subcommand that prints a text drift table, JSON (`--json`), or just sets the exit code (`--check`). Drop it into a pre-commit hook or CI to fail builds that drift from `.env.example`.
|
|
100
73
|
|
|
101
|
-
|
|
74
|
+
## 📦 Installation
|
|
75
|
+
|
|
76
|
+
Install Bun (one-time): see [bun.sh](https://bun.sh/).
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bun add -g envprism
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or run without installing:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
bunx envprism
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Requirements: **Bun 1.3+**.
|
|
89
|
+
|
|
90
|
+
## 🚀 Quick start
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bunx envprism # open the TUI in the current directory
|
|
94
|
+
bunx envprism tui path/to/repo # TUI scanning another directory
|
|
95
|
+
bunx envprism diff path/to/repo # non-interactive drift report
|
|
96
|
+
bunx envprism diff --json | jq # structured drift report
|
|
97
|
+
bunx envprism diff --check; echo $? # exits 1 if any file drifts from base
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Inside the TUI, press `?` for the full keybinding reference.
|
|
102
101
|
|
|
103
102
|
## ⚙️ Configuration
|
|
104
103
|
|
|
105
|
-
envprism runs zero-config. To tune defaults, drop an `envprism.config.{ts,js,mjs,json}` in your project — manage it with
|
|
104
|
+
envprism runs zero-config. To tune defaults, drop an `envprism.config.{ts,js,mjs,json}` in your project — manage it with the `config` commands:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
bunx envprism config init # scaffold envprism.config.ts (--force to overwrite)
|
|
108
|
+
bunx envprism config path # print the resolved config file (or note defaults)
|
|
109
|
+
bunx envprism config show # print the effective merged config as JSON
|
|
110
|
+
bunx envprism config edit # open it in $EDITOR (creates one in cwd if absent)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Discovery & precedence.** The config file is resolved by walking **up from the current working directory** (not from the scanned `--paths` directory). Override the location with the `--config <path>` flag or the `ENVPRISM_CONFIG` env var. For any individual setting, a CLI flag beats the config file, which beats the built-in default (`flag > config > default`).
|
|
114
|
+
|
|
115
|
+
For type-safe authoring:
|
|
106
116
|
|
|
107
117
|
```ts
|
|
108
118
|
// envprism.config.ts
|
|
@@ -116,9 +126,6 @@ export default defineEnvprismConfig({
|
|
|
116
126
|
|
|
117
127
|
List fields come in two flavours: the base field (e.g. `secretTokens`) **replaces** the built-in list, while the `…Extra` variant (e.g. `secretTokensExtra`) **appends** to it.
|
|
118
128
|
|
|
119
|
-
<details>
|
|
120
|
-
<summary>All configuration options</summary>
|
|
121
|
-
|
|
122
129
|
### `discovery`
|
|
123
130
|
|
|
124
131
|
| Option | Default | What it does |
|
|
@@ -165,8 +172,6 @@ Base resolution order: `--base` flag → `base.name` → `base.priority` (in ord
|
|
|
165
172
|
|
|
166
173
|
Theme keys (all optional hex strings): `fg`, `fgDim`, `fgHeader`, `fgBase`, `fgSection`, `differs`, `extra`, `placeholder`, `modified`, `fgDirty`, `missing`, `focusBg`. Invalid hex values are ignored with a warning and fall back to the default.
|
|
167
174
|
|
|
168
|
-
</details>
|
|
169
|
-
|
|
170
175
|
> [!NOTE]
|
|
171
176
|
> The TypeScript types exported from `envprism/config` (`EnvprismUserConfig` and friends) are the canonical, always-current reference. A worked example lives in [`examples/envprism.config.ts`](examples/envprism.config.ts).
|
|
172
177
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://www.schemastore.org/package.json",
|
|
3
3
|
"name": "envprism",
|
|
4
|
-
"version": "0.3.0-dev
|
|
4
|
+
"version": "0.3.0-dev.27-b88a5f0",
|
|
5
5
|
"description": "TUI-based env file manager — refract one set of variables into many environment views.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"bun",
|