morphix-env 0.7.0 → 0.7.1

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 (3) hide show
  1. package/README.md +53 -221
  2. package/dist/cli.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,278 +4,110 @@
4
4
 
5
5
  # morphix-env
6
6
 
7
- `morphix-env` is a secret composition CLI for local development, CI, and agent-assisted workflows. It does not become another secret vault: Infisical, Doppler, macOS Keychain, dotenvx, and local files continue to own their values, authentication, access controls, rotation, and provider UI.
7
+ A secret composition CLI for local development, CI, and agent-assisted workflows. It is not another vault: Infisical, Doppler, macOS Keychain, dotenvx, and local files keep owning their values — `mx-env` composes the sources a profile selects into one short-lived child-process environment and keeps inspection, audit, and editor output free of secret values.
8
8
 
9
- `morphix-env` assembles the sources chosen by a profile into one short-lived child-process environment, records value-free provenance, and keeps normal command output, inspection, audit records, and generated workflow guidance free of secret values.
9
+ ## Quick start
10
10
 
11
- The concise command is `mx-env`; the published `morphix-env` command remains fully supported.
12
-
13
- The package also ships a maintained, value-free Agent Skill (`mx-env skill install`) so agents can adopt the whole workflow — safety rules, configuration schema, commands — without a second distribution; see [Agent workflow](#agent-workflow).
14
-
15
- ## Quick start: global local defaults
16
-
17
- Create this file once:
18
-
19
- ```dotenv
20
- # ~/.mx-env/.env
21
- PERSONAL_API_URL=http://localhost:4444
22
- ```
23
-
24
- Protect it on macOS/Linux:
11
+ **With an Agent (recommended):** install the packaged skill, commit it, and let the agent do the rest. The skill carries the safety rules, the full configuration schema, onboarding steps, and troubleshooting — so this README does not have to:
25
12
 
26
13
  ```bash
27
- mkdir -p ~/.mx-env
28
- chmod 700 ~/.mx-env
29
- chmod 600 ~/.mx-env/.env
14
+ npx morphix-env@latest skill install --target project # writes .claude/skills/morphix-env/ — commit it with the repo
30
15
  ```
31
16
 
32
- Then every normal project command can use it without repeating configuration:
33
-
34
- ```bash
35
- mx-env run -- pnpm dev
36
- ```
17
+ Then tell your agent something like "set up this project's environment with mx-env". The agent reads the skill and drives configuration, validation, and editing; nobody pastes a secret value into chat.
37
18
 
38
- `~/.mx-env/.env` is deliberately the only automatically discovered value file. `~/.mx-env/config.json` is optional and adds global Keychain, encrypted-file, or remote-provider sources. For CI, investigation, or an unfamiliar repository, use a reproducible project-only run:
19
+ **Without an Agent:**
39
20
 
40
21
  ```bash
41
- mx-env run --no-global -- pnpm dev
22
+ npm install -g morphix-env
23
+ mx-env run -- pnpm dev # compose the project profile and run
24
+ mx-env inspect # key names, sources, status — never values
42
25
  ```
43
26
 
44
- ## Source precedence and conflicts
27
+ Optionally create `~/.mx-env/.env` (chmod 600) for personal machine-wide defaults; they join every run at low precedence unless `--no-global`.
28
+
29
+ ## How it works
45
30
 
46
- The composed environment has a fixed low-to-high order:
31
+ A profile lists sources from low to high; the composed environment follows a fixed baseline:
47
32
 
48
33
  ```text
49
34
  inherited process.env
50
35
  → ~/.mx-env/.env
51
- → ~/.mx-env/config.json default profile
52
- → project profile or legacy project configuration
53
- → explicit CLI local override (-f)
36
+ → global default profile
37
+ → project profile (or legacy Infisical config)
38
+ → explicit -f override file
54
39
  ```
55
40
 
56
- Two sources that provide the same key fail by default. The later source must explicitly declare `"override": true` to replace the earlier value. This catches accidental cross-environment collisions instead of silently selecting a database, API, or deployment credential.
57
-
58
- Existing projects remain compatible: a legacy `mx-env.config.json` still composes the configured Infisical paths followed by `.env.local`, so `.env.local` remains the deliberate override layer.
59
-
60
- ## Profiles and providers
61
-
62
- Profiles compose complete source collections; do not enumerate every secret in repository configuration.
63
-
64
- ```jsonc
65
- // ~/.mx-env/config.json — optional user baseline, never contains values
66
- {
67
- "sources": {
68
- "machine-keychain": {
69
- "provider": "os-keychain",
70
- "platform": "macos",
71
- "service": "com.morphix.env/global"
72
- },
73
- "team-defaults": {
74
- "provider": "infisical",
75
- "paths": ["/shared"]
76
- }
77
- },
78
- "profiles": {
79
- "developer-default": {
80
- "sources": ["machine-keychain", "team-defaults"]
81
- }
82
- },
83
- "defaultProfile": "developer-default"
84
- }
85
- ```
41
+ The same key from two sources fails by default; the later source must declare `"override": true` to replace the earlier value. Configuration never contains values — only wiring:
86
42
 
87
43
  ```jsonc
88
44
  // project/mx-env.config.json
89
45
  {
90
46
  "sources": {
91
- "api": {
92
- "provider": "infisical",
93
- "paths": ["/ai/api"]
94
- },
95
- "project-doppler": {
96
- "provider": "doppler",
97
- "project": "morphicai-api",
98
- "config": "dev"
99
- },
100
- "local": {
101
- "provider": "local",
102
- "files": [".env.local"],
103
- "override": true
104
- }
105
- },
106
- "profiles": {
107
- "api-dev": {
108
- "extends": "developer-default",
109
- "sources": ["api", "project-doppler", "local"]
110
- }
47
+ "team": { "provider": "infisical", "paths": ["/ai/api"] },
48
+ "doppler": { "provider": "doppler", "project": "morphicai-api", "config": "dev" },
49
+ "local": { "provider": "local", "files": [".env.local"], "optional": true, "override": true }
111
50
  },
112
- "defaultProfile": "api-dev"
51
+ "profiles": { "dev": { "sources": ["team", "doppler", "local"] } },
52
+ "defaultProfile": "dev"
113
53
  }
114
54
  ```
115
55
 
116
- Run it with either CLI name:
117
-
118
- ```bash
119
- mx-env run --profile api-dev -- pnpm dev
120
- morphix-env run --profile api-dev -- pnpm dev
121
- ```
122
-
123
- ### Supported sources
124
-
125
- | Provider | Source selector | Value ownership / bootstrap |
126
- |---|---|---|
127
- | `infisical` | `paths`, optional project/site/environment settings | Local: `infisical login`. CI: Machine Identity through the usual `INFISICAL_CLIENT_ID`, `INFISICAL_CLIENT_SECRET`, and project identity flow. Do not put these in project config. |
128
- | `doppler` | `project` and `config` | Local: `doppler login`. CI: a least-privilege Doppler Service Token supplied outside repository configuration, ideally via workload identity or the OS Keychain. |
129
- | `os-keychain` | macOS generic-password `service`; each account is an environment key | macOS only in this release. Keychain owns the value; use `mx-env edit` to add/update it. |
130
- | `dotenvx` | encrypted `files` | Install `dotenvx` separately and provide its private decryption key through a secure bootstrap path. The encrypted file stays provider-managed. |
131
- | `local` | dotenv `files` | Intended for project `.env.local` and explicitly declared user files. A missing source is only allowed with `"optional": true`. |
132
-
133
- ### Doppler compared with Infisical
134
-
135
- Both are strong team secret managers; `morphix-env` treats them as sources rather than attempting to reproduce their control planes.
136
-
137
- | Concern | Infisical | Doppler | What `morphix-env` adds |
138
- |---|---|---|---|
139
- | Organization | projects, environments, folders/paths, identities | project, config, root/branch config inheritance | One profile can combine either or both with local sources. |
140
- | Local execution | SDK Machine Identity or `infisical` CLI | `doppler login` + `doppler run` | One stable `mx-env run --profile` interface. |
141
- | CI least privilege | Machine Identity scoped by project/path/role | Service Token scoped to project/config | Provider bootstrap stays outside config; profile decides only which source is requested. |
142
- | Visual value editing | Provider dashboard | Provider dashboard | `mx-env edit` opens provider-owned routes instead of copying values into a new dashboard. |
143
- | Local Keychain / global dotenv | Not their primary concern | Not their primary concern | `~/.mx-env` and `os-keychain` participate in the same explicit order. |
144
-
145
- Choose a provider based on its own identity, audit, rotation, price, and hosting requirements. Provider switching is not assumed to be a one-line operation: source selectors and permissions remain provider-specific even though the consuming command remains stable.
146
-
147
- For a manual Doppler smoke test, authenticate with `doppler login`, declare a non-production project/config source, and run `mx-env inspect --profile <profile>`. It must report the Doppler source and key names only. Use `mx-env run --profile <profile> -- <non-echoing command>` to validate delivery; do not use `doppler secrets get --plain` or print the child environment.
148
-
149
- ## Visual editor
150
-
151
- Use the one-shot editor instead of asking someone to paste a value into chat:
152
-
153
- ```bash
154
- mx-env edit --profile api-dev
155
- mx-env edit --source machine-keychain
156
- ```
157
-
158
- It starts a short-lived loopback-only browser session. The profile page shows names, source precedence, configured state, provenance, and collisions without values.
159
-
160
- - Infisical and Doppler sources route the user to their provider-owned editor.
161
- - Local dotenv files can be edited only in the selected local source.
162
- - Keychain shows account names but never reveals existing values; it can add or update an account value.
163
- - dotenvx writes through its CLI so it remains responsible for the encrypted representation.
164
-
165
- The CLI prints status only, never a secret value.
56
+ Providers: `infisical` · `doppler` · `os-keychain` (macOS) · `dotenvx` (encrypted files) · `local` (dotenv files). Provider login and bootstrap stay on the provider side (`infisical login`, `doppler login`, dotenvx key bootstrap) and never enter repository config.
166
57
 
167
- On macOS the browser opens automatically and the default CLI output intentionally omits the one-time editor URL, so an Agent tool result does not receive a bearer-like local session capability. A human can explicitly request the URL when needed:
58
+ ## Compared with existing secret management
168
59
 
169
- ```bash
170
- mx-env edit --profile api-dev --print-editor-url
171
- ```
172
-
173
- On macOS, verify Keychain editing manually after installing a new version: use a temporary `os-keychain` service namespace, run `mx-env edit --source <name>`, add a generated test account in the browser, confirm it appears in the account-name list without revealing its value, then use **Delete** to remove it. The terminal transcript must contain only the editor URL/status.
174
-
175
- ## Context hygiene
60
+ `morphix-env` is a composition layer, not a fifth vault:
176
61
 
177
- ```bash
178
- mx-env inspect --profile api-dev
179
- mx-env audit tail
180
- ```
62
+ | | dotenv / direnv | dotenvx | Infisical / Doppler CLI | 1Password CLI / Vault | morphix-env |
63
+ |---|---|---|---|---|---|
64
+ | Values live in | plaintext local files | encrypted local files | provider cloud | the vault | **nowhere new** — every system above stays the value owner |
65
+ | Composing multiple sources | ✗ | ✗ | own product only | own product only | ✓ one profile mixes any of them, plus a global baseline |
66
+ | Same-key collision | silently shadowed | silently shadowed | n/a | n/a | hard error unless an explicit `"override": true` |
67
+ | Agent context hygiene | `cat .env` leaks | partial | `secrets --plain` leaks | `op read` leaks | inspect / audit / editor are value-free; `run` redacts injected values from child output |
181
68
 
182
- `inspect` lists key names, source provenance, and configured state only. Audit events contain profile/source/key names, outcome, duration, and exit code—never a value, value prefix, command arguments, or provider stderr.
69
+ Choosing between Infisical and Doppler still depends on each provider's own identity, audit, rotation, and pricing — `morphix-env` does not replace that decision. It composes whichever you already use (or several, plus local sources) behind one stable `mx-env run --profile` interface.
183
70
 
184
- When child output is forwarded through the CLI, exact non-public injected values are redacted as `[REDACTED]`, including when the value crosses stream chunks or the command fails.
71
+ ## Value safety
185
72
 
186
- This is leakage minimization, not a cryptographic isolation boundary. A process that receives an environment variable can deliberately transform or exfiltrate it. For a high-risk Agent capability, use a provider proxy/broker as a separate security design rather than passing that credential through `run`.
73
+ - `mx-env inspect` reports key names, source provenance, and configured state only.
74
+ - `mx-env edit --profile <name>` opens a short-lived, loopback-only browser editor: remote sources route to their provider-owned UI, Keychain never reveals existing values, and on macOS the one-time editor URL is not printed to the terminal unless `--print-editor-url`.
75
+ - `mx-env run` is the only injection path. Exact injected values are redacted from forwarded child output, including across stream chunks; browser-public prefixes (`NEXT_PUBLIC_`, `VITE_`, `EXPO_PUBLIC_`) are a deliberate exception.
76
+ - Audit events carry profile/source/key names, outcome, and exit code — never values, command arguments, or provider stderr.
187
77
 
188
- Browser variables (`NEXT_PUBLIC_`, `VITE_`, `EXPO_PUBLIC_`) are an intentional exception: they are public configuration, not protected secrets.
78
+ This is leakage minimization, not a cryptographic boundary: a process that receives a secret can still transform or exfiltrate it deliberately. For a high-risk agent capability, use a provider proxy/broker as a separate security design rather than passing that credential through `run`.
189
79
 
190
80
  ## Commands
191
81
 
192
82
  ```bash
193
- # Run one command with its composed profile
194
- mx-env run --profile api-dev -- pnpm dev
195
-
196
- # Existing scripts remain valid
197
- morphix-env run --env dev -- pnpm dev
198
-
199
- # Generate public browser runtime configuration
200
- mx-env generate --profile api-dev --out public/__env.js
201
-
202
- # Value-free status/provenance
203
- mx-env inspect --profile api-dev
204
-
205
- # Open the short-lived visual editor
206
- mx-env edit --profile api-dev
207
-
208
- # Generate this project's value-free Agent workflow Skill
209
- mx-env doc --profile api-dev
210
-
211
- # Install the packaged Agent Skill (global | project | trellis)
212
- mx-env skill install --target project
213
-
214
- # Show per-target install state and template drift
215
- mx-env skill show
216
-
217
- # Value-free audit events
218
- mx-env audit tail
83
+ mx-env run --profile dev -- <command> # compose and run (the only injection path)
84
+ mx-env inspect [--profile dev] # key names + provenance, no values
85
+ mx-env edit [--profile dev | --source s] # one-shot visual editor
86
+ mx-env generate --out public/__env.js # public browser runtime config
87
+ mx-env doc # write this project's key→source skill
88
+ mx-env skill install | show # packaged Agent Skill (global / project / trellis)
89
+ mx-env audit tail # value-free audit events
219
90
  ```
220
91
 
221
- Options:
222
-
223
- | Option | Meaning |
224
- |---|---|
225
- | `-p, --profile <name>` | Select a named profile. |
226
- | `-f, --env-file <path>` | Append a local override source for this invocation. |
227
- | `-e, --env <name>` | Override the Infisical environment for selected Infisical sources. |
228
- | `--no-infisical` | Skip Infisical sources. |
229
- | `--no-global` | Ignore `~/.mx-env/.env` and `~/.mx-env/config.json`. |
230
- | `--allow-insecure-global` | Explicitly permit a global dotenv file readable by group/other users. Avoid this outside controlled troubleshooting. |
231
- | `--print-editor-url` | Explicitly print the one-time local editor URL; normally the browser opens without emitting it to the terminal. |
232
- | `--target <scope>` | `skill install` destination: `global` (`~/.claude/skills/`), `project` (`.claude/skills/` inside the repo — commit it), or `trellis` (`~/.trellis/skills/` canonical store). |
233
- | `--force` | Replace an installed skill that differs from this version's template; a modified file is never overwritten without it. |
234
- | `-o, --out <path>` / `--filter <prefix>` | Configure public browser-env generation. |
235
- | `-v, --verbose` | Show source state and key counts, not values. |
92
+ Full options live in `mx-env --help`; the packaged skill mirrors the commands of the installed version.
236
93
 
237
94
  ## Agent workflow
238
95
 
239
- ### Packaged Agent Skill
240
-
241
- The npm package ships a maintained, value-free Agent Skill at `dist/SKILL.md`. It teaches an agent the full workflow: safety red lines (inspect for validation, `edit` for changes, `run` as the only injection path), the complete `mx-env.config.json` schema for all five providers, a command cheatsheet, project onboarding steps, and troubleshooting. Because it travels with the CLI, it always documents commands that exist in the installed version.
96
+ The npm package ships a maintained, value-free Agent Skill (`dist/SKILL.md`) so agents adopt the whole workflow — safety red lines, the complete schema for all five providers, a command cheatsheet, project onboarding, troubleshooting — without a second distribution:
242
97
 
243
98
  ```bash
244
- # Agent bootstrap straight from npm — no global install required
245
- npx morphix-env@latest skill install --target project
246
-
247
- mx-env skill install --target project # <repo>/.claude/skills/morphix-env/SKILL.md — commit it with the repository
248
- mx-env skill install --target global # ~/.claude/skills/morphix-env/SKILL.md — every project on this machine
249
- mx-env skill install --target trellis # ~/.trellis/skills/morphix-env/SKILL.md — then `trellis sync skills`
99
+ mx-env skill install --target project # <repo>/.claude/skills/morphix-env/ — commit it with the repo
100
+ mx-env skill install --target global # ~/.claude/skills/morphix-env/ — every project on this machine
101
+ mx-env skill install --target trellis # ~/.trellis/skills/morphix-env/ — then `trellis sync skills`
250
102
  ```
251
103
 
252
- Installs are idempotent: a re-run against an unchanged template is a no-op, and a skill file the user has customized is never overwritten without `--force`. `mx-env skill show` reports each target's install state and whether it still matches the shipped template.
104
+ Installs are idempotent, and a skill file the user has customized is never overwritten without `--force`. `mx-env skill show` reports each target's install state and template drift.
253
105
 
254
- ### Project workflow Skill
255
-
256
- `mx-env doc --profile <profile>` writes a value-free workflow Skill to `.agents/skills/morphix-env/SKILL.md` by default, listing this project's resolved key names and their winning sources. Generated or maintained Skills contain this rule:
257
-
258
- ```md
259
- When the user asks to add, modify, or rotate a credential:
260
- 1. Run `mx-env edit --profile <profile>` or `mx-env edit --source <source>`.
261
- 2. Let the user complete the edit in the local visual editor or provider UI.
262
- 3. Do not request the value in chat; do not run env, printenv, cat .env, or a reveal command.
263
- 4. Validate only configured status and provenance, never the value.
264
- ```
106
+ For project-specific guidance, `mx-env doc --profile <name>` generates a value-free skill listing this project's resolved key names and their winning sources (`.agents/skills/morphix-env/SKILL.md`).
265
107
 
266
108
  ## Legacy configuration
267
109
 
268
- This remains valid and needs no immediate migration:
269
-
270
- ```json
271
- {
272
- "infisical": { "paths": ["/ai"], "envPrefix": "VITE_" },
273
- "envFiles": [".env.local"],
274
- "generate": { "out": "public/__env.js", "filter": "NEXT_PUBLIC_" }
275
- }
276
- ```
277
-
278
- Migrate when a project needs named profiles, multiple providers, or a source that can be edited through the unified local entry point.
110
+ Existing `infisical` + `envFiles` config keeps working unchanged. Migrate to `sources` / `profiles` when a project needs named profiles, multiple providers, or a source editable through the unified entry point.
279
111
 
280
112
  ## License
281
113
 
package/dist/cli.js CHANGED
@@ -37255,7 +37255,7 @@ function cmdSkill(subcommand, options) {
37255
37255
  // package.json
37256
37256
  var package_default = {
37257
37257
  name: "morphix-env",
37258
- version: "0.7.0",
37258
+ version: "0.7.1",
37259
37259
  description: "Secret composition CLI \u2014 Infisical, Doppler, macOS Keychain, dotenvx, and local files stay value owners; composes them into one value-safe child environment and ships a built-in Agent Skill (mx-env skill install).",
37260
37260
  author: "MorphixAI <dev@morphixai.com>",
37261
37261
  homepage: "https://github.com/Morphicai/morphix-env#readme",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morphix-env",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Secret composition CLI — Infisical, Doppler, macOS Keychain, dotenvx, and local files stay value owners; composes them into one value-safe child environment and ships a built-in Agent Skill (mx-env skill install).",
5
5
  "author": "MorphixAI <dev@morphixai.com>",
6
6
  "homepage": "https://github.com/Morphicai/morphix-env#readme",