nivii 0.3.3 → 0.3.4

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 +113 -223
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,18 @@
1
- ███╗ ██╗██╗██╗ ██╗██╗██╗ ████╗ ██║██║██║ ██║██║██║ ██╔██╗ ██║██║██║ ██║██║██║ ██║╚██╗██║██║╚██╗ ██╔╝██║██║ ██║ ╚████║██║ ╚████╔╝ ██║██║ ╚═╝ ╚═══╝╚═╝ ╚═══╝ ╚═╝╚═╝
1
+ <div align="center">
2
2
 
3
- <div align="center"> [![npm version](https://img.shields.io/npm/v/nivii?color=7C3AED&label=npm&logo=npm&style=for-the-badge)](https://www.npmjs.com/package/nivii) [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-7C3AED?style=for-the-badge)](https://github.com/Aadigarg111/Nivi-sh/blob/main/LICENSE) [![Made with ❤️](https://img.shields.io/badge/Made_with-❤️-EF4444?style=for-the-badge)](#) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-10B981?style=for-the-badge)](https://github.com/Aadigarg111/Nivi-sh/pulls) ⚡️ The fastest, most beautiful way to share any local dev project. No accounts. No config. Just share. [Website](https://nivii.app) · [npm](https://www.npmjs.com/package/nivii) · [Issues](https://github.com/Aadigarg111/Nivi-sh/issues) </div>
3
+ <img src="https://img.shields.io/badge/⚡_NIVII-7C3AED?style=for-the-badge&labelColor=0a0a0f&color=7C3AED" alt="Nivii" height="40"/>
4
+
5
+ **The fastest way to share any local dev project via a live public URL.**
6
+ No accounts. No config. One command.
7
+
8
+ [![npm version](https://img.shields.io/npm/v/nivii?color=7C3AED&label=npm&logo=npm&style=flat-square)](https://www.npmjs.com/package/nivii)
9
+ [![npm downloads](https://img.shields.io/npm/dm/nivii?color=06B6D4&style=flat-square)](https://www.npmjs.com/package/nivii)
10
+ [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-10B981?style=flat-square)](./LICENSE)
11
+ [![Made with ❤️](https://img.shields.io/badge/Made_with-❤️-EF4444?style=flat-square)](#)
12
+
13
+ [Website](https://nivii.app) · [npm](https://www.npmjs.com/package/nivii) · [Issues](https://github.com/Aadigarg111/Nivi-sh/issues)
14
+
15
+ </div>
4
16
 
5
17
  ---
6
18
 
@@ -8,9 +20,11 @@
8
20
 
9
21
  ```bash
10
22
  npm i -g nivii
11
- # or with pnpm
23
+ ```
24
+
25
+ ```bash
26
+ # or with pnpm / bun
12
27
  pnpm add -g nivii
13
- # or with bun
14
28
  bun add -g nivii
15
29
  ```
16
30
 
@@ -19,294 +33,170 @@ bun add -g nivii
19
33
  ## Quick Start
20
34
 
21
35
  ```bash
22
- # Navigate to any project
23
- cd ~/my-awesome-project
24
-
25
- # Share it instantly
36
+ cd ~/my-project
26
37
  nivii share
27
38
  ```
28
39
 
29
- Example output:
30
-
31
40
  ```
32
- ⚡️ NIVII v0.1.0
33
- 🔍 Detecting project type… ~/my-awesome-project
34
- Detected Next.js (99% confidence)
35
- Build complete (nextjs)
36
- 📦 Compressing project…
37
- ✓ Deployed to edge (xk9m2pqr)
38
- ╭─────────────────────────────────────────────────╮
39
- │ │
40
- 🚀 Your project is live!
41
-
42
- URL: https://xk9m2pqr.nivii.app
43
- Expires: in 48 hours
44
-
45
- ╰─────────────────────────────────────────────────╯
46
- ✓ URL copied to clipboard
47
-
48
- ┌─────────────────────────────────┐
49
- │ Scan to open on mobile │
50
- └─────────────────────────────────┘
41
+ NIVII v0.3.3 · nivii.app
42
+
43
+ Detecting project type…
44
+ Detected Next.js (99% confidence)
45
+ Build complete
46
+ ✓ Deployed to edge
47
+
48
+ ┌──────────────────────────────────────────┐
49
+
50
+ Your project is live 🚀
51
+
52
+ https://xk9m2pqr.nivii.app
53
+ Expires in 48 hours
54
+ │ │
55
+ └──────────────────────────────────────────┘
56
+
57
+ URL copied to clipboard ✓
51
58
  ```
52
59
 
53
60
  ---
54
61
 
55
62
  ## Features
56
63
 
57
- | Emoji | Feature | Description |
58
- |-------|---------|-------------|
59
- | 🔍 | Smart Detection | Auto-detects framework, build command, and output directory |
60
- | ⚡️ | Live Sync | Watch for file changes and auto-redeploy (Pro) |
61
- | 🔒 | Password Protection | Password or OTP-protect any deployment |
62
- | 🔗 | Custom Slugs | Get my-demo.nivii.app instead of random strings (Pro) |
63
- | 📱 | QR Codes | Instant QR code printed in terminal |
64
- | 📋 | Clipboard | URL auto-copied to clipboard |
65
- | 🌐 | Auto-open | Browser opens automatically after deploy |
66
- | 📊 | Analytics | Privacy-first view counts and visitor data (Pro) |
67
- | 💥 | Self-Destruct | Links that expire after N views or a duration |
68
- | 🤝 | Collab Previews | Real-time collaborative previews (Pro) |
69
- | 🌍 | Edge CDN | Deployed on Cloudflare's global network |
70
- | 🎨 | Beautiful UI | Futuristic terminal UI with gradients and spinners |
64
+ | Feature | Description |
65
+ |---------|-------------|
66
+ | 🔍 Smart Detection | Auto-detects framework, build command, output dir |
67
+ | Live Sync | Watch files and auto-redeploy on changes (`--live`) |
68
+ | 🔒 Password Protection | Password or OTP-protect any deployment |
69
+ | 🔗 Custom Slugs | `my-demo.nivii.app` instead of random strings |
70
+ | 📱 QR Codes | Instant QR code in terminal |
71
+ | 📋 Clipboard | URL auto-copied after deploy |
72
+ | 🌐 Auto-open | Browser opens automatically |
73
+ | 📊 Analytics | View counts and visitor data |
74
+ | 💥 Self-Destruct | Links that expire after N views or a duration |
75
+ | 🤝 Collab Previews | Real-time cursor presence for reviewers |
76
+ | 🌍 Edge CDN | Cloudflare's global network |
71
77
 
72
78
  ---
73
79
 
74
- ## All Flags — nivii share
75
-
76
- | Flag | Type | Default | Description |
77
- |------|------|---------|-------------|
78
- | --dir <dir> | string | cwd | Directory to deploy |
79
- | --slug <slug> | string | random | Custom slug — e.g. my-demo → my-demo.nivii.app (Pro) |
80
- | --pass <password> | string | | Password-protect the deployment |
81
- | --otp | boolean | false | Enable one-time password access |
82
- | --expires <duration> | string | 48h | Expiry: 1h / 24h / 7d / 30d / never |
83
- | --live | boolean | false | Enable live sync — watch & auto-redeploy on changes (Pro) |
84
- | --collab | boolean | false | Real-time collaborative preview (Pro) |
85
- | --no-build | boolean | false | Skip build step, use existing output directory |
86
- | --cmd <cmd> | string | auto | Custom build command |
87
- | --port <port> | number | 3000 | Port for server-mode proxy |
88
- | --max-views <n> | number | — | Self-destruct after N views |
89
- | --self-destruct | boolean | false | Destroy after first view |
90
- | --no-qr | boolean | false | Skip QR code display |
91
- | --no-open | boolean | false | Don't auto-open browser |
80
+ ## All Flags
81
+
82
+ ```bash
83
+ nivii share [options]
84
+ ```
85
+
86
+ | Flag | Default | Description |
87
+ |------|---------|-------------|
88
+ | `--dir <dir>` | cwd | Directory to deploy |
89
+ | `--slug <slug>` | random | Custom slug `my-demo.nivii.app` |
90
+ | `--pass <password>` | | Password-protect the deployment |
91
+ | `--otp` | false | One-time password access |
92
+ | `--expires <duration>` | 48h | `1h` / `24h` / `7d` / `30d` / `never` |
93
+ | `--live` | false | Live sync watch & redeploy on changes |
94
+ | `--collab` | false | Real-time collaborative preview |
95
+ | `--no-build` | false | Skip build step |
96
+ | `--cmd <cmd>` | auto | Custom build command |
97
+ | `--max-views <n>` | | Self-destruct after N views |
98
+ | `--self-destruct` | false | Destroy after first view |
99
+ | `--no-qr` | false | Skip QR code display |
100
+ | `--no-open` | false | Don't auto-open browser |
92
101
 
93
102
  ---
94
103
 
95
104
  ## All Commands
96
105
 
97
- ```
98
- nivii share # Deploy current directory
99
- nivii ls # List recent deployments
100
- nivii analytics # View analytics for a deployment
101
- nivii config # View/set config values
102
- nivii whoami # Show current account info
103
- nivii --help # Show all commands
106
+ ```bash
107
+ nivii share # Deploy current directory
108
+ nivii ls # List recent deployments
109
+ nivii analytics # View analytics for a deployment
110
+ nivii config # View/set config values
111
+ nivii whoami # Show current account info
112
+ nivii --help # Show all commands
104
113
  ```
105
114
 
106
115
  ---
107
116
 
108
117
  ## Framework Support
109
118
 
110
- | Framework | Detection | Build Command | Output Directory |
111
- |-----------|-----------|---------------|-----------------|
112
- | Next.js | package.json next dep | npm run build | out / .next |
113
- | Vite | package.json vite dep | npm run build | dist |
114
- | React (CRA) | vite + react deps | npm run build | dist |
115
- | Vue | vite + vue deps | npm run build | dist |
116
- | Svelte | vite + svelte deps | npm run build | dist |
117
- | SvelteKit | @sveltejs/kit dep | npm run build | build |
118
- | Astro | astro dep | npm run build | dist |
119
- | Remix | @remix-run/* deps | npm run build | public |
120
- | Nuxt | nuxt dep | npm run generate | .output/public |
121
- | Solid.js | vite + solid-js deps | npm run build | dist |
122
- | Express | express dep | — (server mode) | . |
123
- | Fastify | fastify dep | — (server mode) | . |
124
- | Hono | hono dep | — (server mode) | . |
125
- | Static HTML | index.html exists | — | . / dist / build |
119
+ | Framework | Build Command | Output Dir |
120
+ |-----------|--------------|------------|
121
+ | Next.js | `npm run build` | `out` / `.next` |
122
+ | Vite | `npm run build` | `dist` |
123
+ | React (CRA) | `npm run build` | `build` |
124
+ | Vue | `npm run build` | `dist` |
125
+ | Svelte | `npm run build` | `dist` |
126
+ | SvelteKit | `npm run build` | `build` |
127
+ | Astro | `npm run build` | `dist` |
128
+ | Remix | `npm run build` | `public` |
129
+ | Nuxt | `npm run generate` | `.output/public` |
130
+ | Static HTML | | `.` |
126
131
 
127
132
  ---
128
133
 
129
134
  ## Architecture
130
135
 
131
- User runs: `nivii share`
132
-
133
- ```
134
- Nivii CLI (Node.js)
135
- 1. detectFramework() → identifies build system
136
- 2. runBuild() → executes build command
137
- 3. zipDirectory() → zips output dir
138
- 4. uploadDeploy() → POST /deploy to API
139
- 5. showQR() → renders QR in terminal
140
- 6. startLiveSync() → WebSocket watcher (--live)
141
- ```
142
-
143
136
  ```
137
+ CLI (Node.js)
138
+ detectFramework() → runBuild() → uploadDeploy() → showQR() → startLiveSync()
139
+
144
140
  api.nivii.app (Cloudflare Worker)
145
- POST /deploy
146
- - Stores metadata in KV (slug, password, expiry…)
147
- - Uploads files to R2 bucket
148
- ```
149
-
150
- ```
151
- Cloudflare R2 (Object Storage) | Cloudflare KV (Metadata + Analytics)
152
- deploys/{slug}/ deploy:{slug} → JSON meta
153
- analytics:{slug} → stats
154
- ```
155
-
156
- ```
157
- *.nivii.app (Cloudflare Worker wildcard routing)
158
- GET xyz.nivii.app/
159
- - Checks KV for metadata (expiry, password, OTP)
160
- - Serves files from R2
161
- - SPA fallback to index.html
141
+ POST /deploy → KV (metadata) + R2 (files)
142
+
143
+ {slug}.nivii.app (Cloudflare Worker wildcard)
144
+ GET → KV metadata check → R2 file serve
162
145
  ```
163
146
 
164
147
  ---
165
148
 
166
- ## Self-Hosting on Cloudflare
149
+ ## Self-Hosting
167
150
 
168
- Deploy your own Nivii instance in ~10 minutes:
151
+ Deploy your own Nivii on Cloudflare in ~10 minutes:
169
152
 
170
- ### Prerequisites
171
- - [Cloudflare account](https://cloudflare.com) (free tier works)
172
- - [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/): `npm i -g wrangler`
173
- - Node.js 18+
174
-
175
- ### Steps
176
-
177
- 1. Clone and install
178
153
  ```bash
154
+ # 1. Clone
179
155
  git clone https://github.com/Aadigarg111/Nivi-sh.git
180
- cd Nivi-sh
181
- npm install
182
- ```
156
+ cd Nivi-sh && npm install
183
157
 
184
- 2. Create Cloudflare resources
185
- ```bash
186
- # Login to Cloudflare
158
+ # 2. Create Cloudflare resources
187
159
  wrangler login
188
-
189
- # Create KV namespace
190
160
  wrangler kv:namespace create "DB"
191
- wrangler kv:namespace create "DB" --preview
192
-
193
- # Create R2 bucket
194
161
  wrangler r2 bucket create nivii-deployments
195
- ```
196
162
 
197
- 3. Update `wrangler.toml`
198
- ```
199
- # packages/worker/wrangler.toml
200
- [[kv_namespaces]]
201
- binding = "DB"
202
- id = "YOUR_ACTUAL_KV_ID"
203
- preview_id = "YOUR_PREVIEW_KV_ID"
204
-
205
- [[r2_buckets]]
206
- binding = "BUCKET"
207
- bucket_name = "nivii-deployments"
208
- ```
163
+ # 3. Update packages/worker/wrangler.toml with your IDs
209
164
 
210
- 4. Deploy the worker
211
- ```bash
212
- cd packages/worker
213
- wrangler deploy
214
- ```
165
+ # 4. Deploy worker
166
+ cd packages/worker && wrangler deploy
215
167
 
216
- 5. Configure DNS
217
- Add a wildcard DNS record:
218
- - Type: CNAME
219
- - Name: *
220
- - Target: your-worker.workers.dev
221
- - Proxy: Enabled (orange cloud)
222
-
223
- 6. Point the CLI at your instance
224
- ```bash
168
+ # 5. Point CLI at your instance
225
169
  export NIVII_API=https://api.your-domain.com
226
- # Or set in config
227
- nivii config apiBase https://api.your-domain.com
228
170
  ```
229
171
 
230
172
  ---
231
173
 
232
174
  ## Configuration
233
175
 
234
- Config is stored at `~/.nivii/config.json`:
176
+ Config stored at `~/.nivii/config.json`:
235
177
 
236
178
  ```json
237
179
  {
238
- "token": "your-pro-token",
239
- "plan": "free",
240
180
  "apiBase": "https://api.nivii.app",
241
181
  "deployments": []
242
182
  }
243
183
  ```
244
184
 
245
- Manage it:
246
- ```
247
- nivii config # show all
248
- nivii config token <tok> # set token
249
- nivii config apiBase <url> # point to self-hosted instance
250
- ```
251
-
252
- ---
253
-
254
- ## Roadmap v2
255
- - [ ] Team workspaces — share deployments with your team
256
- - [ ] Custom domains — deploy to preview.your-company.com
257
- - [ ] GitHub Actions integration — auto-share on every PR
258
- - [ ] VS Code extension — deploy with a keyboard shortcut
259
- - [ ] Mobile app — scan QR codes from Nivii deployments
260
- - [ ] Zip-streaming upload — faster uploads for large projects
261
- - [ ] Screenshot previews — auto-thumbnail for each deployment
262
- - [ ] API keys + webhooks — programmatic deployments
263
- - [ ] Deployment history UI — web dashboard at app.nivii.app
264
- - [ ] SSR support — run Express/Fastify apps in serverless mode
265
- - [ ] Monorepo support — deploy multiple packages at once
266
-
267
- ---
268
-
269
- ## Contributing
270
-
271
- Contributions are welcome! This is an AGPL-3.0 project.
272
-
273
- ### Fork and clone
274
- ```bash
275
- git clone https://github.com/YOUR_USERNAME/Nivi-sh.git
276
- cd Nivi-sh
277
- npm install
278
- ```
279
-
280
- ### Run locally
281
185
  ```bash
282
- # Build CLI
283
- cd packages/cli && npm run build
284
-
285
- # Run the CLI locally
286
- node dist/cli.js share --help
186
+ nivii config # show all
187
+ nivii config apiBase <url> # point to self-hosted instance
287
188
  ```
288
189
 
289
- ### Submitting PRs
290
- 1. Fork the repository
291
- 2. Create a feature branch: `git checkout -b feat/my-feature`
292
- 3. Commit your changes: `git commit -m 'feat: add something cool'`
293
- 4. Push to your fork: `git push origin feat/my-feature`
294
- 5. Open a Pull Request
295
-
296
- Please follow conventional commits and keep PRs focused.
297
-
298
190
  ---
299
191
 
300
192
  ## License
301
193
 
302
- NiviiFuturistic Project Sharing CLI
194
+ [AGPL-3.0](./LICENSE)Copyright (C) 2025 Aadi Garg
303
195
 
304
- Copyright (C) 2025 Aadigarg111
305
-
306
- This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
196
+ ---
307
197
 
308
- [AGPL-3.0](./LICENSE) — See the LICENSE file for full terms.
198
+ <div align="center">
309
199
 
310
- ---
200
+ Made with ❤️ by [Aadi Garg](https://github.com/Aadigarg111) &nbsp;·&nbsp; [nivii.app](https://nivii.app)
311
201
 
312
- <div align="center"> Made with ❤️ by [Aadigarg111](https://github.com/Aadigarg111) ⚡️ [nivii.app](https://nivii.app) · [npm](https://www.npmjs.com/package/nivii) · [GitHub](https://github.com/Aadigarg111/Nivi-sh) </div>
202
+ </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nivii",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "⚡ The fastest, most beautiful way to share any local project via a live URL",
5
5
  "type": "module",
6
6
  "bin": {