@curenorway/kode-cli 1.0.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 ADDED
@@ -0,0 +1,233 @@
1
+ # Cure Kode CLI
2
+
3
+ Command-line tool for managing JavaScript and CSS scripts for Webflow sites via Cure Kode CDN.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @curenorway/kode-cli
9
+ # or
10
+ pnpm add -g @curenorway/kode-cli
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ # Initialize a new project
17
+ kode init
18
+
19
+ # Pull existing scripts from remote
20
+ kode pull
21
+
22
+ # Edit your scripts locally...
23
+
24
+ # Push changes
25
+ kode push
26
+
27
+ # Deploy to staging
28
+ kode deploy
29
+
30
+ # Watch for changes and auto-push
31
+ kode watch
32
+ ```
33
+
34
+ ## Commands
35
+
36
+ ### `kode init`
37
+
38
+ Initialize a Cure Kode project in the current directory.
39
+
40
+ ```bash
41
+ kode init
42
+ ```
43
+
44
+ This creates a `.cure-kode/config.json` file with your site configuration.
45
+
46
+ ### `kode pull`
47
+
48
+ Download scripts from remote to your local scripts directory.
49
+
50
+ ```bash
51
+ kode pull # Pull all scripts
52
+ kode pull --force # Overwrite local changes
53
+ ```
54
+
55
+ ### `kode push`
56
+
57
+ Upload local scripts to remote.
58
+
59
+ ```bash
60
+ kode push # Push all changed scripts
61
+ kode push my-script.js # Push specific script
62
+ kode push --all # Push all scripts
63
+ kode push -m "Fixed bug" # Add change message
64
+ ```
65
+
66
+ ### `kode watch`
67
+
68
+ Watch for file changes and automatically push to remote.
69
+
70
+ ```bash
71
+ kode watch # Watch and push
72
+ kode watch --deploy # Watch, push, and deploy
73
+ kode watch --env production # Watch with specific environment
74
+ ```
75
+
76
+ ### `kode deploy`
77
+
78
+ Deploy scripts to staging or production.
79
+
80
+ ```bash
81
+ kode deploy # Deploy to staging (default)
82
+ kode deploy --env production # Deploy to production
83
+ kode deploy --promote # Promote staging to production
84
+ kode deploy -n "Release v2" # Deploy with notes
85
+ ```
86
+
87
+ ### `kode html <url>`
88
+
89
+ Fetch and analyze HTML from a URL.
90
+
91
+ ```bash
92
+ kode html https://mysite.com
93
+ kode html https://mysite.com --json # Output as JSON
94
+ kode html https://mysite.com --scripts # Show scripts only
95
+ kode html https://mysite.com --styles # Show styles only
96
+ ```
97
+
98
+ ### `kode status`
99
+
100
+ Show current project status.
101
+
102
+ ```bash
103
+ kode status
104
+ ```
105
+
106
+ ## Configuration
107
+
108
+ ### Project Config (`.cure-kode/config.json`)
109
+
110
+ ```json
111
+ {
112
+ "siteId": "uuid",
113
+ "siteSlug": "my-site",
114
+ "siteName": "My Site",
115
+ "apiKey": "ck_...",
116
+ "scriptsDir": "kode",
117
+ "environment": "staging"
118
+ }
119
+ ```
120
+
121
+ ### Global Config
122
+
123
+ Global configuration is stored in `~/.config/cure-kode/config.json`:
124
+
125
+ ```json
126
+ {
127
+ "apiUrl": "https://cure-app-v2-production.up.railway.app"
128
+ }
129
+ ```
130
+
131
+ ### Environment Variables
132
+
133
+ - `CURE_KODE_API_KEY` - API key (overrides project config)
134
+ - `CURE_KODE_API_URL` - API URL (overrides global config)
135
+
136
+ ## Project Structure
137
+
138
+ ```
139
+ your-project/
140
+ ├── .cure-kode/
141
+ │ ├── config.json # Project configuration
142
+ │ └── scripts.json # Script metadata (versions, sync status)
143
+ └── kode/ # Your scripts directory
144
+ ├── init.js
145
+ ├── tracking.js
146
+ └── styles.css
147
+ ```
148
+
149
+ ## Workflow Examples
150
+
151
+ ### Basic Development
152
+
153
+ ```bash
154
+ # 1. Initialize project
155
+ kode init
156
+
157
+ # 2. Pull existing scripts
158
+ kode pull
159
+
160
+ # 3. Start watch mode
161
+ kode watch
162
+
163
+ # 4. Edit files in your editor - they auto-push on save
164
+
165
+ # 5. When ready, deploy
166
+ kode deploy
167
+ ```
168
+
169
+ ### CI/CD Integration
170
+
171
+ ```bash
172
+ # In your CI pipeline
173
+ kode push --all
174
+ kode deploy --env staging
175
+ # Run tests...
176
+ kode deploy --promote
177
+ ```
178
+
179
+ ### Team Workflow
180
+
181
+ ```bash
182
+ # Developer 1: Pull latest
183
+ kode pull --force
184
+
185
+ # Developer 2: Push changes
186
+ kode push -m "Added new animation"
187
+
188
+ # Deploy to staging for review
189
+ kode deploy -n "Review build"
190
+
191
+ # After approval, promote to production
192
+ kode deploy --promote
193
+ ```
194
+
195
+ ## API Key
196
+
197
+ Get your API key from the Cure app:
198
+ 1. Go to https://cure-app.com/tools/kode
199
+ 2. Open your site settings
200
+ 3. Generate an API key with appropriate permissions
201
+
202
+ ### Permissions
203
+
204
+ - `read` - Pull scripts, view status
205
+ - `write` - Push scripts
206
+ - `deploy` - Deploy to staging/production
207
+ - `delete` - Delete scripts
208
+
209
+ ## Requirements
210
+
211
+ - Node.js 18 or later
212
+ - Cure Kode API key
213
+
214
+ ## Troubleshooting
215
+
216
+ ### "No project found"
217
+
218
+ Run `kode init` to initialize a project in the current directory.
219
+
220
+ ### "API key invalid"
221
+
222
+ Check that your API key:
223
+ - Starts with `ck_`
224
+ - Has not expired
225
+ - Has the required permissions
226
+
227
+ ### "Script not found"
228
+
229
+ The script may not exist on remote. Use `kode push` to create it.
230
+
231
+ ## License
232
+
233
+ MIT