crabenv 0.0.1 → 0.0.2

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 +67 -37
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,10 +1,16 @@
1
- # crabenv
1
+ # 🦀 crabenv
2
2
 
3
3
  The simplest, opinionated way to keep .env files, schemas, and examples aligned.
4
4
 
5
- crabenv is an **opinionated**, language-agnostic CLI that keeps your environment variables aligned across schema, template, and local files. No new config file required. It validates, copies, and checks for drift so your team doesn't have to.
5
+ `crabenv` is an env var management standard created by [Carlo Taleon](http://carlo.tl) to minimize env var schema + documentation drift in any codebase. If you follow this standard, you'll find it extremely seamless to "develop locally" and "deploy to production" in any platform!
6
6
 
7
- This project will once and for all solve environment variables typesafe schema definition and documentation so it will never drift. This CLI only does what you can already do manually. It doesn't introduce any new config files so if your team doesn't want to use crabenv, it'll be completely fine!
7
+ ## Why use it
8
+
9
+ - [x] Typesafety & Validation
10
+ - [x] Good documentation. Never stale, does what it says.
11
+ - [x] Seamless _local development_ to _deployment_ story.
12
+ - [x] No new config files. Your team doesn't need to install crabenv, it's just manual-crud made automated via CLI.
13
+ - [x] Language-agnostic. No need to learn language-specific configurations for multi-language and monorepos, just use the same CLI commands.
8
14
 
9
15
  ## Installation
10
16
 
@@ -17,15 +23,56 @@ cargo install crabenv # or cargo (build from source)
17
23
  curl -sSL https://raw.githubusercontent.com/Blankeos/crabenv/main/install.sh | sh # or linux/macos (via curl)
18
24
  ```
19
25
 
20
- ### 📁 Languages supported:
26
+ ## Quickstart
27
+
28
+ > 💡 Before anything else, read this 1-page concept of the standard [here](https://crabenv.pages.dev/#concepts). Must know **Local (`.env`)**, **Schema (`env.ts`, etc.)**, **Template (`.env.example`)**
29
+
30
+ 1. This command auto-detects your project and creates a Local, Schema, and Template
31
+
32
+ ```sh
33
+ crabenv init
34
+ ```
35
+
36
+ 2. Add an env var
37
+
38
+ ```sh
39
+ crabenv add
40
+ ◆ Variable name: DATABASE_URL
41
+ ◆ Scope: private
42
+ ◆ Type: string
43
+ ◆ Example Value: $(pwd)/data.db
44
+ ◆ Mark as optional: no
45
+ ◆ Add? yes
46
+
47
+ # Notice that Local, Template, and Schema are correctly synced 🎉
48
+ ```
49
+
50
+ 3. List your env vars to see if it's used, remove, or update vars
21
51
 
22
- - [x] TypeScript/Javascript and Monorepos (includes React, Solid, Vue, Svelte, Vite, NextJS, ReactNative, Backends, and Cloudflare apps)
23
- - [x] Python
24
- - [x] Rust
25
- - [x] Flutter
52
+ ```sh
53
+ crabenv ls
54
+ crabenv remove
55
+ crabenv update
56
+ ```
57
+
58
+ 😎 That's it! Now imagine the convenience when...
59
+
60
+ - A new dev onboards on a new project, they just need to do `crabenv cp` to get a correct `.env` file! It's a better `cp .env.example .env` command!
61
+ - A senior dev wants to deploy a monorepo so what env vars needed for specific apps? Show them all with `crabenv ls`
62
+ - A senior dev wants to reorganize, sort, standardize the structure of env vars? Re-sort them without thinking about it with `crabenv fmt`
63
+ - A senior dev wants to check for any drift? `crabenv doctor`
64
+
65
+ ## 📁 Languages supported:
66
+
67
+ Regardless of the language or mix of languages in your repositories, you'll be able to use the same commands.
68
+
69
+ - [x] 💙 TypeScript/Javascript and Monorepos (includes React, Solid, Vue, Svelte, Vite, NextJS, ReactNative, Backends, and Cloudflare apps)
70
+ - [x] 🐍 Python
71
+ - [x] 🦀 Rust
72
+ - [x] 🐦 Flutter
26
73
  - [x] More? Request an adapter.
27
74
 
28
- ### 🤒 Pains solved:
75
+ <!--### 🤒 Pains solved:
29
76
 
30
77
  - [x] CRUD and Documentation drift
31
78
  - [ ] Deployment/sink drift via explicit managed blocks, not arbitrary file inference
@@ -37,33 +84,21 @@ curl -sSL https://raw.githubusercontent.com/Blankeos/crabenv/main/install.sh | s
37
84
  - [x] Use templating patterns like `"RSA_KEY=$(openssl rand -base64 32)` - the crabenv copy
38
85
  - [x] ~Rotating??~ Kinda impossible actually.
39
86
  - [ ] Cloudflare `.dev.vars` guidance/docs
40
-
41
- ## Philosophy
42
-
43
- - No new config file. Your team doesn't have to install crabenv, but it helps a lot! The CLI just abstracts the manual maintenance.
44
- - Env config is synced across **surfaces**:
45
- - 1. **Schema** - The validator language-specific schema. Multiple based on apps. i.e. `env.ts`, `env.private.ts`, `env.public.ts`, `config.rs`, `config.dart`.
46
- - 2. **Template (`.env.example`)** - Safe example/template values for env values. Multiple based on apps.
47
- - 3. **Local (`.env`)** - The actual local runtime values/secrets. 1 only.
48
- - 4. **Sinks** - Reserved for future explicit integrations. crabenv does not currently infer or rewrite arbitrary deployment files.
49
- - More? Make an adapter
50
- - Packages in monorepos don't have .env.
87
+ -->
51
88
 
52
89
  ## Agent skill
53
90
 
54
- Install the crabenv skill for coding agents with:
91
+ Completely optional, but in case you want your agent to be autonomous when adding new env vars... Install the crabenv skill for coding agents with:
55
92
 
56
93
  ```sh
57
94
  npx skills add blankeos/crabenv
58
95
  ```
59
96
 
60
- This installs the `crabenv` agent skill from `skills/crabenv`, including language-specific references for TypeScript/JavaScript, Python, Rust, and Flutter/Dart.
61
-
62
- ## Usage
97
+ ## Useful commands you should know
63
98
 
64
99
  ```sh
65
100
  crabenv init
66
- crabenv copy # or crabenv cp.
101
+ crabenv copy # or crabenv cp. (It's a better `cp .env.example .env` command)
67
102
  crabenv doctor # It's a checklist of common mistakes
68
103
  crabenv doctor --fix
69
104
 
@@ -74,8 +109,9 @@ crabenv update # Wizard-like experience
74
109
  crabenv remove # Wizard-like experience
75
110
 
76
111
  crabenv add {VARIABLE_NAME}
77
- --shared # if monorepo, adds it to all apps
78
- --example # optional, for .env.example
112
+ --shared # if monorepo, adds it to all apps (also --shared '*')
113
+ --shared apps/api apps/web # add it to selected apps
114
+ --example # optional, for .env.example (you can use templating w/ "$(pwd)/data.db")
79
115
  --optional # optional, required by default
80
116
  --default # optional
81
117
  # Type flags
@@ -97,16 +133,10 @@ crabenv remove {VARIABLE_NAME}
97
133
  crabenv update {VARIABLE_NAME} # Same flags as add
98
134
  ```
99
135
 
100
- ## Current CLI
136
+ ## Documentation
101
137
 
102
- This repo currently has a first Rust CLI implementation that works against the sample projects in `_checks/sample-projects`.
138
+ https://crabenv.pages.dev
103
139
 
104
- ```sh
105
- crabenv --root _checks/sample-projects/basic-npm list
106
- crabenv --root _checks/sample-projects/basic-npm doctor
107
- crabenv --root _checks/sample-projects/basic-npm copy
140
+ ## License
108
141
 
109
- crabenv --root _checks/sample-projects/monorepo doctor --fix --yes
110
- crabenv --root _checks/sample-projects/monorepo add NEXT_PUBLIC_ANALYTICS_ID --owner apps/next-web --public --example dev --optional
111
- crabenv --root _checks/sample-projects/monorepo remove NEXT_PUBLIC_ANALYTICS_ID --owner apps/next-web --public
112
- ```
142
+ MIT. Fork it if you want!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabenv",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "The simplest, opinionated way to keep .env files, schemas, and examples aligned.",
5
5
  "main": "bin.js",
6
6
  "bin": {