morphix-env 0.7.0-beta.1 → 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.
package/README.md CHANGED
@@ -1,277 +1,113 @@
1
- # morphix-env
2
-
3
- `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.
4
-
5
- `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.
6
-
7
- The concise command is `mx-env`; the published `morphix-env` command remains fully supported.
8
-
9
- 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).
1
+ <p align="center">
2
+ <img src="docs/logo.png" width="160" alt="morphix-env" />
3
+ </p>
10
4
 
11
- ## Quick start: global local defaults
5
+ # morphix-env
12
6
 
13
- Create this file once:
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.
14
8
 
15
- ```dotenv
16
- # ~/.mx-env/.env
17
- PERSONAL_API_URL=http://localhost:4444
18
- ```
9
+ ## Quick start
19
10
 
20
- 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:
21
12
 
22
13
  ```bash
23
- mkdir -p ~/.mx-env
24
- chmod 700 ~/.mx-env
25
- chmod 600 ~/.mx-env/.env
14
+ npx morphix-env@latest skill install --target project # writes .claude/skills/morphix-env/ — commit it with the repo
26
15
  ```
27
16
 
28
- Then every normal project command can use it without repeating configuration:
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.
29
18
 
30
- ```bash
31
- mx-env run -- pnpm dev
32
- ```
33
-
34
- `~/.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:**
35
20
 
36
21
  ```bash
37
- 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
38
25
  ```
39
26
 
40
- ## 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
41
30
 
42
- 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:
43
32
 
44
33
  ```text
45
34
  inherited process.env
46
35
  → ~/.mx-env/.env
47
- → ~/.mx-env/config.json default profile
48
- → project profile or legacy project configuration
49
- → explicit CLI local override (-f)
36
+ → global default profile
37
+ → project profile (or legacy Infisical config)
38
+ → explicit -f override file
50
39
  ```
51
40
 
52
- 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.
53
-
54
- 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.
55
-
56
- ## Profiles and providers
57
-
58
- Profiles compose complete source collections; do not enumerate every secret in repository configuration.
59
-
60
- ```jsonc
61
- // ~/.mx-env/config.json — optional user baseline, never contains values
62
- {
63
- "sources": {
64
- "machine-keychain": {
65
- "provider": "os-keychain",
66
- "platform": "macos",
67
- "service": "com.morphix.env/global"
68
- },
69
- "team-defaults": {
70
- "provider": "infisical",
71
- "paths": ["/shared"]
72
- }
73
- },
74
- "profiles": {
75
- "developer-default": {
76
- "sources": ["machine-keychain", "team-defaults"]
77
- }
78
- },
79
- "defaultProfile": "developer-default"
80
- }
81
- ```
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:
82
42
 
83
43
  ```jsonc
84
44
  // project/mx-env.config.json
85
45
  {
86
46
  "sources": {
87
- "api": {
88
- "provider": "infisical",
89
- "paths": ["/ai/api"]
90
- },
91
- "project-doppler": {
92
- "provider": "doppler",
93
- "project": "morphicai-api",
94
- "config": "dev"
95
- },
96
- "local": {
97
- "provider": "local",
98
- "files": [".env.local"],
99
- "override": true
100
- }
101
- },
102
- "profiles": {
103
- "api-dev": {
104
- "extends": "developer-default",
105
- "sources": ["api", "project-doppler", "local"]
106
- }
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 }
107
50
  },
108
- "defaultProfile": "api-dev"
51
+ "profiles": { "dev": { "sources": ["team", "doppler", "local"] } },
52
+ "defaultProfile": "dev"
109
53
  }
110
54
  ```
111
55
 
112
- Run it with either CLI name:
113
-
114
- ```bash
115
- mx-env run --profile api-dev -- pnpm dev
116
- morphix-env run --profile api-dev -- pnpm dev
117
- ```
118
-
119
- ### Supported sources
120
-
121
- | Provider | Source selector | Value ownership / bootstrap |
122
- |---|---|---|
123
- | `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. |
124
- | `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. |
125
- | `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. |
126
- | `dotenvx` | encrypted `files` | Install `dotenvx` separately and provide its private decryption key through a secure bootstrap path. The encrypted file stays provider-managed. |
127
- | `local` | dotenv `files` | Intended for project `.env.local` and explicitly declared user files. A missing source is only allowed with `"optional": true`. |
128
-
129
- ### Doppler compared with Infisical
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.
130
57
 
131
- Both are strong team secret managers; `morphix-env` treats them as sources rather than attempting to reproduce their control planes.
58
+ ## Compared with existing secret management
132
59
 
133
- | Concern | Infisical | Doppler | What `morphix-env` adds |
134
- |---|---|---|---|
135
- | Organization | projects, environments, folders/paths, identities | project, config, root/branch config inheritance | One profile can combine either or both with local sources. |
136
- | Local execution | SDK Machine Identity or `infisical` CLI | `doppler login` + `doppler run` | One stable `mx-env run --profile` interface. |
137
- | 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. |
138
- | Visual value editing | Provider dashboard | Provider dashboard | `mx-env edit` opens provider-owned routes instead of copying values into a new dashboard. |
139
- | Local Keychain / global dotenv | Not their primary concern | Not their primary concern | `~/.mx-env` and `os-keychain` participate in the same explicit order. |
60
+ `morphix-env` is a composition layer, not a fifth vault:
140
61
 
141
- 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.
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 |
142
68
 
143
- 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.
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.
144
70
 
145
- ## Visual editor
146
-
147
- Use the one-shot editor instead of asking someone to paste a value into chat:
148
-
149
- ```bash
150
- mx-env edit --profile api-dev
151
- mx-env edit --source machine-keychain
152
- ```
71
+ ## Value safety
153
72
 
