@oaysus/cli 0.1.15 → 0.1.17

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.
@@ -0,0 +1,300 @@
1
+ # Schema Reference
2
+
3
+ Schemas define which props are editable in the Oaysus page builder. Each prop type generates a specific form control.
4
+
5
+ ## Schema Structure
6
+
7
+ ```json
8
+ {
9
+ "displayName": "Component Name",
10
+ "category": "marketing",
11
+ "props": {
12
+ "propName": {
13
+ "type": "string",
14
+ "label": "Display Label",
15
+ "default": "Default value",
16
+ "required": false
17
+ }
18
+ }
19
+ }
20
+ ```
21
+
22
+ ## Top-Level Fields
23
+
24
+ | Field | Type | Description |
25
+ |-------|------|-------------|
26
+ | `displayName` | string | Name shown in the component picker |
27
+ | `category` | string | Grouping category for organization |
28
+ | `props` | object | Map of prop definitions |
29
+
30
+ ## Prop Types
31
+
32
+ ### string
33
+
34
+ Single line text input.
35
+
36
+ ```json
37
+ {
38
+ "headline": {
39
+ "type": "string",
40
+ "label": "Headline",
41
+ "default": "Welcome to our site"
42
+ }
43
+ }
44
+ ```
45
+
46
+ **Editor:** Text input field
47
+
48
+ ---
49
+
50
+ ### text
51
+
52
+ Multi-line text area.
53
+
54
+ ```json
55
+ {
56
+ "description": {
57
+ "type": "text",
58
+ "label": "Description",
59
+ "default": "Enter a longer description here"
60
+ }
61
+ }
62
+ ```
63
+
64
+ **Editor:** Textarea with multiple lines
65
+
66
+ ---
67
+
68
+ ### number
69
+
70
+ Numeric value with optional constraints.
71
+
72
+ ```json
73
+ {
74
+ "opacity": {
75
+ "type": "number",
76
+ "label": "Opacity",
77
+ "default": 0.5,
78
+ "min": 0,
79
+ "max": 1,
80
+ "step": 0.1
81
+ }
82
+ }
83
+ ```
84
+
85
+ **Options:**
86
+ - `min` - Minimum allowed value
87
+ - `max` - Maximum allowed value
88
+ - `step` - Increment step
89
+
90
+ **Editor:** Number input with optional slider
91
+
92
+ ---
93
+
94
+ ### boolean
95
+
96
+ True/false toggle.
97
+
98
+ ```json
99
+ {
100
+ "showButton": {
101
+ "type": "boolean",
102
+ "label": "Show Button",
103
+ "default": true
104
+ }
105
+ }
106
+ ```
107
+
108
+ **Editor:** Toggle switch
109
+
110
+ ---
111
+
112
+ ### color
113
+
114
+ Hex color value.
115
+
116
+ ```json
117
+ {
118
+ "backgroundColor": {
119
+ "type": "color",
120
+ "label": "Background Color",
121
+ "default": "#3B82F6"
122
+ }
123
+ }
124
+ ```
125
+
126
+ **Editor:** Color picker with hex input
127
+
128
+ ---
129
+
130
+ ### image
131
+
132
+ Image from the media library.
133
+
134
+ ```json
135
+ {
136
+ "heroImage": {
137
+ "type": "image",
138
+ "label": "Hero Image"
139
+ }
140
+ }
141
+ ```
142
+
143
+ **Editor:** Image picker with upload capability
144
+
145
+ ---
146
+
147
+ ### select
148
+
149
+ Dropdown with predefined options.
150
+
151
+ ```json
152
+ {
153
+ "alignment": {
154
+ "type": "select",
155
+ "label": "Text Alignment",
156
+ "default": "center",
157
+ "options": [
158
+ { "value": "left", "label": "Left" },
159
+ { "value": "center", "label": "Center" },
160
+ { "value": "right", "label": "Right" }
161
+ ]
162
+ }
163
+ }
164
+ ```
165
+
166
+ **Editor:** Select dropdown menu
167
+
168
+ ---
169
+
170
+ ### array
171
+
172
+ Repeatable list of items.
173
+
174
+ ```json
175
+ {
176
+ "features": {
177
+ "type": "array",
178
+ "label": "Features",
179
+ "itemSchema": {
180
+ "title": {
181
+ "type": "string",
182
+ "label": "Title"
183
+ },
184
+ "description": {
185
+ "type": "string",
186
+ "label": "Description"
187
+ },
188
+ "icon": {
189
+ "type": "string",
190
+ "label": "Icon Emoji",
191
+ "default": "⚡"
192
+ }
193
+ }
194
+ }
195
+ }
196
+ ```
197
+
198
+ **Editor:** Add/remove/reorder items interface
199
+
200
+ ---
201
+
202
+ ## Common Field Options
203
+
204
+ All prop types support these options:
205
+
206
+ | Option | Type | Description |
207
+ |--------|------|-------------|
208
+ | `label` | string | Display name in editor (defaults to prop name) |
209
+ | `default` | any | Initial value when component is added |
210
+ | `required` | boolean | Must have value before publishing |
211
+
212
+ ## Complete Schema Example
213
+
214
+ ```json
215
+ {
216
+ "displayName": "Feature Section",
217
+ "category": "marketing",
218
+ "props": {
219
+ "heading": {
220
+ "type": "string",
221
+ "label": "Section Heading",
222
+ "default": "Our Features",
223
+ "required": true
224
+ },
225
+ "subheading": {
226
+ "type": "text",
227
+ "label": "Subheading",
228
+ "default": "Everything you need to succeed"
229
+ },
230
+ "backgroundColor": {
231
+ "type": "color",
232
+ "label": "Background Color",
233
+ "default": "#F9FAFB"
234
+ },
235
+ "columns": {
236
+ "type": "select",
237
+ "label": "Column Layout",
238
+ "default": "3",
239
+ "options": [
240
+ { "value": "2", "label": "2 Columns" },
241
+ { "value": "3", "label": "3 Columns" },
242
+ { "value": "4", "label": "4 Columns" }
243
+ ]
244
+ },
245
+ "features": {
246
+ "type": "array",
247
+ "label": "Features",
248
+ "itemSchema": {
249
+ "icon": {
250
+ "type": "string",
251
+ "label": "Icon Emoji",
252
+ "default": "✨"
253
+ },
254
+ "title": {
255
+ "type": "string",
256
+ "label": "Title",
257
+ "required": true
258
+ },
259
+ "description": {
260
+ "type": "text",
261
+ "label": "Description"
262
+ },
263
+ "link": {
264
+ "type": "string",
265
+ "label": "Learn More Link"
266
+ }
267
+ }
268
+ },
269
+ "showCTA": {
270
+ "type": "boolean",
271
+ "label": "Show CTA Button",
272
+ "default": true
273
+ },
274
+ "ctaText": {
275
+ "type": "string",
276
+ "label": "CTA Button Text",
277
+ "default": "Learn More"
278
+ },
279
+ "ctaLink": {
280
+ "type": "string",
281
+ "label": "CTA Button Link",
282
+ "default": "/features"
283
+ }
284
+ }
285
+ }
286
+ ```
287
+
288
+ ## Validation
289
+
290
+ The CLI validates schemas when you run:
291
+
292
+ ```bash
293
+ oaysus theme validate
294
+ ```
295
+
296
+ Common validation errors:
297
+ - Invalid JSON syntax
298
+ - Unknown prop type
299
+ - Missing required fields in schema
300
+ - Type mismatch between component props and schema
@@ -0,0 +1,267 @@
1
+ # Site Commands
2
+
3
+ Site commands manage website pages and content locally. This enables version control, bulk editing, and AI-assisted workflows.
4
+
5
+ ## oaysus site init
6
+
7
+ Create a new website project for local page management.
8
+
9
+ ```bash
10
+ oaysus site init [name]
11
+ ```
12
+
13
+ ### Options
14
+
15
+ | Option | Description |
16
+ |--------|-------------|
17
+ | `[name]` | Optional project name |
18
+
19
+ ### Example
20
+
21
+ ```bash
22
+ oaysus site init my-marketing-site
23
+ ```
24
+
25
+ ### Output
26
+
27
+ ```
28
+ ? Project name: my-marketing-site
29
+ ? Create project? Yes
30
+
31
+ ✓ Created oaysus.config.json
32
+ ✓ Created pages/
33
+ ✓ Created assets/
34
+ ✓ Project ready!
35
+
36
+ Run "oaysus site pull" to download existing pages.
37
+ ```
38
+
39
+ ### Generated Structure
40
+
41
+ ```
42
+ my-marketing-site/
43
+ ├── pages/ # Page JSON files
44
+ ├── assets/ # Local images and files
45
+ ├── components.json # Installed component catalog
46
+ └── oaysus.config.json # Project configuration
47
+ ```
48
+
49
+ ---
50
+
51
+ ## oaysus site validate
52
+
53
+ Validate pages against installed components.
54
+
55
+ ```bash
56
+ oaysus site validate [path]
57
+ ```
58
+
59
+ ### Options
60
+
61
+ | Option | Description |
62
+ |--------|-------------|
63
+ | `[path]` | Optional path to site project |
64
+
65
+ ### Example
66
+
67
+ ```bash
68
+ oaysus site validate
69
+ ```
70
+
71
+ ### Output
72
+
73
+ ```
74
+ Validating site...
75
+ ✓ oaysus.config.json valid
76
+ ✓ Found 5 pages
77
+ ✓ All component references valid
78
+ ✓ All prop types valid
79
+ ✓ No broken asset references
80
+
81
+ Site ready to publish!
82
+ ```
83
+
84
+ ### Common Errors
85
+
86
+ - **Component not found** - Component referenced in page doesn't exist
87
+ - **Invalid prop type** - Prop value doesn't match schema type
88
+ - **Missing asset** - Referenced image not in assets folder
89
+
90
+ ---
91
+
92
+ ## oaysus site publish
93
+
94
+ Publish pages from local files to your website.
95
+
96
+ ```bash
97
+ oaysus site publish [file?]
98
+ ```
99
+
100
+ **Requires authentication.**
101
+
102
+ ### Options
103
+
104
+ | Option | Description |
105
+ |--------|-------------|
106
+ | `[file]` | Optional specific page file to publish |
107
+ | `--dry-run` | Preview changes without publishing |
108
+ | `--yes, -y` | Skip confirmation prompts |
109
+
110
+ ### Example - Publish All Pages
111
+
112
+ ```bash
113
+ oaysus site publish
114
+ ```
115
+
116
+ ### Output
117
+
118
+ ```
119
+ Publishing pages...
120
+
121
+ Syncing component catalog...
122
+ ✓ 12 components available
123
+
124
+ Publishing 5 pages...
125
+ ✓ pages/home.json → /
126
+ ✓ pages/about.json → /about
127
+ ✓ pages/pricing.json → /pricing
128
+ ✓ pages/contact.json → /contact
129
+ ✓ pages/blog/index.json → /blog
130
+
131
+ Uploading 3 new assets...
132
+ ████████████████████ 100%
133
+
134
+ ✓ 5 pages published
135
+ ✓ 3 assets uploaded
136
+ ```
137
+
138
+ ### Example - Publish Single Page
139
+
140
+ ```bash
141
+ oaysus site publish pages/pricing.json
142
+ ```
143
+
144
+ ---
145
+
146
+ ## oaysus site pull
147
+
148
+ Download pages from server to local files.
149
+
150
+ ```bash
151
+ oaysus site pull
152
+ ```
153
+
154
+ **Requires authentication.**
155
+
156
+ ### Options
157
+
158
+ | Option | Description |
159
+ |--------|-------------|
160
+ | `--force, -f` | Overwrite local files without prompting |
161
+ | `--dry-run` | Preview what would be downloaded |
162
+
163
+ ### Example
164
+
165
+ ```bash
166
+ oaysus site pull
167
+ ```
168
+
169
+ ### Output
170
+
171
+ ```
172
+ Pulling pages from server...
173
+
174
+ Syncing component catalog...
175
+ ✓ 12 components in catalog
176
+
177
+ Downloading pages...
178
+ ✓ / → pages/home.json
179
+ ✓ /about → pages/about.json
180
+ ✓ /pricing → pages/pricing.json
181
+ ✓ /contact → pages/contact.json
182
+ ✓ /blog → pages/blog/index.json
183
+
184
+ Downloading assets...
185
+ ████████████████████ 100%
186
+
187
+ ✓ 5 pages downloaded
188
+ ✓ 15 assets synced
189
+ ```
190
+
191
+ ### Why Pull?
192
+
193
+ After pulling, you have complete page configurations locally:
194
+
195
+ 1. **Version Control** - Track changes in git
196
+ 2. **Bulk Editing** - Edit multiple pages at once
197
+ 3. **AI Assistance** - Let AI tools modify content
198
+ 4. **Code Review** - Review changes in pull requests
199
+
200
+ ---
201
+
202
+ ## Page JSON Structure
203
+
204
+ Each page is stored as a JSON file:
205
+
206
+ ```json
207
+ {
208
+ "title": "About Us",
209
+ "slug": "/about",
210
+ "description": "Learn about our company",
211
+ "components": [
212
+ {
213
+ "type": "Hero",
214
+ "props": {
215
+ "headline": "Our Story",
216
+ "subtext": "Building the future of web development"
217
+ }
218
+ },
219
+ {
220
+ "type": "FeatureGrid",
221
+ "props": {
222
+ "features": [
223
+ {
224
+ "title": "Innovation",
225
+ "description": "Pushing boundaries"
226
+ }
227
+ ]
228
+ }
229
+ }
230
+ ]
231
+ }
232
+ ```
233
+
234
+ ### Fields
235
+
236
+ | Field | Description |
237
+ |-------|-------------|
238
+ | `title` | Page title (browser tab, SEO) |
239
+ | `slug` | URL path |
240
+ | `description` | Meta description |
241
+ | `components` | Array of component instances |
242
+
243
+ ---
244
+
245
+ ## Workflow Example
246
+
247
+ ### The AI-Powered Content Workflow
248
+
249
+ ```bash
250
+ # 1. Pull all pages locally
251
+ oaysus site pull
252
+
253
+ # 2. Use AI to make bulk changes
254
+ # "Update all hero sections with new brand messaging"
255
+ # "Add a newsletter CTA to every page"
256
+ # "Translate all content to Spanish"
257
+
258
+ # 3. Validate changes
259
+ oaysus site validate
260
+
261
+ # 4. Review in git diff
262
+
263
+ # 5. Publish all changes
264
+ oaysus site publish
265
+ ```
266
+
267
+ This workflow transforms hours of manual editing into minutes of AI-assisted changes.