@oaysus/cli 0.1.16 → 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.
package/docs/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Oaysus CLI Documentation
2
+
3
+ This folder contains detailed documentation for the Oaysus CLI tool.
4
+
5
+ ## Documentation Index
6
+
7
+ | Document | Description |
8
+ |----------|-------------|
9
+ | [Getting Started](./getting-started.md) | Installation and first steps |
10
+ | [Theme Pack Commands](./theme-commands.md) | Building and managing component libraries |
11
+ | [Site Commands](./site-commands.md) | Managing website pages and content |
12
+ | [Component Guide](./components.md) | Building components with schemas |
13
+ | [Schema Reference](./schemas.md) | Complete prop type reference |
14
+ | [AI Workflows](./ai-workflows.md) | Using the CLI with AI assistants |
15
+
16
+ ## Quick Links
17
+
18
+ - [Main Documentation](https://oaysus.com/docs)
19
+ - [API Reference](https://oaysus.com/docs/cli)
20
+ - [GitHub Issues](https://github.com/oaysus/cli/issues)
21
+
22
+ ## What is Oaysus?
23
+
24
+ Oaysus is a visual page builder platform that enables:
25
+
26
+ 1. **Developers** to build reusable components in React, Vue, or Svelte
27
+ 2. **Marketing teams** to create and edit pages visually without code
28
+ 3. **Fast deployment** with pre-rendered pages served from global edge servers
29
+
30
+ The CLI is the developer's primary interface for building and pushing components to Oaysus.
@@ -0,0 +1,207 @@
1
+ # AI Workflows with Oaysus CLI
2
+
3
+ The Oaysus CLI's `site pull` and `site publish` commands unlock powerful AI-assisted content workflows. By storing pages as JSON files locally, any AI assistant can read and modify them.
4
+
5
+ ## The AI-Powered Workflow
6
+
7
+ ```bash
8
+ # Step 1: Pull all pages from your website
9
+ oaysus site pull
10
+
11
+ # Step 2: Use AI to make bulk changes
12
+ # (See example prompts below)
13
+
14
+ # Step 3: Validate the changes
15
+ oaysus site validate
16
+
17
+ # Step 4: Review changes in git diff
18
+
19
+ # Step 5: Publish all changes
20
+ oaysus site publish
21
+ ```
22
+
23
+ ## Example AI Prompts
24
+
25
+ ### Content Updates
26
+
27
+ **Update brand messaging across all pages:**
28
+ ```
29
+ "Update all hero sections to use our new tagline: 'Build faster, ship sooner'"
30
+ ```
31
+
32
+ **Change pricing information:**
33
+ ```
34
+ "Change the price from $99 to $149 on all pages that mention pricing"
35
+ ```
36
+
37
+ **Add calls to action:**
38
+ ```
39
+ "Add a newsletter signup CTA to the footer of every page"
40
+ ```
41
+
42
+ ### Bulk Modifications
43
+
44
+ **Update testimonials:**
45
+ ```
46
+ "Update all testimonial sections with these new customer quotes:
47
+ - 'Oaysus saved us 10 hours per week' - Jane Doe, Marketing Lead
48
+ - 'Our team loves the visual editor' - John Smith, CEO"
49
+ ```
50
+
51
+ **Add new sections:**
52
+ ```
53
+ "Add a FAQ section to the pricing page with these questions:
54
+ 1. What payment methods do you accept?
55
+ 2. Can I cancel anytime?
56
+ 3. Do you offer refunds?"
57
+ ```
58
+
59
+ ### Translations
60
+
61
+ **Translate entire site:**
62
+ ```
63
+ "Translate all page content to Spanish, keeping the same structure"
64
+ ```
65
+
66
+ **Localize specific content:**
67
+ ```
68
+ "Update the contact information to use our European office address on all pages"
69
+ ```
70
+
71
+ ### SEO Optimization
72
+
73
+ **Update meta descriptions:**
74
+ ```
75
+ "Generate unique, SEO-optimized meta descriptions for each page based on their content"
76
+ ```
77
+
78
+ **Add structured data:**
79
+ ```
80
+ "Add FAQ schema markup to all pages that have FAQ sections"
81
+ ```
82
+
83
+ ## Page JSON Structure
84
+
85
+ Each page is stored as a JSON file that AI tools can easily parse and modify:
86
+
87
+ ```json
88
+ {
89
+ "title": "About Us",
90
+ "slug": "/about",
91
+ "description": "Learn about our company and team",
92
+ "components": [
93
+ {
94
+ "type": "Hero",
95
+ "props": {
96
+ "headline": "Our Story",
97
+ "subtext": "Building the future of web development",
98
+ "buttonText": "Meet the Team",
99
+ "buttonLink": "/team"
100
+ }
101
+ },
102
+ {
103
+ "type": "FeatureGrid",
104
+ "props": {
105
+ "heading": "Our Values",
106
+ "features": [
107
+ {
108
+ "title": "Innovation",
109
+ "description": "Pushing boundaries every day"
110
+ },
111
+ {
112
+ "title": "Quality",
113
+ "description": "Excellence in everything we do"
114
+ }
115
+ ]
116
+ }
117
+ }
118
+ ]
119
+ }
120
+ ```
121
+
122
+ ## Component Catalog
123
+
124
+ After pulling, the `components.json` file contains all available components and their schemas. AI tools can reference this to understand what props are available:
125
+
126
+ ```json
127
+ {
128
+ "Hero": {
129
+ "displayName": "Hero Section",
130
+ "props": {
131
+ "headline": { "type": "string" },
132
+ "subtext": { "type": "string" },
133
+ "buttonText": { "type": "string" },
134
+ "buttonLink": { "type": "string" },
135
+ "backgroundImage": { "type": "image" }
136
+ }
137
+ },
138
+ "FeatureGrid": {
139
+ "displayName": "Feature Grid",
140
+ "props": {
141
+ "heading": { "type": "string" },
142
+ "features": { "type": "array" }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ ## Time Savings
149
+
150
+ | Task | Manual Approach | AI-Assisted |
151
+ |------|-----------------|-------------|
152
+ | Update 10 page headlines | 30+ minutes | 2 minutes |
153
+ | Add CTA to all pages | 45+ minutes | 3 minutes |
154
+ | Translate 20 pages | Days | 30 minutes |
155
+ | Update testimonials site-wide | 1 hour | 5 minutes |
156
+
157
+ ## Best Practices
158
+
159
+ ### 1. Pull Before Making Changes
160
+
161
+ Always start with a fresh pull to ensure you have the latest content:
162
+
163
+ ```bash
164
+ oaysus site pull --force
165
+ ```
166
+
167
+ ### 2. Validate Before Publishing
168
+
169
+ Run validation to catch errors before they go live:
170
+
171
+ ```bash
172
+ oaysus site validate
173
+ ```
174
+
175
+ ### 3. Use Git for Version Control
176
+
177
+ Track changes and review diffs before publishing:
178
+
179
+ ```bash
180
+ git diff pages/
181
+ ```
182
+
183
+ ### 4. Review AI Output
184
+
185
+ Always review AI-generated changes before publishing. AI can make mistakes, especially with:
186
+ - Proper nouns and brand names
187
+ - Technical terminology
188
+ - Numerical data
189
+
190
+ ### 5. Publish Incrementally
191
+
192
+ For large changes, consider publishing one page at a time:
193
+
194
+ ```bash
195
+ oaysus site publish pages/home.json
196
+ oaysus site publish pages/about.json
197
+ ```
198
+
199
+ ## Integration with AI Coding Assistants
200
+
201
+ The site commands work seamlessly with AI coding assistants like:
202
+
203
+ - **Claude Code** - Can read, modify, and validate page JSON files
204
+ - **GitHub Copilot** - Suggests edits based on context
205
+ - **Cursor** - Full IDE integration with AI assistance
206
+
207
+ Simply open your site project in your preferred editor and let AI help with bulk content changes.
@@ -0,0 +1,210 @@
1
+ # Building Components
2
+
3
+ Components are the building blocks of Oaysus pages. Each component has two files: the code and a schema that defines editable props.
4
+
5
+ ## Component Structure
6
+
7
+ ```
8
+ components/
9
+ └── HeroBanner/
10
+ ├── index.tsx # Component code
11
+ └── schema.json # Prop definitions
12
+ ```
13
+
14
+ ## React Components
15
+
16
+ ### Example Component
17
+
18
+ ```tsx
19
+ // components/HeroBanner/index.tsx
20
+ interface HeroBannerProps {
21
+ headline: string;
22
+ subtext: string;
23
+ buttonText: string;
24
+ buttonLink: string;
25
+ backgroundImage?: string;
26
+ }
27
+
28
+ export default function HeroBanner({
29
+ headline = "Welcome",
30
+ subtext = "Build something amazing",
31
+ buttonText = "Get Started",
32
+ buttonLink = "/",
33
+ backgroundImage
34
+ }: HeroBannerProps) {
35
+ return (
36
+ <section
37
+ className="py-24 px-6 text-white bg-cover bg-center"
38
+ style={{ backgroundImage: backgroundImage ? `url(${backgroundImage})` : undefined }}
39
+ >
40
+ <div className="max-w-4xl mx-auto text-center">
41
+ <h1 className="text-5xl font-bold mb-4">{headline}</h1>
42
+ <p className="text-xl mb-8 opacity-90">{subtext}</p>
43
+ <a
44
+ href={buttonLink}
45
+ className="inline-block bg-white text-gray-900 px-8 py-3 rounded-lg font-medium"
46
+ >
47
+ {buttonText}
48
+ </a>
49
+ </div>
50
+ </section>
51
+ );
52
+ }
53
+ ```
54
+
55
+ ### Example Schema
56
+
57
+ ```json
58
+ {
59
+ "displayName": "Hero Banner",
60
+ "category": "marketing",
61
+ "props": {
62
+ "headline": {
63
+ "type": "string",
64
+ "label": "Headline",
65
+ "default": "Welcome"
66
+ },
67
+ "subtext": {
68
+ "type": "string",
69
+ "label": "Subtext",
70
+ "default": "Build something amazing"
71
+ },
72
+ "buttonText": {
73
+ "type": "string",
74
+ "label": "Button Text",
75
+ "default": "Get Started"
76
+ },
77
+ "buttonLink": {
78
+ "type": "string",
79
+ "label": "Button Link",
80
+ "default": "/"
81
+ },
82
+ "backgroundImage": {
83
+ "type": "image",
84
+ "label": "Background Image"
85
+ }
86
+ }
87
+ }
88
+ ```
89
+
90
+ ## Vue Components
91
+
92
+ ```vue
93
+ <!-- components/FeatureGrid/index.vue -->
94
+ <template>
95
+ <section class="py-16 px-6 bg-gray-50">
96
+ <div class="max-w-6xl mx-auto">
97
+ <h2 class="text-3xl font-bold text-center mb-12">{{ heading }}</h2>
98
+ <div class="grid md:grid-cols-3 gap-8">
99
+ <div
100
+ v-for="(feature, index) in features"
101
+ :key="index"
102
+ class="bg-white p-6 rounded-xl shadow-sm"
103
+ >
104
+ <h3 class="text-xl font-semibold mb-2">{{ feature.title }}</h3>
105
+ <p class="text-gray-600">{{ feature.description }}</p>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </section>
110
+ </template>
111
+
112
+ <script setup lang="ts">
113
+ interface Feature {
114
+ title: string;
115
+ description: string;
116
+ }
117
+
118
+ defineProps<{
119
+ heading: string;
120
+ features: Feature[];
121
+ }>();
122
+ </script>
123
+ ```
124
+
125
+ ## Svelte Components
126
+
127
+ ```svelte
128
+ <!-- components/Testimonials/index.svelte -->
129
+ <script lang="ts">
130
+ export let heading = 'What Our Customers Say';
131
+ export let testimonials: Array<{
132
+ quote: string;
133
+ author: string;
134
+ role: string;
135
+ }> = [];
136
+ </script>
137
+
138
+ <section class="py-16 px-6 bg-white">
139
+ <div class="max-w-4xl mx-auto">
140
+ <h2 class="text-3xl font-bold text-center mb-12">{heading}</h2>
141
+ <div class="grid md:grid-cols-2 gap-8">
142
+ {#each testimonials as testimonial}
143
+ <blockquote class="bg-gray-50 p-6 rounded-xl">
144
+ <p class="text-lg text-gray-700 mb-4 italic">
145
+ "{testimonial.quote}"
146
+ </p>
147
+ <footer>
148
+ <cite class="font-semibold not-italic">{testimonial.author}</cite>
149
+ <p class="text-gray-500 text-sm">{testimonial.role}</p>
150
+ </footer>
151
+ </blockquote>
152
+ {/each}
153
+ </div>
154
+ </div>
155
+ </section>
156
+ ```
157
+
158
+ ## Best Practices
159
+
160
+ ### Use TypeScript
161
+
162
+ Define prop interfaces to catch type mismatches between your component and schema.
163
+
164
+ ### Provide Defaults
165
+
166
+ Components should render something meaningful even with default props.
167
+
168
+ ### Handle Missing Data
169
+
170
+ Use conditional rendering for optional props like images:
171
+
172
+ ```tsx
173
+ {backgroundImage && (
174
+ <img src={backgroundImage} alt="" />
175
+ )}
176
+ ```
177
+
178
+ ### Use Tailwind CSS
179
+
180
+ Oaysus supports Tailwind classes out of the box. Avoid custom CSS files that won't be loaded.
181
+
182
+ ### Keep Components Focused
183
+
184
+ One component per concern. Don't build Swiss army knives with too many options.
185
+
186
+ ### Use Meaningful Categories
187
+
188
+ Organize components with categories:
189
+ - `marketing` - Landing page sections
190
+ - `content` - Blog and article components
191
+ - `navigation` - Headers, menus, breadcrumbs
192
+ - `footer` - Footer sections
193
+ - `social-proof` - Testimonials, reviews
194
+ - `ecommerce` - Product displays, carts
195
+ - `forms` - Contact forms, signups
196
+ - `media` - Image galleries, videos
197
+
198
+ ## Component Categories
199
+
200
+ Set the `category` field in your schema:
201
+
202
+ ```json
203
+ {
204
+ "displayName": "Testimonials",
205
+ "category": "social-proof",
206
+ "props": { ... }
207
+ }
208
+ ```
209
+
210
+ Components are grouped by category in the page builder for easier discovery.
@@ -0,0 +1,90 @@
1
+ # Getting Started with Oaysus CLI
2
+
3
+ ## Installation
4
+
5
+ Install the Oaysus CLI globally using npm:
6
+
7
+ ```bash
8
+ npm install -g @oaysus/cli
9
+ ```
10
+
11
+ Requires Node.js 20 or higher.
12
+
13
+ ## Authentication
14
+
15
+ Before pushing components, authenticate with your Oaysus account:
16
+
17
+ ```bash
18
+ oaysus login
19
+ ```
20
+
21
+ This opens a magic link flow:
22
+ 1. Enter your email address
23
+ 2. Check your inbox for the login link
24
+ 3. Click the link to complete authentication
25
+ 4. Select which website to work with
26
+
27
+ Your credentials are stored locally and expire after 7 days.
28
+
29
+ ## Quick Start
30
+
31
+ ### Create a Theme Pack
32
+
33
+ ```bash
34
+ # Create a new theme pack project
35
+ oaysus theme init my-components
36
+
37
+ # Navigate to the project
38
+ cd my-components
39
+ ```
40
+
41
+ The CLI will prompt you to:
42
+ - Select a framework (React, Vue, or Svelte)
43
+ - Name your project
44
+ - Add a description
45
+
46
+ ### Project Structure
47
+
48
+ After initialization, your project looks like this:
49
+
50
+ ```
51
+ my-components/
52
+ ├── package.json
53
+ ├── components/
54
+ │ └── Hero/
55
+ │ ├── index.tsx # Component code
56
+ │ └── schema.json # Editable props definition
57
+ ├── shared/ # Shared utilities
58
+ └── README.md
59
+ ```
60
+
61
+ ### Push to Oaysus
62
+
63
+ ```bash
64
+ oaysus theme push
65
+ ```
66
+
67
+ The CLI will:
68
+ 1. Validate your component structure
69
+ 2. Build and bundle your components
70
+ 3. Upload to Oaysus cloud
71
+ 4. Make components available in the visual editor
72
+
73
+ ## Verify Your Setup
74
+
75
+ Check your authentication status:
76
+
77
+ ```bash
78
+ oaysus whoami
79
+ ```
80
+
81
+ This shows:
82
+ - Your email address
83
+ - Current website selected
84
+ - Token expiration time
85
+
86
+ ## Next Steps
87
+
88
+ - [Theme Pack Commands](./theme-commands.md) - Full command reference
89
+ - [Component Guide](./components.md) - Building effective components
90
+ - [Schema Reference](./schemas.md) - All available prop types