154
- It starts a short-lived loopback-only browser session. The profile page shows names, source precedence, configured state, provenance, and collisions without values.
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.
155
77
 
156
- - Infisical and Doppler sources route the user to their provider-owned editor.
157
- - Local dotenv files can be edited only in the selected local source.
158
- - Keychain shows account names but never reveals existing values; it can add or update an account value.
159
- - dotenvx writes through its CLI so it remains responsible for the encrypted representation.
160
-
161
- The CLI prints status only, never a secret value.
162
-
163
- 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:
164
-
165
- ```bash
166
- mx-env edit --profile api-dev --print-editor-url
167
- ```
168
-
169
- 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.
170
-
171
- ## Context hygiene
172
-
173
- ```bash
174
- mx-env inspect --profile api-dev
175
- mx-env audit tail
176
- ```
177
-
178
- `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.
179
-
180
- 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.
181
-
182
- 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`.
183
-
184
- 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`.
185
79
 
186
80
  ## Commands
187
81
 
188
82
  ```bash
189
- # Run one command with its composed profile
190
- mx-env run --profile api-dev -- pnpm dev
191
-
192
- # Existing scripts remain valid
193
- morphix-env run --env dev -- pnpm dev
194
-
195
- # Generate public browser runtime configuration
196
- mx-env generate --profile api-dev --out public/__env.js
197
-
198
- # Value-free status/provenance
199
- mx-env inspect --profile api-dev
200
-
201
- # Open the short-lived visual editor
202
- mx-env edit --profile api-dev
203
-
204
- # Generate this project's value-free Agent workflow Skill
205
- mx-env doc --profile api-dev
206
-
207
- # Install the packaged Agent Skill (global | project | trellis)
208
- mx-env skill install --target project
209
-
210
- # Show per-target install state and template drift
211
- mx-env skill show
212
-
213
- # Value-free audit events
214
- 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
215
90
  ```
216
91
 
217
- Options:
218
-
219
- | Option | Meaning |
220
- |---|---|
221
- | `-p, --profile <name>` | Select a named profile. |
222
- | `-f, --env-file <path>` | Append a local override source for this invocation. |
223
- | `-e, --env <name>` | Override the Infisical environment for selected Infisical sources. |
224
- | `--no-infisical` | Skip Infisical sources. |
225
- | `--no-global` | Ignore `~/.mx-env/.env` and `~/.mx-env/config.json`. |
226
- | `--allow-insecure-global` | Explicitly permit a global dotenv file readable by group/other users. Avoid this outside controlled troubleshooting. |
227
- | `--print-editor-url` | Explicitly print the one-time local editor URL; normally the browser opens without emitting it to the terminal. |
228
- | `--target <scope>` | `skill install` destination: `global` (`~/.claude/skills/`), `project` (`.claude/skills/` inside the repo — commit it), or `trellis` (`~/.trellis/skills/` canonical store). |
229
- | `--force` | Replace an installed skill that differs from this version's template; a modified file is never overwritten without it. |
230
- | `-o, --out <path>` / `--filter <prefix>` | Configure public browser-env generation. |
231
- | `-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.
232
93
 
233
94
  ## Agent workflow
234
95
 
235
- ### Packaged Agent Skill
236
-
237
- 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:
238
97
 
239
98
  ```bash
240
- # Agent bootstrap straight from npm — no global install required
241
- npx morphix-env@latest skill install --target project
242
-
243
- mx-env skill install --target project # <repo>/.claude/skills/morphix-env/SKILL.md — commit it with the repository
244
- mx-env skill install --target global # ~/.claude/skills/morphix-env/SKILL.md — every project on this machine
245
- 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`
246
102
  ```
247
103
 
248
- 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.
249
105
 
250
- ### Project workflow Skill
251
-
252
- `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:
253
-
254
- ```md
255
- When the user asks to add, modify, or rotate a credential:
256
- 1. Run `mx-env edit --profile <profile>` or `mx-env edit --source <source>`.
257
- 2. Let the user complete the edit in the local visual editor or provider UI.
258
- 3. Do not request the value in chat; do not run env, printenv, cat .env, or a reveal command.
259
- 4. Validate only configured status and provenance, never the value.
260
- ```
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`).
261
107
 
262
108
  ## Legacy configuration
263
109
 
264
- This remains valid and needs no immediate migration:
265
-
266
- ```json
267
- {
268
- "infisical": { "paths": ["/ai"], "envPrefix": "VITE_" },
269
- "envFiles": [".env.local"],
270
- "generate": { "out": "public/__env.js", "filter": "NEXT_PUBLIC_" }
271
- }
272
- ```
273
-
274
- 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.
275
111
 
276
112
  ## License
277
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-beta.1",
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",
@@ -37279,7 +37279,8 @@ var package_default = {
37279
37279
  prepublishOnly: "pnpm build && pnpm test"
37280
37280
  },
37281
37281
  files: [
37282
- "dist"
37282
+ "dist",
37283
+ "docs/logo.png"
37283
37284
  ],
37284
37285
  keywords: [
37285
37286
  "env",
package/docs/logo.png ADDED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morphix-env",
3
- "version": "0.7.0-beta.1",
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",
@@ -24,7 +24,8 @@
24
24
  "prepublishOnly": "pnpm build && pnpm test"
25
25
  },
26
26
  "files": [
27
- "dist"
27
+ "dist",
28
+ "docs/logo.png"
28
29
  ],
29
30
  "keywords": [
30
31
  "env",