envprism 0.3.0-dev.29-07b4461 → 0.3.0-dev.32-d8b2ea5

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.
Files changed (2) hide show
  1. package/README.md +39 -44
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -20,21 +20,48 @@
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 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.
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.
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. 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.
29
+ envprism treats the whole set as one thing: every file a column, every variable a row. The gaps jump out this key is missing here, that value drifts there, this one is still a `CHANGEME`. Edits write back byte-exact, and secret values stay masked so the view is safe to share.
30
30
 
31
- One set of variables, refracted into many environment views.
31
+ ## 📦 Install & run
32
32
 
33
33
  > [!IMPORTANT]
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.
34
+ > envprism runs on **[Bun](https://bun.sh/)** 1.3+, not Node. The TUI links a native core via `bun:ffi`, so `npx envprism` will **not** work — [install Bun](https://bun.sh/) first.
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.
35
50
 
36
51
  ## ✨ Features
37
52
 
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
+
38
65
  ### Discovery & comparison
39
66
 
40
67
  - **🔍 Auto-discovery** — finds every `.env*` file in the current directory (or in `--paths a b c`); skips editor swap files and backups.
@@ -51,7 +78,7 @@ One set of variables, refracted into many environment views.
51
78
  ### Editing & write-back
52
79
 
53
80
  - **✏️ 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.
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.
81
+ - **➕ Add variable** — `a` walks key + value across two prompts; the key name is validated.
55
82
  - **➖ Delete variable** — `d` removes the focused key from the focused file.
56
83
  - **🆕 New `.env*` file** — `n` scaffolds a new file next to the base; saved with the rest on `Ctrl-S`.
57
84
  - **🔁 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.
@@ -71,48 +98,11 @@ One set of variables, refracted into many environment views.
71
98
 
72
99
  - **🧪 `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`.
73
100
 
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.
101
+ </details>
101
102
 
102
103
  ## ⚙️ Configuration
103
104
 
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:
105
+ envprism runs zero-config. To tune defaults, drop an `envprism.config.{ts,js,mjs,json}` in your project — manage it with `bunx envprism config init | path | show | edit`. The file is resolved by walking **up from the current working directory** (override with `--config <path>` or `ENVPRISM_CONFIG`). For any setting, `flag > config > default`.
116
106
 
117
107
  ```ts
118
108
  // envprism.config.ts
@@ -126,6 +116,9 @@ export default defineEnvprismConfig({
126
116
 
127
117
  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.
128
118
 
119
+ <details>
120
+ <summary>All configuration options</summary>
121
+
129
122
  ### `discovery`
130
123
 
131
124
  | Option | Default | What it does |
@@ -172,6 +165,8 @@ Base resolution order: `--base` flag → `base.name` → `base.priority` (in ord
172
165
 
173
166
  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.
174
167
 
168
+ </details>
169
+
175
170
  > [!NOTE]
176
171
  > 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).
177
172
 
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.29-07b4461",
4
+ "version": "0.3.0-dev.32-d8b2ea5",
5
5
  "description": "TUI-based env file manager — refract one set of variables into many environment views.",
6
6
  "keywords": [
7
7
  "bun",