@duffcloudservices/cli 0.1.1 → 0.1.3
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 +180 -158
- package/dist/index.js +318 -207
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,158 +1,180 @@
|
|
|
1
|
-
# @duffcloudservices/cli
|
|
2
|
-
|
|
3
|
-
Command-line interface for initializing and managing DCS (Duff Cloud Services) customer sites.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g @duffcloudservices/cli
|
|
9
|
-
# or
|
|
10
|
-
pnpm add -g @duffcloudservices/cli
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# 1. Authenticate with Google OAuth
|
|
17
|
-
dcs login
|
|
18
|
-
|
|
19
|
-
# 2. Initialize a new customer site
|
|
20
|
-
cd /path/to/customer-site
|
|
21
|
-
dcs init --site-slug my-site --site-name "My Site"
|
|
22
|
-
|
|
23
|
-
# 3. Validate configuration
|
|
24
|
-
dcs validate
|
|
25
|
-
|
|
26
|
-
# 4. Generate integration plans
|
|
27
|
-
dcs plans
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Commands
|
|
31
|
-
|
|
32
|
-
### Authentication
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
# Login with Google OAuth (device flow)
|
|
36
|
-
dcs login
|
|
37
|
-
|
|
38
|
-
# Check current user
|
|
39
|
-
dcs whoami
|
|
40
|
-
|
|
41
|
-
# Logout and clear credentials
|
|
42
|
-
dcs logout
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Site Management
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
# List sites you have access to
|
|
49
|
-
dcs sites list
|
|
50
|
-
|
|
51
|
-
# Show details for a specific site
|
|
52
|
-
dcs sites show my-site
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Initialization
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# Initialize DCS integration in current directory
|
|
59
|
-
dcs init --site-slug my-site --site-name "My Site"
|
|
60
|
-
|
|
61
|
-
# Specify target directory
|
|
62
|
-
dcs init -s my-site -n "My Site" -t ./my-site
|
|
63
|
-
|
|
64
|
-
# Specify framework (vue or astro)
|
|
65
|
-
dcs init -s my-site -n "My Site" -f astro
|
|
66
|
-
|
|
67
|
-
# Preview without creating files
|
|
68
|
-
dcs init -s my-site -n "My Site" --dry-run
|
|
69
|
-
|
|
70
|
-
# Overwrite existing files
|
|
71
|
-
dcs init -s my-site -n "My Site" --force
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Validation
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Validate .dcs configuration files
|
|
78
|
-
dcs validate
|
|
79
|
-
|
|
80
|
-
# Validate a specific directory
|
|
81
|
-
dcs validate -t ./my-site
|
|
82
|
-
|
|
83
|
-
# Show verbose output
|
|
84
|
-
dcs validate -v
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Integration Plans
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
# Generate AI-assisted integration plans
|
|
91
|
-
dcs plans
|
|
92
|
-
|
|
93
|
-
# Regenerate existing plans
|
|
94
|
-
dcs plans --force
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
##
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
##
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
# @duffcloudservices/cli
|
|
2
|
+
|
|
3
|
+
Command-line interface for initializing and managing DCS (Duff Cloud Services) customer sites.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @duffcloudservices/cli
|
|
9
|
+
# or
|
|
10
|
+
pnpm add -g @duffcloudservices/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 1. Authenticate with Google OAuth
|
|
17
|
+
dcs login
|
|
18
|
+
|
|
19
|
+
# 2. Initialize a new customer site
|
|
20
|
+
cd /path/to/customer-site
|
|
21
|
+
dcs init --site-slug my-site --site-name "My Site"
|
|
22
|
+
|
|
23
|
+
# 3. Validate configuration
|
|
24
|
+
dcs validate
|
|
25
|
+
|
|
26
|
+
# 4. Generate integration plans
|
|
27
|
+
dcs plans
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
### Authentication
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Login with Google OAuth (device flow)
|
|
36
|
+
dcs login
|
|
37
|
+
|
|
38
|
+
# Check current user
|
|
39
|
+
dcs whoami
|
|
40
|
+
|
|
41
|
+
# Logout and clear credentials
|
|
42
|
+
dcs logout
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Site Management
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# List sites you have access to
|
|
49
|
+
dcs sites list
|
|
50
|
+
|
|
51
|
+
# Show details for a specific site
|
|
52
|
+
dcs sites show my-site
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Initialization
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Initialize DCS integration in current directory
|
|
59
|
+
dcs init --site-slug my-site --site-name "My Site"
|
|
60
|
+
|
|
61
|
+
# Specify target directory
|
|
62
|
+
dcs init -s my-site -n "My Site" -t ./my-site
|
|
63
|
+
|
|
64
|
+
# Specify framework (vue or astro)
|
|
65
|
+
dcs init -s my-site -n "My Site" -f astro
|
|
66
|
+
|
|
67
|
+
# Preview without creating files
|
|
68
|
+
dcs init -s my-site -n "My Site" --dry-run
|
|
69
|
+
|
|
70
|
+
# Overwrite existing files
|
|
71
|
+
dcs init -s my-site -n "My Site" --force
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Validation
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Validate .dcs configuration files
|
|
78
|
+
dcs validate
|
|
79
|
+
|
|
80
|
+
# Validate a specific directory
|
|
81
|
+
dcs validate -t ./my-site
|
|
82
|
+
|
|
83
|
+
# Show verbose output
|
|
84
|
+
dcs validate -v
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Integration Plans
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Generate AI-assisted integration plans
|
|
91
|
+
dcs plans
|
|
92
|
+
|
|
93
|
+
# Regenerate existing plans
|
|
94
|
+
dcs plans --force
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Page Snapshot Capture
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Capture all pages listed in .dcs/pages.yaml
|
|
101
|
+
dcs capture-snapshots --target ./customer-site --base-url http://localhost:5173
|
|
102
|
+
|
|
103
|
+
# Capture only selected page slugs
|
|
104
|
+
dcs capture-snapshots --target ./customer-site --base-url http://localhost:5173 --pages home,about
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Snapshot output uses a fixed portal contract:
|
|
108
|
+
|
|
109
|
+
| File | Portal use | Capture behavior |
|
|
110
|
+
| --- | --- | --- |
|
|
111
|
+
| `site-snapshots/{pageSlug}/full-page.png` | Expanded page dialog with auto-scroll | Full scrollable page after a lazy-load pass |
|
|
112
|
+
| `site-snapshots/{pageSlug}/thumbnail.png` | Pages grid cards | Header/hero-focused 16:9 top crop captured at the site desktop viewport |
|
|
113
|
+
| `site-snapshots/{pageSlug}/sections/{sectionId}.png` | Visual-editor section overlays | Individual `data-section` element screenshots |
|
|
114
|
+
|
|
115
|
+
Keep these names stable across customer-site scripts. Site-specific flexibility belongs in `.dcs/pages.yaml` (`snapshot.viewport`, `waitAfterLoad`, page paths) and in environment variables such as `SITE_PREVIEW_URL`, not in alternate artifact names.
|
|
116
|
+
|
|
117
|
+
For managed CSS-style backgrounds, render a real image layer with `data-dcs-image-key` and a matching `.dcs/content.yaml` key. Snapshot capture records those markers as editable image keys, which keeps background images visible in full-page screenshots and replaceable from the visual editor.
|
|
118
|
+
|
|
119
|
+
## Generated Files
|
|
120
|
+
|
|
121
|
+
The `init` command creates the following structure:
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
.dcs/
|
|
125
|
+
├── site.yaml # Site identity and Azure config
|
|
126
|
+
├── pages.yaml # Page registry for CMS
|
|
127
|
+
├── content.yaml # Text content (managed by Portal)
|
|
128
|
+
├── seo.yaml # SEO configuration (managed by Portal)
|
|
129
|
+
└── SECTION-CONVENTIONS.md
|
|
130
|
+
|
|
131
|
+
.github/
|
|
132
|
+
└── copilot-instructions.md
|
|
133
|
+
|
|
134
|
+
.plans/
|
|
135
|
+
├── README.md
|
|
136
|
+
├── 00-audit-site.md
|
|
137
|
+
├── 01-create-use-text-content.md
|
|
138
|
+
├── 02-integrate-home-page.md
|
|
139
|
+
├── 03-integrate-remaining-pages.md
|
|
140
|
+
├── 04-capture-snapshots.md
|
|
141
|
+
└── 05-verify-deployment.md
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Authentication Flow
|
|
145
|
+
|
|
146
|
+
The CLI uses OAuth 2.0 Device Authorization Grant (RFC 8628):
|
|
147
|
+
|
|
148
|
+
1. Run `dcs login`
|
|
149
|
+
2. CLI displays a URL and code
|
|
150
|
+
3. Open URL in browser, enter code
|
|
151
|
+
4. Sign in with Google
|
|
152
|
+
5. CLI receives and stores tokens securely
|
|
153
|
+
|
|
154
|
+
Tokens are stored encrypted in your OS keychain/credential store.
|
|
155
|
+
|
|
156
|
+
## Site Access Validation
|
|
157
|
+
|
|
158
|
+
Before creating configuration files, the CLI validates:
|
|
159
|
+
|
|
160
|
+
1. You're authenticated
|
|
161
|
+
2. You have access to the specified site (or can create it)
|
|
162
|
+
3. You have editor/admin permissions
|
|
163
|
+
|
|
164
|
+
This prevents creating configs for sites you don't have access to.
|
|
165
|
+
|
|
166
|
+
## Next Steps After Init
|
|
167
|
+
|
|
168
|
+
1. **Install CMS package**: `pnpm add @duffcloudservices/cms`
|
|
169
|
+
2. **Configure Vite plugins** in your build config
|
|
170
|
+
3. **Follow the plans** in `.plans/` directory
|
|
171
|
+
4. **Register site** in DCS Portal
|
|
172
|
+
|
|
173
|
+
## Requirements
|
|
174
|
+
|
|
175
|
+
- Node.js >= 18.0.0
|
|
176
|
+
- DCS Portal account with Google OAuth
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
MIT © Duff Cloud Services
|