@bagdock/cli 0.1.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 +90 -0
  2. package/dist/bagdock.js +3950 -0
  3. package/package.json +36 -0
package/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # @bagdock/cli
2
+
3
+ Developer CLI for building, testing, and deploying apps and edges on the Bagdock platform.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install -g @bagdock/cli
9
+ ```
10
+
11
+ ## Quick start
12
+
13
+ ```bash
14
+ # Authenticate with your Bagdock account
15
+ bagdock login
16
+
17
+ # Scaffold a new project
18
+ bagdock init
19
+
20
+ # Start local development
21
+ bagdock dev
22
+
23
+ # Deploy to Bagdock
24
+ bagdock deploy
25
+ ```
26
+
27
+ ## What are apps and edges?
28
+
29
+ **Edges** are backend workers that connect external APIs, handle webhooks, and sync data between platforms. Examples: a Noke lock adapter, a Telnyx comms worker, a payment processor handler.
30
+
31
+ **Apps** are UI extensions that add screens, panels, or drawers to the Bagdock operator dashboard — similar to HubSpot CRM cards or Shopify App Bridge extensions.
32
+
33
+ Both deploy to Cloudflare Workers for Platforms via the Bagdock API. You never need Cloudflare credentials.
34
+
35
+ ## Commands
36
+
37
+ | Command | Description |
38
+ |---------|-------------|
39
+ | `bagdock login` | Authenticate via Device Authorization Grant (opens browser) |
40
+ | `bagdock logout` | Clear stored credentials |
41
+ | `bagdock whoami` | Show current authenticated user |
42
+ | `bagdock init` | Scaffold a new project with `bagdock.json` |
43
+ | `bagdock dev` | Start local dev server |
44
+ | `bagdock deploy` | Build and deploy to Bagdock |
45
+ | `bagdock env set` | Set an environment variable for your project |
46
+ | `bagdock env list` | List environment variables |
47
+ | `bagdock submit` | Submit for marketplace review |
48
+
49
+ ## Authentication
50
+
51
+ The CLI uses the OAuth 2.0 Device Authorization Grant. When you run `bagdock login`, it will:
52
+
53
+ 1. Display a one-time code
54
+ 2. Open your browser to the Bagdock dashboard
55
+ 3. Ask you to enter the code and approve access
56
+ 4. Store credentials locally at `~/.bagdock/credentials.json`
57
+
58
+ ## Configuration
59
+
60
+ Each project uses a `bagdock.json` file. All config lives here — no `wrangler.toml` needed. A temporary one is auto-generated for local dev and should be gitignored.
61
+
62
+ ### Edge example
63
+
64
+ ```json
65
+ {
66
+ "name": "noke-lock-adapter",
67
+ "slug": "noke-lock-adapter",
68
+ "type": "edge",
69
+ "kind": "adapter",
70
+ "category": "locks",
71
+ "main": "src/index.ts"
72
+ }
73
+ ```
74
+
75
+ ### App example
76
+
77
+ ```json
78
+ {
79
+ "name": "my-dashboard-widget",
80
+ "slug": "my-dashboard-widget",
81
+ "type": "app",
82
+ "kind": "ui-extension",
83
+ "category": "analytics",
84
+ "main": "src/index.ts"
85
+ }
86
+ ```
87
+
88
+ ## License
89
+
90
+ Proprietary — Copyright Bagdock Ltd.