pinme 2.0.4-beta.1 → 2.0.5-beta.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 +200 -867
  2. package/dist/index.js +637 -152
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,706 +1,195 @@
1
1
  <p align="center">
2
2
  <a href="https://pinme.eth.limo/">
3
- <img src="https://2egc5b44.pinit.eth.limo/" height="92">
3
+ <img src="https://2egc5b44.pinit.eth.limo/" height="92" alt="PinMe logo">
4
4
  <h3 align="center">PinMe</h3>
5
5
  </a>
6
6
  </p>
7
7
 
8
8
  <p align="center">
9
- Deploy your site in one command.
9
+ Create and deploy your web in one command.
10
10
  </p>
11
11
 
12
- <br/>
13
-
14
12
  # PinMe
15
13
 
16
- [PinMe](https://pinme.eth.limo/) is a zero-config frontend deployment tool.
17
- No servers to manage. Minimal setup.
18
-
19
- Build a static site, generate a page with AI, export your frontend, or import CAR files — then deploy instantly with a single command.
20
-
21
- PinMe publishes your site as verifiable content, making silent tampering and accidental breakage far harder than traditional hosting.
14
+ [PinMe](https://pinme.eth.limo/) is a zero-config deployment CLI focused on one-command creation and deployment for full-stack projects.
22
15
 
23
- You don’t manage servers, regions, or uptime.
24
- PinMe handles availability and persistence for you.
16
+ It lets you quickly set up and launch a complete project with an integrated frontend, Worker backend, and database, without tedious configuration. PinMe is built to make full-stack delivery much simpler and significantly improve development efficiency.
25
17
 
26
18
  Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
27
19
 
28
- ---
29
-
30
20
  ## Table of Contents
31
21
 
32
22
  - [Quick Start](#quick-start)
33
- - [For AI](#for-ai)
23
+ - [For AI Agents](#for-ai-agents)
34
24
  - [Installation](#installation)
35
- - [Usage](#usage)
36
- - [Bind Domain](#bind-domain-requires-wallet-balance)
37
- - [Full-Stack Projects](#full-stack-projects)
38
- - [Command Details](#command-details)
39
- - [Wallet Billing](#wallet-billing)
40
- - [Common Static File Directories](#common-static-file-directories)
41
- - [Error Handling](#error-handling)
42
- - [Upload Limits](#upload-limits)
43
- - [GitHub Actions Integration](#github-actions-integration)
44
- - [Contact Us](#contact-us)
45
-
46
- ---
25
+ - [PinMe Project Workflow](#pinme-project-workflow)
26
+ - [Authentication and Account Commands](#authentication-and-account-commands)
27
+ - [Static Uploads and IPFS Utilities](#static-uploads-and-ipfs-utilities)
28
+ - [Command Reference](#command-reference)
29
+ - [Limits and Operational Notes](#limits-and-operational-notes)
30
+ - [Examples](#examples)
31
+ - [Support](#support)
47
32
 
48
33
  ## Quick Start
49
34
 
50
35
  ### Prerequisites
51
- - **Node.js 16.13.0 or higher** required
52
-
53
- ```bash
54
- # Check your Node.js version
55
- node --version
56
- ```
57
-
58
- ### Four Steps to Deploy
59
-
60
- 1. **Install PinMe**
61
- ```bash
62
- npm install -g pinme
63
- ```
64
-
65
- 2. **Login or set AppKey**
66
- ```bash
67
- # Recommended: browser login
68
- pinme login
69
-
70
- # Or use an AppKey in CLI/CI environments
71
- pinme set-appkey <AppKey>
72
- ```
73
36
 
74
- 3. **Build your project** (if not already built)
75
- ```bash
76
- # For Vite/React/Vue projects
77
- npm run build
37
+ - Node.js `>= 16.13.0`
78
38
 
79
- # For Next.js (static export)
80
- npm run build
81
- ```
82
-
83
- 4. **Upload to PinMe**
84
- ```bash
85
- # Upload the dist directory (most common)
86
- pinme upload dist
87
-
88
- # Or upload build directory
89
- pinme upload build
90
- ```
91
-
92
- That's it! PinMe prints the best available public URL. If no domain is available, it falls back to a preview URL like `https://pinme.eth.limo/#/preview/*`.
93
-
94
- ---
95
-
96
- ## For AI
97
-
98
- This section provides AI-specific instructions for deploying websites using PinMe CLI.
99
-
100
- ### AI Execution Protocol
101
-
102
- **Goal:** Use PinMe CLI to upload static files to PinMe/IPFS and return the final public URL.
103
-
104
- #### Required Steps
105
-
106
- 1. **Check Environment Requirements**
107
- ```bash
108
- # Check Node.js version (requires 16.13.0+)
109
- node --version
110
- ```
111
-
112
- 2. **Install PinMe CLI** (if not installed)
113
- ```bash
114
- npm install -g pinme
115
- ```
116
-
117
- 3. **Authenticate before upload**
118
- ```bash
119
- # Recommended
120
- pinme login
121
-
122
- # Or for automation / non-browser environments
123
- pinme set-appkey <AppKey>
124
- ```
125
-
126
- 4. **Identify the Static File Directory**
127
- Priority order to check:
128
- - `dist/` - Default output directory for Vue/React/Vite projects
129
- - `build/` - Output directory for Create React App
130
- - `out/` - Output directory for Next.js static export
131
- - `public/` - Pure static file projects
132
-
133
- **Validation Rules:**
134
- - Folder must exist
135
- - Must contain `index.html` file (for website deployment)
136
- - Must contain actual static resource files (CSS, JS, images, etc.)
137
-
138
- If no suitable folder is found, ask the user to specify the upload path.
139
-
140
- **Router Mode Check:**
141
- - Ensure the project uses **hash mode** router (e.g., `/#/about`)
142
- - History mode (e.g., `/about`) will cause 404 on sub-routes when deployed to IPFS
143
- - For React: use `HashRouter` instead of `BrowserRouter`
144
- - For Vue: use `createHashHistory()` instead of `createWebHistory()`
145
-
146
- 5. **Execute Deployment Command**
147
- ```bash
148
- pinme upload <folder_path>
149
- ```
150
-
151
- 6. **Return Result**
152
- - Only return the final URL printed by PinMe
153
- - URL priority is: DNS domain > Pinme subdomain > short URL > hash preview URL
154
- - Hash fallback format: `https://pinme.eth.limo/#/preview/*`
155
- - Do not output additional logs or intermediate steps
156
-
157
- #### Prohibited Operations
158
-
159
- - ❌ Do not upload `node_modules`, `.env`, `.git` directories
160
- - ❌ Do not upload source code directories (like `src/`)
161
- - ❌ Do not upload config files (like package.json, tsconfig.json, etc.)
162
- - ❌ Do not attempt to upload non-existent or empty folders
163
-
164
- ### Machine-Readable Configuration
165
-
166
- For easy AI tool parsing:
167
-
168
- ```json
169
- {
170
- "tool": "pinme",
171
- "requirements": {
172
- "node_version": ">=16.13.0"
173
- },
174
- "install": "npm install -g pinme",
175
- "login": "pinme login",
176
- "set_appkey": "pinme set-appkey <AppKey>",
177
- "auth_required_for_upload": true,
178
- "upload": "pinme upload {{directory}}",
179
- "upload_with_domain": "pinme upload {{directory}} --domain {{domain}}",
180
- "upload_with_dns": "pinme upload {{directory}} --domain {{domain}} --dns",
181
- "validDirectories": ["dist", "build", "out", "public"],
182
- "requiredFiles": ["index.html"],
183
- "excludePatterns": ["node_modules", ".env", ".git", "src"],
184
- "limits": {
185
- "single_file": "200MB",
186
- "total_directory": "1GB"
187
- },
188
- "output": "public_url",
189
- "url_priority": ["dns_domain", "pinme_domain", "short_url", "hash_preview_url"],
190
- "preview_url_format": "https://pinme.eth.limo/#/preview/*",
191
- "pinme_domain_format": "https://<name>.<root-domain>",
192
- "dns_domain_format": "https://<your-domain>",
193
- "other_commands": {
194
- "version": "pinme --version",
195
- "list": "pinme list",
196
- "import": "pinme import <car-file>",
197
- "export": "pinme export <cid>",
198
- "set_appkey": "pinme set-appkey",
199
- "show_appkey": "pinme show-appkey",
200
- "my_domains": "pinme my-domains",
201
- "wallet": "pinme wallet",
202
- "bind": "pinme bind <path> --domain <domain>",
203
- "create": "pinme create <project-name>",
204
- "save": "pinme save",
205
- "update_db": "pinme update-db",
206
- "update_worker": "pinme update-worker",
207
- "update_web": "pinme update-web",
208
- "delete": "pinme delete <project-name>",
209
- "remove": "pinme rm <hash>",
210
- "logout": "pinme logout",
211
- "help": "pinme help"
212
- }
213
- }
214
- ```
215
-
216
- ### AI Usage Template
217
-
218
- > **Deployment Request:**
219
- > Please read the PinMe documentation, then use PinMe CLI to deploy the specified website by uploading static files to PinMe/IPFS.
220
- >
221
- > **Operation Steps:**
222
- > 1. Check Node.js version (requires 16.13.0+)
223
- > 2. Check if pinme is installed, install if not
224
- > 3. Authenticate with `pinme login` or `pinme set-appkey <AppKey>`
225
- > 4. Identify the static file directory for the website to deploy
226
- > 5. Execute deployment command
227
- > 6. Return the final public URL printed by PinMe. If no custom URL is available, return the preview page link: `https://pinme.eth.limo/#/preview/*`
228
-
229
- ---
230
-
231
- ## Installation
232
-
233
- ### Using npm
39
+ ### Create a new Worker project
234
40
 
235
41
  ```bash
236
42
  npm install -g pinme
237
- ```
238
-
239
- ### Using yarn
240
-
241
- ```bash
242
- yarn global add pinme
243
- ```
244
-
245
- ### Verify Installation
246
-
247
- ```bash
248
- # Check PinMe version
249
- pinme --version
250
- ```
251
-
252
- ---
253
-
254
- ## Usage
255
-
256
- ### Upload Files or Directories
257
-
258
- ```bash
259
- # Login is required before upload
260
- pinme login
261
-
262
- # Interactive upload
263
- pinme upload
264
-
265
- # Specify path directly
266
- pinme upload /path/to/file-or-directory
267
- ```
268
-
269
- **Authentication requirement:** `pinme upload` and `pinme import` require a valid login session or AppKey. Use `pinme login` for browser login, or `pinme set-appkey <AppKey>` for CLI/CI environments.
270
-
271
- ### Bind Domain (requires wallet balance)
272
-
273
- ```bash
274
- # Upload and bind to a domain (auto-detected: Pinme subdomain or DNS domain)
275
- pinme upload <path> --domain <name>
276
- pinme upload <path> -d <name>
277
- ```
278
-
279
- **Smart Auto-Detection:**
280
- - Domains with a dot (e.g., `example.com`) → **DNS domain**
281
- - Domains without a dot (e.g., `my-site`) → **Pinme subdomain**
282
-
283
- **Examples:**
284
- ```bash
285
- # Bind to a Pinme subdomain (auto-detected)
286
- pinme upload ./dist --domain my-site
287
-
288
- # Bind to a DNS domain (auto-detected by the dot)
289
- pinme upload ./dist --domain example.com
290
-
291
- # Force DNS mode if needed
292
- pinme upload ./dist --domain my-site --dns
293
- ```
294
-
295
- ### Full-Stack Projects
296
-
297
- PinMe can also create and deploy a full-stack project template with frontend, Worker backend, and database migrations.
298
-
299
- ```bash
300
- # Login with the browser-based flow
301
43
  pinme login
302
-
303
- # Create a new project from the PinMe worker template
304
44
  pinme create my-app
305
-
306
- # Enter the project and deploy frontend + backend + database
307
45
  cd my-app
308
46
  pinme save
309
47
  ```
310
48
 
311
- Use targeted update commands when only one layer changed:
49
+ What this workflow gives you:
312
50
 
313
- ```bash
314
- # Deploy frontend only
315
- pinme update-web
51
+ - a generated PinMe project from the official template
52
+ - platform-side Worker and database provisioning
53
+ - local project config in `pinme.toml`
54
+ - frontend and Worker deployment from one CLI
316
55
 
317
- # Deploy backend Worker only
318
- pinme update-worker
319
-
320
- # Run database SQL migrations only
321
- pinme update-db
322
- ```
323
-
324
- Delete a platform project when needed:
56
+ ### Update only the part you changed
325
57
 
326
58
  ```bash
327
- # From a PinMe project directory
328
- pinme delete
329
-
330
- # Or specify a project name
331
- pinme delete my-app
332
-
333
- # Skip confirmation
334
- pinme delete my-app --force
59
+ pinme update-worker
60
+ pinme update-db
61
+ pinme update-web
335
62
  ```
336
63
 
337
- ### Import CAR files
64
+ ### Upload a static build when you do not need the project workflow
338
65
 
339
66
  ```bash
340
- # Login is required before import
341
67
  pinme login
342
-
343
- # Interactive CAR import
344
- pinme import
345
-
346
- # Specify CAR file path directly
347
- pinme import /path/to/car-file.car
348
-
349
- # Import CAR file and bind to a domain
350
- pinme import /path/to/car-file.car --domain <name>
351
- pinme import /path/to/car-file.car -d <name>
68
+ pinme upload dist
352
69
  ```
353
70
 
354
- ### Export IPFS Content as CAR files
71
+ Common build directories are `dist`, `build`, `out`, and `public`.
355
72
 
356
- ```bash
357
- # Interactive CAR export
358
- pinme export
73
+ ## For AI Agents
359
74
 
360
- # Specify CID directly
361
- pinme export <CID>
75
+ Prefer the PinMe project workflow when the user wants a frontend plus backend plus database, or when the repo already contains `pinme.toml`.
362
76
 
363
- # Export with custom output path
364
- pinme export <CID> --output /path/to/output.car
365
- pinme export <CID> -o /path/to/output.car
366
- ```
77
+ ### Project-mode protocol
367
78
 
368
- **Note:** By default, exported CAR files are saved to your system's Downloads directory.
79
+ Use this flow when the user wants a Worker app, database migrations, or ongoing project updates.
369
80
 
370
- ### View Upload History
81
+ 1. Check Node.js:
371
82
 
372
83
  ```bash
373
- # Show the last 10 upload records
374
- pinme list
375
-
376
- # Or use the shorthand command
377
- pinme ls
378
-
379
- # Limit the number of records shown
380
- pinme list -l 5
381
-
382
- # Clear all upload history
383
- pinme list -c
84
+ node --version
384
85
  ```
385
86
 
386
- ### Remove Files from IPFS
87
+ 2. Ensure the CLI is available:
387
88
 
388
89
  ```bash
389
- # Interactive removal
390
- pinme rm
391
-
392
- # Remove a specific file by hash
393
- pinme rm <IPFS_hash>
90
+ npm install -g pinme
394
91
  ```
395
92
 
396
- ### Authentication (AppKey)
93
+ 3. Authenticate:
397
94
 
398
95
  ```bash
399
- # Browser login, recommended for full-stack project commands
400
96
  pinme login
401
-
402
- # Use a specific environment when needed
403
- pinme login --env test
404
-
405
- # Set AppKey for login and domain binding
406
- pinme set-appkey
407
-
408
- # View current AppKey info (masked)
409
- pinme show-appkey
410
- pinme appkey
411
-
412
- # Log out
413
- pinme logout
414
-
415
- # View your domains
416
- pinme my-domains
417
- pinme domain
418
-
419
- # View wallet balance
420
- pinme wallet
421
- pinme wallet-balance
422
- pinme balance
423
- ```
424
-
425
- ### Get Help
426
-
427
- ```bash
428
- # Display help information
429
- pinme help
430
- ```
431
-
432
- ---
433
-
434
- ## 📁 Common Static File Directories
435
-
436
- ### Automatic Detection
437
-
438
- PinMe automatically detects these common output directories (in priority order):
439
-
440
- | Directory | Framework/Tool | Description |
441
- |-----------|---------------|-------------|
442
- | `dist/` | Vite, Vue CLI, Angular | Default output directory |
443
- | `build/` | Create React App | CRA output directory |
444
- | `out/` | Next.js | Static export output |
445
- | `public/` | Static sites | Pure static file projects |
446
-
447
- ### Validation Rules
448
-
449
- The selected directory must meet:
450
- - ✅ Folder exists
451
- - ✅ Contains `index.html` file (for website deployment)
452
- - ✅ Contains actual static resource files (CSS, JS, images, etc.)
453
-
454
- ### What NOT to Upload
455
-
456
- - ❌ `node_modules/` - Dependency folder
457
- - ❌ `.git/` - Version control
458
- - ❌ `.env` - Environment configuration
459
- - ❌ `src/` - Source code directory
460
- - ❌ `package.json`, `tsconfig.json` - Config files
461
-
462
- ---
463
-
464
- ## Command Details
465
-
466
- ### `bind`
467
-
468
- Upload files and bind them to a custom domain. **Domain binding deducts from your wallet balance.**
469
-
470
- ```bash
471
- pinme bind [path] [options]
472
- ```
473
-
474
- **Options:**
475
- - `path`: Path to the file or directory to upload (optional, interactive if not provided)
476
- - `-d, --domain <name>`: Domain name to bind (required)
477
- - `--dns`: Force DNS domain mode (optional, auto-detected from domain format)
478
-
479
- **Examples:**
480
- ```bash
481
- # Interactive mode (will prompt for path and domain)
482
- pinme bind
483
-
484
- # Bind a path with the dedicated bind command
485
- pinme bind ./dist --domain my-site
486
-
487
- # Bind to a Pinme subdomain (auto-detected: no dot in domain)
488
- pinme upload ./dist --domain my-site
489
-
490
- # Bind to a DNS domain (auto-detected: contains dot)
491
- pinme upload ./dist --domain example.com
492
-
493
- # Force DNS mode with --dns flag
494
- pinme upload ./dist --domain my-site --dns
495
97
  ```
496
98
 
497
- **Auto-Detection:**
498
- - Domains with a dot (e.g., `example.com`) are automatically treated as **DNS domains**
499
- - Domains without a dot (e.g., `my-site`) are automatically treated as **Pinme subdomains**
500
- - Use `--dns` or `-D` flag to force DNS domain mode when needed
501
-
502
- **Requirements:**
503
- - Login or AppKey authentication is required before upload/bind
504
- - Sufficient wallet balance is required for domain binding
505
- - Valid AppKey must be set (run: `pinme set-appkey <AppKey>`)
506
- - For DNS domains, you must own the domain
507
-
508
- **URL Formats:**
509
- - Pinme subdomain: `https://<name>.<root-domain>`
510
- - DNS domain: `https://<your-domain>`
511
-
512
- **DNS Setup:**
513
- After successful DNS domain binding, visit the [DNS Configuration Guide](https://pinme.eth.limo/#/docs?id=custom-domain) to complete DNS setup.
514
-
515
- ### `upload`
516
-
517
- Upload a file or directory to the IPFS network.
518
-
519
- ```bash
520
- pinme upload [path] [--domain <name>]
521
- ```
522
-
523
- **Options:**
524
- - `path`: Path to the file or directory to upload (optional, interactive if not provided)
525
- - `-d, --domain <name>`: Pinme subdomain or DNS domain to bind after upload (optional, requires wallet balance)
526
- - `--dns`, `-D`: Force DNS domain mode
527
-
528
- **Authentication:** This command requires login. Run `pinme login` first, or configure `pinme set-appkey <AppKey>`.
529
-
530
- **Examples:**
531
- ```bash
532
- # Upload dist directory
533
- pinme upload dist
534
-
535
- # Upload only (no domain binding)
536
- pinme upload dist
99
+ 4. Choose the right project command:
537
100
 
538
- # Upload a specific file
539
- pinme upload ./example.jpg
540
- ```
101
+ - create a new project: `pinme create <name>`
102
+ - deploy everything from a PinMe project root: `pinme save`
103
+ - update Worker only: `pinme update-worker`
104
+ - update SQL migrations only: `pinme update-db`
105
+ - update frontend only: `pinme update-web`
541
106
 
542
- **Note:** Domain binding during upload requires available wallet balance. Use the `bind` command for domain binding.
107
+ 5. If the repo contains `pinme.toml`, run project commands from that directory.
543
108
 
544
- **Printed URL priority:** PinMe displays the best available final URL in this order:
545
- 1. DNS domain, for example `https://example.com`
546
- 2. Pinme subdomain, for example `https://my-site.<root-domain>`
547
- 3. Short URL returned by the upload service
548
- 4. Hash preview URL, for example `https://pinme.eth.limo/#/preview/*`
109
+ 6. Return the final project URL printed by the CLI for frontend deploys. For Worker-only or DB-only updates, return the relevant success result instead of fabricating a URL.
549
110
 
550
- When the backend returns a Pinme subdomain without the root domain, the CLI automatically appends the current root domain before printing it.
111
+ ### Static-upload fallback
551
112
 
552
- ### `import`
113
+ Use this only when the task is just "publish the built frontend" and there is no PinMe project workflow involved.
553
114
 
554
- Import CAR (Content Addressable aRchive) files to the IPFS network. This command is specifically designed for importing CAR files while maintaining their original structure. Supports binding to a Pinme subdomain after import.
115
+ 1. Authenticate:
555
116
 
556
117
  ```bash
557
- pinme import [path] [--domain <name>]
118
+ pinme login
558
119
  ```
559
120
 
560
- **Options:**
561
- - `path`: Path to the CAR file to import (optional, if not provided, interactive mode will be entered)
562
- - `-d, --domain <name>`: Pinme subdomain to bind after import (optional)
563
-
564
- **Authentication:** This command requires login. Run `pinme login` first, or configure `pinme set-appkey <AppKey>`.
121
+ Or for automation:
565
122
 
566
- **Examples:**
567
123
  ```bash
568
- # Interactive CAR import
569
- pinme import
570
-
571
- # Import a specific CAR file
572
- pinme import ./my-archive.car
573
-
574
- # Import CAR file and bind to a domain
575
- pinme import ./my-archive.car --domain my-archive
576
- pinme import ./my-archive.car -d my-archive
124
+ pinme set-appkey <AppKey>
577
125
  ```
578
126
 
579
- **Key Differences from `upload`:**
580
- - CAR files are imported with their original structure preserved
581
- - Uses IPFS CAR import protocol for efficient content addressing
582
- - Ideal for importing previously exported IPFS content
583
- - Same domain binding and management features as `upload`
584
-
585
- ### `export`
127
+ 2. Find the built output directory in this order:
586
128
 
587
- Export IPFS content as a CAR (Content Addressable aRchive) file.
129
+ - `dist/`
130
+ - `build/`
131
+ - `out/`
132
+ - `public/`
588
133
 
589
- ```bash
590
- pinme export [CID] [--output <path>]
591
- ```
134
+ 3. Verify the directory exists and contains built assets such as `index.html`.
592
135
 
593
- **Options:**
594
- - `CID`: IPFS content identifier (CID) to export (optional, interactive if not provided)
595
- - `-o, --output <path>`: Output file path for the CAR file (optional, defaults to Downloads directory)
136
+ 4. Upload it:
596
137
 
597
- **Examples:**
598
138
  ```bash
599
- # Interactive CAR export
600
- pinme export
601
-
602
- # Export a specific CID
603
- pinme export bafybeiakzpeep2jw5cvsyfa66nqxmjurmarw3a34moxpgrbz7s75v7nune
604
-
605
- # Export with custom output path
606
- pinme export bafybeiakzpeep2jw5cvsyfa66nqxmjurmarw3a34moxpgrbz7s75v7nune --output ./my-export.car
607
- pinme export bafybeiakzpeep2jw5cvsyfa66nqxmjurmarw3a34moxpgrbz7s75v7nune -o ./my-export.car
139
+ pinme upload <folder>
608
140
  ```
609
141
 
610
- **Features:**
611
- - Exports IPFS content as CAR files for backup or migration
612
- - Default output location: system Downloads directory (`~/Downloads` on macOS/Linux, `%USERPROFILE%\Downloads` on Windows)
613
- - Supports interactive mode for easy CID input
614
- - Shows progress during export generation and file download
615
- - CAR files preserve original content structure and CID relationships
142
+ ### Guardrails
616
143
 
617
- **Note:** Export is an asynchronous process. The command will:
618
- 1. Request export task creation
619
- 2. Poll export status (every 5 seconds) until completion
620
- 3. Download the generated CAR file to your specified location
144
+ - Do not upload source folders such as `src/`.
145
+ - Do not upload `node_modules`, `.git`, or `.env`.
146
+ - Do not claim unsupported backend hosting outside the PinMe project template flow.
147
+ - For project commands, do not run `update-*` commands outside a PinMe project root with `pinme.toml`.
621
148
 
622
- ### `rm`
149
+ ## Installation
623
150
 
624
- Remove a file from the IPFS network.
151
+ Install from npm:
625
152
 
626
153
  ```bash
627
- pinme rm [hash]
154
+ npm install -g pinme
628
155
  ```
629
156
 
630
- **Note:** This unpins content from our IPFS node and deletes the ENS subdomain record. It does not guarantee removal from the entire IPFS network.
631
-
632
- ### `list` / `ls`
633
-
634
- Display upload history.
157
+ Verify installation:
635
158
 
636
159
  ```bash
637
- pinme list [options]
160
+ pinme --version
638
161
  ```
639
162
 
640
- **Options:**
641
- - `-l, --limit <number>`: Limit the number of records displayed
642
- - `-c, --clear`: Clear all upload history
163
+ ## PinMe Project Workflow
643
164
 
644
- ### `set-appkey`
165
+ ### What `create` sets up
645
166
 
646
- Set AppKey for authentication and automatically merge anonymous upload history to the current account.
647
-
648
- ```bash
649
- pinme set-appkey [AppKey]
650
- ```
167
+ `pinme create <name>` does more than scaffold files. The command:
651
168
 
652
- **Note:** Domain binding requires authentication and sufficient wallet balance. Get your AppKey from [PinMe website](https://pinme.eth.limo/) or use `pinme login`.
169
+ - requires an authenticated session
170
+ - creates the platform project resources first
171
+ - downloads the official Worker project template
172
+ - writes project metadata into `pinme.toml`
173
+ - writes backend metadata and frontend config files
174
+ - installs workspace dependencies
175
+ - builds the Worker
176
+ - uploads Worker code and SQL files
177
+ - builds the frontend and attempts an initial frontend upload
653
178
 
654
- ### `login`
179
+ After creation, the CLI prints the project management URL and suggests `pinme save` for the next deploy.
655
180
 
656
- Start the browser-based login flow. After login, anonymous upload history is merged into the logged-in account.
181
+ ### Create a project
657
182
 
658
183
  ```bash
659
184
  pinme login
660
- pinme login --env test
661
- ```
662
-
663
- ### `show-appkey` / `appkey`
664
-
665
- Display current AppKey information with masked sensitive data.
666
-
667
- ### `logout`
668
-
669
- Log out and clear authentication information from local storage.
670
-
671
- ### `my-domains` / `domain`
672
-
673
- List all domains owned by the current account.
674
-
675
- ### `wallet` / `wallet-balance` / `balance`
676
-
677
- Show the current wallet balance for the logged-in account.
678
-
679
- ```bash
680
- pinme wallet
681
- pinme wallet-balance
682
- pinme balance
683
- ```
684
-
685
- ### `create`
686
-
687
- Create a new full-stack project from the PinMe Worker template. This creates the platform Worker/database, downloads the template, installs dependencies, injects API configuration, builds the frontend, uploads it, and writes project settings to `pinme.toml`.
688
-
689
- ```bash
690
- pinme create [name]
691
185
  pinme create my-app
692
- pinme create my-app --force
693
186
  ```
694
187
 
695
- **Project layout:**
696
- - `frontend/`: Static frontend application
697
- - `backend/`: Worker backend source and metadata
698
- - `db/`: SQL migration files
699
- - `pinme.toml`: Project name and deployed frontend URL
188
+ If the target directory already exists, the CLI asks before overwriting it unless `--force` is used.
700
189
 
701
- ### `save`
190
+ ### Deploy the whole project
702
191
 
703
- Deploy the current full-stack project from its root directory. It installs dependencies, builds and saves the Worker, applies SQL files from `db/`, builds `frontend/`, uploads `frontend/dist`, and updates `pinme.toml` with the final frontend URL.
192
+ Run this from the project root that contains `pinme.toml`:
704
193
 
705
194
  ```bash
706
195
  pinme save
@@ -708,33 +197,32 @@ pinme save --domain my-site
708
197
  pinme save --domain example.com
709
198
  ```
710
199
 
711
- ### `update-web`
712
-
713
- Build and deploy only the frontend from `frontend/`.
200
+ `save` performs the full deploy path:
714
201
 
715
- ```bash
716
- pinme update-web
717
- ```
202
+ - installs project dependencies
203
+ - builds the Worker with `npm run build:worker`
204
+ - uploads Worker code and SQL files from `db/`
205
+ - builds the frontend with `npm run build:frontend`
206
+ - uploads `frontend/dist`
207
+ - optionally binds a domain after the frontend deploy
718
208
 
719
- ### `update-worker`
209
+ ### Update only one layer
720
210
 
721
- Build and deploy only the Worker from `backend/`. SQL files and frontend assets are not processed.
211
+ Use targeted commands when only one part changed:
722
212
 
723
213
  ```bash
724
214
  pinme update-worker
725
- ```
726
-
727
- ### `update-db`
728
-
729
- Upload and execute SQL migrations from the `db/` directory. The total SQL payload is limited to 10MB per run.
730
-
731
- ```bash
732
215
  pinme update-db
216
+ pinme update-web
733
217
  ```
734
218
 
735
- ### `delete`
219
+ What each command expects:
220
+
221
+ - `update-worker`: builds and uploads Worker code from the current PinMe project
222
+ - `update-db`: uploads `.sql` files from `db/`
223
+ - `update-web`: builds and uploads `frontend/dist`
736
224
 
737
- Delete a platform project, including Worker, domain binding, and D1 database. Local files are kept unchanged.
225
+ ### Delete a project
738
226
 
739
227
  ```bash
740
228
  pinme delete
@@ -742,290 +230,135 @@ pinme delete my-app
742
230
  pinme delete my-app --force
743
231
  ```
744
232
 
745
- ---
746
-
747
- ## Wallet Billing
748
-
749
- ### Overview
750
-
751
- PinMe now uses wallet balance for paid capabilities such as domain binding and custom DNS support.
752
-
753
- ### Domain Binding Requirements
754
-
755
- Domain binding (both Pinme subdomains and custom DNS domains) requires sufficient wallet balance.
756
-
757
- **Before using domain binding:**
233
+ This deletes the platform-side Worker, domain binding, and D1 database. Local files remain unchanged.
758
234
 
759
- 1. **Recharge your wallet**
760
- - Visit [PinMe website](https://pinme.eth.limo/) to top up your balance
235
+ ## Authentication and Account Commands
761
236
 
762
- 2. **Set AppKey**
763
- ```bash
764
- pinme set-appkey <AppKey>
765
- ```
237
+ ### Login and AppKey
766
238
 
767
- 3. **Bind your domain**
768
- ```bash
769
- # Bind to a Pinme subdomain
770
- pinme upload ./dist --domain my-site
771
-
772
- # Bind to a custom DNS domain
773
- pinme upload ./dist --domain example.com --dns
774
- ```
775
-
776
- ### Checking Wallet Balance
777
-
778
- If you attempt to bind a domain without enough balance, you'll see an error message. You can check or recharge your wallet on the [PinMe website](https://pinme.eth.limo/).
779
-
780
- ---
781
-
782
- ## Error Handling
783
-
784
- ### Common Errors and Solutions
785
-
786
- #### 1. Node.js Version Too Low
787
- ```
788
- Error: Node.js version not supported
789
- ```
790
- **Solution:** Upgrade to Node.js 16.13.0 or higher
239
+ ```bash
240
+ pinme login
241
+ pinme login --env test
791
242
 
792
- #### 2. Command Not Found
793
- ```
794
- Error: command not found: pinme
795
- ```
796
- **Solution:** Run `npm install -g pinme`
243
+ pinme set-appkey
244
+ pinme set-appkey <AppKey>
797
245
 
798
- #### 3. Folder Does Not Exist
799
- ```
800
- Error: No such file or directory
801
- ```
802
- **Solution:** Check if path is correct, or use `ls` command to view available directories
246
+ pinme show-appkey
247
+ pinme appkey
803
248
 
804
- #### 4. Permission Error
805
- ```
806
- Error: Permission denied
249
+ pinme logout
807
250
  ```
808
- **Solution:** Check folder permissions, or use sudo (only when necessary)
809
-
810
- #### 5. Upload Failed
811
- - Check network connection
812
- - Confirm file size is within limits (single file 200MB, total directory 1GB)
813
- - Retry upload command
814
-
815
- #### 6. Authentication Failed
816
- - Check if AppKey is set correctly
817
- - Confirm AppKey format: `<address>-<jwt>`
818
- - Use `pinme show-appkey` to check current status
819
-
820
- ---
821
-
822
- ## Upload Limits
823
-
824
- | Type | Free Plan |
825
- |------|-----------|
826
- | Single file | 200MB |
827
- | Total directory | 1GB |
828
-
829
- ### File Storage
830
-
831
- Uploaded files are stored on the IPFS network and accessible through the Glitter Protocol's IPFS gateway.
832
251
 
833
- **After successful upload, you receive:**
834
- 1. IPFS content hash
835
- 2. Final public URL, selected by priority: DNS domain > Pinme subdomain > short URL > hash preview URL
836
- 3. Hash preview fallback: `https://pinme.eth.limo/#/preview/*`
252
+ Notes:
837
253
 
838
- ### Log Locations
254
+ - `pinme login` is the recommended path for project commands.
255
+ - `set-appkey` is the alternative authentication method for CLI and automation usage.
839
256
 
840
- - Linux/macOS: `~/.pinme/`
841
- - Windows: `%USERPROFILE%\.pinme\`
257
+ ### Domains, wallet, and history
842
258
 
843
- ---
844
-
845
- ## PinMe Platform Features
846
-
847
- ### Preview Page
848
- - Access uploaded website via preview link: `https://pinme.eth.limo/#/preview/*`
849
- - Get a Pinme subdomain: `https://<name>.<root-domain>`
850
- - Use a custom DNS domain: `https://<your-domain>`
851
-
852
- ### Login and Management
853
- - Support browser login and AppKey-based authentication
854
- - View historical upload records
855
- - Manage uploaded files
856
-
857
- ### Address Binding
858
- - Bind uploads to fixed addresses (requires authentication and wallet balance)
859
- - Convenient for long-term maintenance and access
860
- - Requires `pinme login` or AppKey setup
861
-
862
- ---
863
-
864
- ## Usage Tips
865
-
866
- ### Uploading Vite Projects
259
+ ```bash
260
+ pinme my-domains
261
+ pinme domain
867
262
 
868
- When uploading projects built with Vite, ensure proper asset path resolution:
263
+ pinme wallet
264
+ pinme wallet-balance
265
+ pinme balance
869
266
 
870
- ```js
871
- // vite.config.js
872
- export default {
873
- base: './',
874
- // other configurations...
875
- };
267
+ pinme list
268
+ pinme ls
269
+ pinme list -l 5
270
+ pinme list -c
876
271
  ```
877
272
 
878
- ### Working with CAR Files
879
-
880
- PinMe supports both importing and exporting CAR (Content Addressable aRchive) files:
881
-
882
- #### Importing CAR Files
273
+ ## Static Uploads and IPFS Utilities
883
274
 
884
- When using the `import` command for CAR files:
275
+ These commands are useful when you already have artifacts and do not need the full Worker project flow.
885
276
 
886
- 1. **CAR File Format**: Ensure your files have the `.car` extension and follow the IPFS CAR specification
887
- 2. **Content Integrity**: CAR files preserve the original content structure and CID relationships
888
- 3. **Use Cases**: Ideal for importing previously exported IPFS content, migrating between IPFS nodes, or batch content transfers
889
- 4. **Size Considerations**: CAR files can be large, ensure you have sufficient bandwidth and storage space
890
-
891
- #### Exporting CAR Files
892
-
893
- When using the `export` command:
894
-
895
- 1. **Export Process**: Export is asynchronous - the command will create an export task and poll for completion
896
- 2. **Output Location**: By default, exported CAR files are saved to your system's Downloads directory
897
- 3. **Custom Path**: Use `--output` or `-o` to specify a custom output location
898
- 4. **CID Format**: Supports CIDv0 (starting with `Qm`) and CIDv1 (starting with `bafy`, `bafk`, or `bafz`)
899
- 5. **Use Cases**: Backup IPFS content, migrate content between nodes, or archive specific IPFS content
900
-
901
- #### CAR File Workflow
277
+ ### Upload a directory or file
902
278
 
903
279
  ```bash
904
- # Export IPFS content to CAR file
905
- pinme export <CID>
906
-
907
- # Later, import the CAR file back to IPFS
908
- pinme import ~/Downloads/<CID>.car
909
- ```
910
-
911
- ### Best Practices
912
-
913
- 1. **Pre-upload Checks**
914
- - Confirm build process completed
915
- - Verify output directory exists and contains expected files
916
-
917
- 2. **Security**
918
- - Do not upload sensitive information
919
- - Avoid uploading development config files
920
-
921
- 3. **Performance Optimization**
922
- - Compress images and resource files
923
- - Remove unnecessary files
924
-
925
- 4. **Verify Deployment**
926
- - Test if preview page is accessible after upload
927
- - Check if website functions normally
928
- - **Ensure router is configured to use hash mode** (e.g., `/#/path` instead of `/path`)
929
-
930
- ---
931
-
932
- ## GitHub Actions Integration
933
-
934
- PinMe can be integrated with GitHub Actions for automated CI/CD deployment.
935
-
936
- ### Quick Setup
937
-
938
- 1. **Add workflow file** to your repository:
939
- - Create `.github/workflows/deploy.yml`
940
-
941
- 2. **Configure GitHub Secrets:**
942
- - Go to repository → Settings → Secrets and variables → Actions
943
- - Add `PINME_APPKEY` with your PinMe AppKey
944
- - (Optional) Add `PINME_DOMAIN` for custom domain
945
-
946
- 3. **Push to trigger deployment:**
947
- - Push to `main` or `master` branch
948
- - Or manually trigger via Actions tab
949
-
950
- ### Example Workflow
951
-
952
- ```yaml
953
- name: Deploy to PinMe
954
-
955
- on:
956
- push:
957
- branches: [main, master]
958
- workflow_dispatch:
959
- inputs:
960
- domain:
961
- description: 'PinMe domain name'
962
- required: true
963
- build_dir:
964
- description: 'Build directory'
965
- default: 'dist'
966
-
967
- jobs:
968
- deploy:
969
- runs-on: ubuntu-latest
970
- steps:
971
- - uses: actions/checkout@v4
972
- - uses: actions/setup-node@v4
973
- with:
974
- node-version: '18'
975
- - run: npm ci
976
- - run: npm run build
977
- - run: npm install -g pinme
978
- - run: pinme set-appkey "${{ secrets.PINME_APPKEY }}"
979
- - run: pinme upload dist --domain "${{ secrets.PINME_DOMAIN }}"
280
+ pinme upload
281
+ pinme upload ./dist
282
+ pinme upload ./dist --domain my-site
283
+ pinme upload ./dist --domain example.com
284
+ pinme upload ./dist --domain my-site --dns
980
285
  ```
981
286
 
982
- `pinme set-appkey` satisfies the authentication requirement for `pinme upload` in CI.
983
-
984
- ### Supported Build Tools
985
-
986
- - **Vite**: Builds to `dist/`
987
- - **Create React App**: Builds to `build/`
988
- - **Next.js**: Builds to `out/` (with `output: 'export'`)
989
- - **Vue CLI**: Builds to `dist/`
990
- - **Angular**: Builds to `dist/`
991
- - **Static sites**: Uses root directory or `public/`
992
-
993
- ### Troubleshooting GitHub Actions
287
+ Domain handling:
994
288
 
995
- **Build directory not found:**
996
- - Ensure build script outputs to standard directory
997
- - Use manual workflow dispatch to specify custom directory
289
+ - domains containing a dot are treated as DNS domains
290
+ - domains without a dot are treated as PinMe subdomains
291
+ - `--dns` forces DNS mode
998
292
 
999
- **Authentication failed:**
1000
- - Verify `PINME_APPKEY` secret is correct
1001
- - Ensure AppKey format: `<address>-<jwt>`
293
+ ### Bind while uploading
1002
294
 
1003
- **Domain binding failed:**
1004
- - Check if domain name is available
1005
- - Ensure you have permission to bind the domain
295
+ ```bash
296
+ pinme bind ./dist --domain my-site
297
+ pinme bind ./dist --domain example.com
298
+ ```
1006
299
 
1007
- ---
300
+ `bind` requires wallet balance.
1008
301
 
1009
- ## License
302
+ ### Import or export CAR files
1010
303
 
1011
- MIT License - See the [LICENSE](LICENSE) file for details
304
+ ```bash
305
+ pinme import
306
+ pinme import ./site.car
307
+ pinme import ./site.car --domain my-site
1012
308
 
1013
- ---
309
+ pinme export <cid>
310
+ pinme export <cid> --output ./exports
311
+ ```
1014
312
 
1015
- ## Contact Us
313
+ ### Remove uploaded content
1016
314
 
1017
- If you have questions or suggestions, please contact us through:
315
+ ```bash
316
+ pinme rm
317
+ pinme rm <value>
318
+ ```
319
+
320
+ ## Command Reference
321
+
322
+ | Command | What it does |
323
+ | --------------------------------------------------------- | ------------------------------------------------------------ |
324
+ | `pinme create [name]` | Create a new PinMe Worker project from the official template |
325
+ | `pinme save [--domain <name>]` | Deploy the current PinMe project: Worker, SQL, and frontend |
326
+ | `pinme update-worker` | Build and upload Worker code only |
327
+ | `pinme update-db` | Upload SQL migrations from `db/` only |
328
+ | `pinme update-web` | Build and upload the frontend only |
329
+ | `pinme delete [name] [--force]` | Delete a platform project |
330
+ | `pinme upload [path]` | Upload a file or directory to IPFS |
331
+ | `pinme bind [path] --domain <name>` | Upload and bind a domain |
332
+ | `pinme import [path]` | Import a CAR file |
333
+ | `pinme export <cid> [--output <dir>]` | Export IPFS content as a CAR file |
334
+ | `pinme rm [value]` | Remove uploaded content |
335
+ | `pinme login [--env test\|prod]` | Login via browser |
336
+ | `pinme set-appkey [AppKey]` | Set authentication with an AppKey |
337
+ | `pinme show-appkey` / `pinme appkey` | Show masked AppKey info |
338
+ | `pinme my-domains` / `pinme domain` | List domains owned by the current account |
339
+ | `pinme wallet` / `pinme wallet-balance` / `pinme balance` | Show current wallet balance |
340
+ | `pinme list` / `pinme ls` | Show upload history |
341
+ | `pinme help` | Show CLI help |
342
+
343
+ ## Limits and Operational Notes
344
+
345
+ - Default single-file upload limit: `100MB`
346
+ - Default directory upload limit: `500MB`
347
+ - These upload defaults come from the CLI and can be overridden with environment variables
348
+ - `update-db` enforces a total SQL payload limit of `10MB` per run
349
+ - `upload`, `import`, and project commands require authentication
350
+ - domain binding requires wallet balance
351
+ - `save`, `update-worker`, `update-db`, and `update-web` expect to run from a PinMe project root with `pinme.toml`
352
+
353
+ ## Examples
354
+
355
+ This repo includes example projects and docs:
356
+
357
+ - [example/docs](./example/docs)
358
+ - [example/pinme-blog](./example/pinme-blog)
359
+ - [example/supabase](./example/supabase)
360
+
361
+ ## Support
1018
362
 
1019
- - GitHub Issues: [https://github.com/glitternetwork/pinme/issues](https://github.com/glitternetwork/pinme/issues)
1020
- - Email: [pinme@glitterprotocol.io](mailto:pinme@glitterprotocol.io)
1021
363
  - Website: [https://pinme.eth.limo/](https://pinme.eth.limo/)
1022
-
1023
- ---
1024
-
1025
- ## Star History
1026
-
1027
- [![Star History Chart](https://api.star-history.com/svg?repos=glitternetwork/pinme&type=Date)](https://star-history.com/#glitternetwork/pinme&Date)
1028
-
1029
- ---
1030
-
1031
- Developed and maintained by the [Glitter Protocol](https://glitterprotocol.io/) team
364
+ - GitHub: [https://github.com/glitternetwork/pinme](https://github.com/glitternetwork/pinme)