@curenorway/kode-cli 1.0.4 → 1.1.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/dist/{chunk-RS5LGRLV.js → chunk-IAF3LXSA.js} +70 -20
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -358,22 +358,55 @@ function upsertPage(projectRoot, page, agent = "kode html") {
|
|
|
358
358
|
context.updatedBy = agent;
|
|
359
359
|
writeContext(projectRoot, context);
|
|
360
360
|
}
|
|
361
|
-
function generateClaudeMdMinimal(siteName) {
|
|
361
|
+
function generateClaudeMdMinimal(siteName, siteSlug) {
|
|
362
|
+
const slug = siteSlug || "your-site-slug";
|
|
362
363
|
return `## Cure Kode (${siteName})
|
|
363
364
|
|
|
364
|
-
This project uses **Cure Kode** for Webflow script management.
|
|
365
|
+
This project uses **Cure Kode** (internal Cure CDN tool) for Webflow script management.
|
|
365
366
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
**CDN URL** (add to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer):
|
|
368
|
+
\`\`\`html
|
|
369
|
+
<script async src="https://app.cure.no/api/cdn/${slug}/init.js"></script>
|
|
370
|
+
\`\`\`
|
|
371
|
+
|
|
372
|
+
**Commands**:
|
|
373
|
+
- \`kode pull\` - Download scripts from remote
|
|
374
|
+
- \`kode push\` - Upload local scripts
|
|
375
|
+
- \`kode deploy --env staging\` - Deploy to staging
|
|
376
|
+
- \`kode deploy --env production\` - Deploy to production
|
|
377
|
+
- \`kode status\` - Show sync status and CDN URLs
|
|
378
|
+
- \`kode html <url> --save\` - Cache page structure for AI context
|
|
379
|
+
|
|
380
|
+
**Context**: Read \`.cure-kode/context.md\` before working on scripts.
|
|
369
381
|
|
|
370
382
|
`;
|
|
371
383
|
}
|
|
372
|
-
function generateClaudeMd(siteName, scriptsDir = "scripts") {
|
|
384
|
+
function generateClaudeMd(siteName, scriptsDir = "scripts", siteSlug) {
|
|
385
|
+
const slug = siteSlug || "your-site-slug";
|
|
373
386
|
return `# Cure Kode Project: ${siteName}
|
|
374
387
|
|
|
375
388
|
> AI Agent Instructions for Webflow Script Management
|
|
376
389
|
|
|
390
|
+
## What is Cure Kode?
|
|
391
|
+
|
|
392
|
+
Cure Kode is an **internal CDN tool by Cure** for managing JavaScript/CSS on Webflow sites. It is NOT a public product - do not search the web for documentation.
|
|
393
|
+
|
|
394
|
+
**How it works:**
|
|
395
|
+
1. You write scripts locally in \`${scriptsDir}/\`
|
|
396
|
+
2. Push scripts to Cure's CDN via \`kode push\`
|
|
397
|
+
3. Deploy to staging or production via \`kode deploy\`
|
|
398
|
+
4. Scripts are served from \`https://app.cure.no/api/cdn/${slug}/init.js\`
|
|
399
|
+
|
|
400
|
+
## CDN URL (Add to Webflow)
|
|
401
|
+
|
|
402
|
+
Add this script tag to your Webflow site's **Custom Code** (Project Settings \u2192 Custom Code \u2192 Footer Code):
|
|
403
|
+
|
|
404
|
+
\`\`\`html
|
|
405
|
+
<script async src="https://app.cure.no/api/cdn/${slug}/init.js"></script>
|
|
406
|
+
\`\`\`
|
|
407
|
+
|
|
408
|
+
**Important**: Use \`async\` for best PageSpeed scores. The init.js automatically loads all your scripts.
|
|
409
|
+
|
|
377
410
|
## Commands
|
|
378
411
|
|
|
379
412
|
| Command | Description |
|
|
@@ -383,7 +416,7 @@ function generateClaudeMd(siteName, scriptsDir = "scripts") {
|
|
|
383
416
|
| \`kode watch\` | Auto-sync on file changes |
|
|
384
417
|
| \`kode deploy --env staging\` | Deploy to staging |
|
|
385
418
|
| \`kode deploy --env production\` | Deploy to production |
|
|
386
|
-
| \`kode status\` | Show sync status |
|
|
419
|
+
| \`kode status\` | Show sync status and CDN URLs |
|
|
387
420
|
| \`kode html <url>\` | Analyze page HTML |
|
|
388
421
|
| \`kode html <url> --save\` | Analyze and cache page structure |
|
|
389
422
|
| \`kode pages\` | List cached page contexts |
|
|
@@ -402,6 +435,18 @@ ${scriptsDir}/
|
|
|
402
435
|
\u2514\u2500\u2500 (your scripts)
|
|
403
436
|
\`\`\`
|
|
404
437
|
|
|
438
|
+
## Workflow
|
|
439
|
+
|
|
440
|
+
1. **Pull latest**: \`kode pull\`
|
|
441
|
+
2. **Read context**: Check \`.cure-kode/context.md\` for project state
|
|
442
|
+
3. **Analyze pages**: \`kode html <url> --save\` to understand HTML structure
|
|
443
|
+
4. **Write scripts**: Edit files in \`${scriptsDir}/\`
|
|
444
|
+
5. **Push changes**: \`kode push\`
|
|
445
|
+
6. **Deploy staging**: \`kode deploy --env staging\`
|
|
446
|
+
7. **Test**: Verify on staging domain
|
|
447
|
+
8. **Deploy production**: \`kode deploy --env production\`
|
|
448
|
+
9. **Update context**: Record session in context.md
|
|
449
|
+
|
|
405
450
|
## Dynamic Context
|
|
406
451
|
|
|
407
452
|
**IMPORTANT**: Read \`.cure-kode/context.md\` before starting work.
|
|
@@ -430,17 +475,6 @@ Page context includes:
|
|
|
430
475
|
- **Forms**: Form fields, labels, and submit buttons
|
|
431
476
|
- **CMS**: Collection patterns with item counts
|
|
432
477
|
|
|
433
|
-
## Workflow
|
|
434
|
-
|
|
435
|
-
1. \`kode pull\` to get latest scripts
|
|
436
|
-
2. Read \`.cure-kode/context.md\` for project state
|
|
437
|
-
3. If working on specific page: \`kode html <url> --save\`
|
|
438
|
-
4. Make changes to scripts in \`${scriptsDir}/\`
|
|
439
|
-
5. \`kode push\` to upload
|
|
440
|
-
6. \`kode deploy --env staging\` to test
|
|
441
|
-
7. Update context.md with session notes
|
|
442
|
-
8. \`kode deploy --env production\` when ready
|
|
443
|
-
|
|
444
478
|
## Best Practices
|
|
445
479
|
|
|
446
480
|
1. **Always deploy to staging first** - Test before production
|
|
@@ -590,8 +624,8 @@ config.json
|
|
|
590
624
|
} catch {
|
|
591
625
|
}
|
|
592
626
|
const claudeMdPath = join3(cwd, "CLAUDE.md");
|
|
593
|
-
const claudeMdContentFull = generateClaudeMd(config.siteName, config.scriptsDir || "scripts");
|
|
594
|
-
const claudeMdContentMinimal = generateClaudeMdMinimal(config.siteName);
|
|
627
|
+
const claudeMdContentFull = generateClaudeMd(config.siteName, config.scriptsDir || "scripts", config.siteSlug);
|
|
628
|
+
const claudeMdContentMinimal = generateClaudeMdMinimal(config.siteName, config.siteSlug);
|
|
595
629
|
let claudeMdAction = "created";
|
|
596
630
|
if (existsSync3(claudeMdPath)) {
|
|
597
631
|
spinner.stop();
|
|
@@ -1174,6 +1208,9 @@ async function deployCommand(environment, options) {
|
|
|
1174
1208
|
console.log(chalk5.dim(` Version: ${deployment.version}`));
|
|
1175
1209
|
console.log(chalk5.dim(` Status: ${deployment.status}`));
|
|
1176
1210
|
console.log();
|
|
1211
|
+
console.log(chalk5.bold("CDN URL:"));
|
|
1212
|
+
console.log(chalk5.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1213
|
+
console.log();
|
|
1177
1214
|
console.log(chalk5.green("\u2705 Production is now running the latest staging version!"));
|
|
1178
1215
|
} catch (error) {
|
|
1179
1216
|
spinner2.fail("Promotion failed");
|
|
@@ -1192,10 +1229,16 @@ async function deployCommand(environment, options) {
|
|
|
1192
1229
|
console.log(chalk5.dim(` Status: ${deployment.status}`));
|
|
1193
1230
|
console.log(chalk5.dim(` Started: ${new Date(deployment.started_at).toLocaleString("nb-NO")}`));
|
|
1194
1231
|
console.log();
|
|
1232
|
+
console.log(chalk5.bold("CDN URL:"));
|
|
1233
|
+
console.log(chalk5.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1234
|
+
console.log();
|
|
1195
1235
|
if (env === "staging") {
|
|
1196
1236
|
console.log(chalk5.cyan('\u{1F4A1} Tip: Use "kode deploy production" or "kode deploy --promote" to go live.'));
|
|
1197
1237
|
} else {
|
|
1198
1238
|
console.log(chalk5.green("\u2705 Changes are now live!"));
|
|
1239
|
+
console.log();
|
|
1240
|
+
console.log(chalk5.dim("Make sure this script tag is in your Webflow site:"));
|
|
1241
|
+
console.log(chalk5.dim(`<script async src="https://app.cure.no/api/cdn/${config.siteSlug}/init.js"></script>`));
|
|
1199
1242
|
}
|
|
1200
1243
|
} catch (error) {
|
|
1201
1244
|
spinner.fail("Deployment failed");
|
|
@@ -1566,6 +1609,13 @@ async function statusCommand(options) {
|
|
|
1566
1609
|
console.log(chalk7.dim(` Slug: ${config.siteSlug}`));
|
|
1567
1610
|
console.log(chalk7.dim(` ID: ${config.siteId}`));
|
|
1568
1611
|
console.log();
|
|
1612
|
+
console.log(chalk7.bold("CDN URL"));
|
|
1613
|
+
console.log();
|
|
1614
|
+
console.log(chalk7.cyan(` https://app.cure.no/api/cdn/${config.siteSlug}/init.js`));
|
|
1615
|
+
console.log();
|
|
1616
|
+
console.log(chalk7.dim(" Add to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer:"));
|
|
1617
|
+
console.log(chalk7.dim(` <script async src="https://app.cure.no/api/cdn/${config.siteSlug}/init.js"></script>`));
|
|
1618
|
+
console.log();
|
|
1569
1619
|
const spinner = ora6("Fetching status...").start();
|
|
1570
1620
|
try {
|
|
1571
1621
|
const client = createApiClient(config);
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -308,6 +308,6 @@ declare function generateInitialContext(config: ProjectConfig, scripts: CdnScrip
|
|
|
308
308
|
/**
|
|
309
309
|
* Generate full CLAUDE.md content for new projects
|
|
310
310
|
*/
|
|
311
|
-
declare function generateClaudeMd(siteName: string, scriptsDir?: string): string;
|
|
311
|
+
declare function generateClaudeMd(siteName: string, scriptsDir?: string, siteSlug?: string): string;
|
|
312
312
|
|
|
313
313
|
export { type CdnDeployment, type CdnPage, type CdnScript, type CdnSite, KodeApiClient, KodeApiError, type KodeContext, type KodeScriptContext, type KodeSession, type ParsedHtmlResult, type ProjectConfig, addSession, appendNote, contextCommand, createApiClient, deployCommand, findProjectRoot, generateClaudeMd, generateInitialContext, getApiKey, getApiUrl, getContextPath, getProjectConfig, getScriptsDir, htmlCommand, initCommand, parseContext, pullCommand, pushCommand, readContext, saveProjectConfig, serializeContext, setGlobalConfig, statusCommand, updateScriptPurpose, watchCommand, writeContext };
|
package/dist/index.js
CHANGED