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