@getcirrus/pds 0.5.0 → 0.7.0

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
@@ -8,9 +8,9 @@ Cirrus is a single-user [AT Protocol](https://atproto.com) Personal Data Server
8
8
 
9
9
  Host your own Bluesky identity with minimal infrastructure.
10
10
 
11
- > **⚠️ Experimental Software**
11
+ > **⚠️ Beta Software**
12
12
  >
13
- > This is an early-stage project under active development. **Do not migrate your main Bluesky account to this PDS yet.** Use a test account or create a new identity for experimentation. Data loss, breaking changes, and missing features are expected.
13
+ > This is under active development. Account migration has been tested and works, but breaking changes may still occur. Consider backing up important data before migrating a primary account.
14
14
 
15
15
  ## What is a PDS?
16
16
 
@@ -89,8 +89,7 @@ The package includes a CLI for setup, migration, and secret management.
89
89
  Interactive setup wizard for configuring the PDS.
90
90
 
91
91
  ```bash
92
- pds init # Configure for local development
93
- pds init --production # Deploy secrets to Cloudflare
92
+ pds init # Configure the PDS (prompts for Cloudflare deploy)
94
93
  ```
95
94
 
96
95
  **What it does:**
@@ -129,6 +128,26 @@ The migration is resumable. If interrupted, run `pds migrate` again to continue.
129
128
  - `--dev` – Target the local development server instead of production
130
129
  - `--clean` – Delete any existing imported data and start fresh (only works on deactivated accounts)
131
130
 
131
+ ### `pds identity`
132
+
133
+ Updates your DID document to point to your new PDS. This is the critical step that tells the network where to find you.
134
+
135
+ ```bash
136
+ pds identity # Update identity for production
137
+ pds identity --dev # Update identity for local dev
138
+ pds identity --token XXX # Skip email step if you have a token
139
+ ```
140
+
141
+ The command:
142
+
143
+ 1. Resolves your current DID to find the source PDS
144
+ 2. Authenticates with your source PDS (requires your password)
145
+ 3. Requests an email confirmation token
146
+ 4. Gets the source PDS to sign a PLC operation with the new endpoint
147
+ 5. Submits the signed operation to the PLC directory
148
+
149
+ **Note:** Only `did:plc` identities are supported. `did:web` identities don't use PLC operations.
150
+
132
151
  ### `pds activate`
133
152
 
134
153
  Enables writes on the account after migration.
@@ -158,6 +177,32 @@ pds migrate --clean # Reset and re-import
158
177
  pds activate # Go live again
159
178
  ```
160
179
 
180
+ ### `pds passkey`
181
+
182
+ Manage passkeys for passwordless authentication.
183
+
184
+ ```bash
185
+ pds passkey add # Register a new passkey
186
+ pds passkey list # List registered passkeys
187
+ pds passkey remove # Remove a passkey
188
+ ```
189
+
190
+ All passkey commands support:
191
+
192
+ - `--dev` – Target the local development server instead of production
193
+
194
+ #### `pds passkey add`
195
+
196
+ Registers a new passkey (WebAuthn credential). Displays a QR code in the terminal for easy registration from a mobile device. The registration link expires after 10 minutes.
197
+
198
+ #### `pds passkey list`
199
+
200
+ Lists all registered passkeys with their names, IDs, and last used timestamps.
201
+
202
+ #### `pds passkey remove`
203
+
204
+ Interactively select and remove a passkey from the account.
205
+
161
206
  ### `pds secret`
162
207
 
163
208
  Manage individual secrets.
@@ -367,16 +412,18 @@ The PDS includes a complete OAuth 2.1 provider for "Login with Bluesky":
367
412
  | `POST /oauth/token` | Token exchange |
368
413
  | `POST /oauth/revoke` | Token revocation |
369
414
 
415
+ **Passkey support:** The authorization page supports passwordless login via passkeys (WebAuthn). If the user has registered passkeys, a "Sign in with Passkey" button appears. This works across devices – scan a QR code from your phone to authenticate on a desktop.
416
+
370
417
  See the [@getcirrus/oauth-provider](../oauth-provider/) package for implementation details.
371
418
 
372
419
  ## Deploying to Production
373
420
 
374
421
  1. **Enable R2** in your [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/r2/overview). The bucket will be created automatically on first deploy.
375
422
 
376
- 2. **Run the production setup** to deploy secrets:
423
+ 2. **Run the setup wizard** and answer "Yes" when asked if you want to deploy to Cloudflare:
377
424
 
378
425
  ```bash
379
- npx pds init --production
426
+ npx pds init
380
427
  ```
381
428
 
382
429
  3. **Deploy your worker:**
@@ -391,30 +438,84 @@ wrangler deploy
391
438
 
392
439
  Moving an existing Bluesky account to your own PDS:
393
440
 
394
- ### 1. Configure for migration
441
+ ### Step 1: Configure for migration
395
442
 
396
443
  ```bash
397
444
  npx pds init
398
445
  # Answer "Yes" when asked about migrating an existing account
399
446
  ```
400
447
 
401
- ### 2. Deploy and migrate data
448
+ This detects your existing account, generates new signing keys, and configures the PDS in deactivated mode (ready for data import).
449
+
450
+ ### Step 2: Deploy and transfer data
402
451
 
403
452
  ```bash
404
453
  wrangler deploy
405
454
  npx pds migrate
406
455
  ```
407
456
 
408
- ### 3. Update your identity
457
+ The migrate command:
458
+ - Resolves your DID to find the current PDS
459
+ - Authenticates with your source PDS
460
+ - Downloads the repository (posts, follows, likes, etc.)
461
+ - Transfers all blobs (images, videos)
462
+ - Copies user preferences
409
463
 
410
- Follow the [AT Protocol account migration guide](https://atproto.com/guides/account-migration) to update your DID document. This typically requires email verification from your current PDS.
464
+ If interrupted, run `pds migrate` again to resume.
411
465
 
412
- ### 4. Go live
466
+ ### Step 3: Update your identity
467
+
468
+ ```bash
469
+ npx pds identity
470
+ ```
471
+
472
+ This updates your DID document to point to your new PDS. The command:
473
+ 1. Authenticates with your source PDS (requires password)
474
+ 2. Requests an email confirmation token
475
+ 3. Gets the source PDS to sign a PLC operation with your new endpoint
476
+ 4. Submits the signed operation to the PLC directory
477
+
478
+ You'll receive an email with a confirmation token – enter it when prompted.
479
+
480
+ ### Step 4: Activate the account
413
481
 
414
482
  ```bash
415
483
  npx pds activate
416
484
  ```
417
485
 
486
+ This enables writes on your new PDS. Your account is now live.
487
+
488
+ ### Step 5: Verify the migration
489
+
490
+ ```bash
491
+ npx pds status
492
+ ```
493
+
494
+ Check that:
495
+ - The account is active
496
+ - The repository has the expected number of records
497
+ - Your handle resolves correctly
498
+
499
+ ### Full command sequence
500
+
501
+ ```bash
502
+ # 1. Configure (answer "Yes" to deploy secrets to Cloudflare)
503
+ npx pds init # Configure for migration + deploy secrets
504
+
505
+ # 2. Deploy and migrate
506
+ wrangler deploy # Deploy the worker
507
+ npx pds migrate # Transfer data from source PDS
508
+
509
+ # 3. Update identity
510
+ npx pds identity # Update DID document (requires email)
511
+
512
+ # 4. Go live
513
+ npx pds activate # Enable writes
514
+
515
+ # 5. Verify
516
+ npx pds status # Check everything is working
517
+ ```
518
+
418
519
  ## Validation
419
520
 
420
521
  Records are validated against AT Protocol lexicon schemas before being stored. The PDS uses optimistic validation: