@curenorway/kode-cli 1.1.0 → 1.1.2
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-IAF3LXSA.js → chunk-A5MKCPVP.js} +109 -42
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -360,24 +360,56 @@ function upsertPage(projectRoot, page, agent = "kode html") {
|
|
|
360
360
|
}
|
|
361
361
|
function generateClaudeMdMinimal(siteName, siteSlug) {
|
|
362
362
|
const slug = siteSlug || "your-site-slug";
|
|
363
|
-
return `## Cure Kode
|
|
363
|
+
return `## Cure Kode: ${siteName}
|
|
364
364
|
|
|
365
|
-
|
|
365
|
+
### What is Cure Kode?
|
|
366
|
+
|
|
367
|
+
Cure Kode is an **internal CDN tool by Cure Norway** for managing JavaScript/CSS on Webflow sites.
|
|
368
|
+
|
|
369
|
+
**IMPORTANT**: This is NOT a public product. Do NOT search the web for documentation - all info is here.
|
|
370
|
+
|
|
371
|
+
**How it works**:
|
|
372
|
+
1. Scripts live locally in the \`scripts/\` folder (or configured folder)
|
|
373
|
+
2. \`kode push\` uploads scripts to Cure's CDN at \`app.cure.no\`
|
|
374
|
+
3. \`kode deploy\` makes them live on staging or production
|
|
375
|
+
4. A single \`init.js\` script tag in Webflow loads all your scripts
|
|
376
|
+
|
|
377
|
+
### CDN URL
|
|
378
|
+
|
|
379
|
+
Add this to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer Code:
|
|
366
380
|
|
|
367
|
-
**CDN URL** (add to Webflow \u2192 Project Settings \u2192 Custom Code \u2192 Footer):
|
|
368
381
|
\`\`\`html
|
|
369
382
|
<script async src="https://app.cure.no/api/cdn/${slug}/init.js"></script>
|
|
370
383
|
\`\`\`
|
|
371
384
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
385
|
+
### Workflow
|
|
386
|
+
|
|
387
|
+
1. \`kode pull\` - Download latest scripts from remote
|
|
388
|
+
2. \`kode status\` - Check what's changed, see CDN URL
|
|
389
|
+
3. Edit scripts locally
|
|
390
|
+
4. \`kode push\` - Upload changes
|
|
391
|
+
5. \`kode deploy --env staging\` - Deploy to staging for testing
|
|
392
|
+
6. \`kode deploy --env production\` - Deploy to production when ready
|
|
379
393
|
|
|
380
|
-
|
|
394
|
+
### Commands
|
|
395
|
+
|
|
396
|
+
| Command | Description |
|
|
397
|
+
|---------|-------------|
|
|
398
|
+
| \`kode pull\` | Download scripts from remote |
|
|
399
|
+
| \`kode push\` | Upload local scripts |
|
|
400
|
+
| \`kode status\` | Show sync status and CDN URL |
|
|
401
|
+
| \`kode deploy --env staging\` | Deploy to staging |
|
|
402
|
+
| \`kode deploy --env production\` | Deploy to production |
|
|
403
|
+
| \`kode html <url> --save\` | Analyze and cache page HTML structure |
|
|
404
|
+
|
|
405
|
+
### Context
|
|
406
|
+
|
|
407
|
+
**Read \`.cure-kode/context.md\` before working on scripts** - it contains:
|
|
408
|
+
- Script inventory with purposes
|
|
409
|
+
- Cached page structures (sections, CTAs, forms)
|
|
410
|
+
- Notes from previous sessions
|
|
411
|
+
|
|
412
|
+
Update context.md after your session with discoveries and changes.
|
|
381
413
|
|
|
382
414
|
`;
|
|
383
415
|
}
|
|
@@ -628,40 +660,73 @@ config.json
|
|
|
628
660
|
const claudeMdContentMinimal = generateClaudeMdMinimal(config.siteName, config.siteSlug);
|
|
629
661
|
let claudeMdAction = "created";
|
|
630
662
|
if (existsSync3(claudeMdPath)) {
|
|
663
|
+
const existingContent = readFileSync3(claudeMdPath, "utf-8");
|
|
664
|
+
const kodeHeaderPattern = /^## Cure Kode[:\s]/m;
|
|
665
|
+
const hasExistingKodeSection = kodeHeaderPattern.test(existingContent);
|
|
631
666
|
spinner.stop();
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
{
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
667
|
+
if (hasExistingKodeSection) {
|
|
668
|
+
console.log(chalk.yellow("\n\u26A0\uFE0F Found existing Cure Kode section in CLAUDE.md.\n"));
|
|
669
|
+
const { action } = await prompt([
|
|
670
|
+
{
|
|
671
|
+
type: "select",
|
|
672
|
+
name: "action",
|
|
673
|
+
message: "How would you like to handle Kode instructions?",
|
|
674
|
+
choices: [
|
|
675
|
+
{
|
|
676
|
+
name: "prepend",
|
|
677
|
+
message: "Update existing Cure Kode section (recommended)"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "skip",
|
|
681
|
+
message: "Skip - keep existing section"
|
|
682
|
+
}
|
|
683
|
+
],
|
|
684
|
+
initial: 0
|
|
685
|
+
}
|
|
686
|
+
]);
|
|
687
|
+
spinner.start("Generating AI context files...");
|
|
688
|
+
if (action === "prepend") {
|
|
689
|
+
const sectionEndPattern = /^## Cure Kode[:\s][\s\S]*?(?=\n---\n|\n## (?!#)|$)/m;
|
|
690
|
+
const updatedContent = existingContent.replace(sectionEndPattern, claudeMdContentMinimal.trim());
|
|
691
|
+
writeFileSync3(claudeMdPath, updatedContent);
|
|
692
|
+
claudeMdAction = "updated";
|
|
693
|
+
} else {
|
|
694
|
+
claudeMdAction = "skipped";
|
|
653
695
|
}
|
|
654
|
-
]);
|
|
655
|
-
spinner.start("Generating AI context files...");
|
|
656
|
-
if (action === "prepend") {
|
|
657
|
-
const existingContent = readFileSync3(claudeMdPath, "utf-8");
|
|
658
|
-
writeFileSync3(claudeMdPath, claudeMdContentMinimal + "---\n\n" + existingContent);
|
|
659
|
-
claudeMdAction = "prepended";
|
|
660
|
-
} else if (action === "separate") {
|
|
661
|
-
writeFileSync3(join3(cwd, "KODE.md"), claudeMdContentFull);
|
|
662
|
-
claudeMdAction = "separate";
|
|
663
696
|
} else {
|
|
664
|
-
|
|
697
|
+
console.log(chalk.yellow("\n\u26A0\uFE0F CLAUDE.md already exists in this directory.\n"));
|
|
698
|
+
const { action } = await prompt([
|
|
699
|
+
{
|
|
700
|
+
type: "select",
|
|
701
|
+
name: "action",
|
|
702
|
+
message: "How would you like to handle Kode instructions?",
|
|
703
|
+
choices: [
|
|
704
|
+
{
|
|
705
|
+
name: "prepend",
|
|
706
|
+
message: "Prepend Kode section to CLAUDE.md (recommended)"
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: "separate",
|
|
710
|
+
message: "Create separate KODE.md file"
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
name: "skip",
|
|
714
|
+
message: "Skip - I'll add instructions manually"
|
|
715
|
+
}
|
|
716
|
+
],
|
|
717
|
+
initial: 0
|
|
718
|
+
}
|
|
719
|
+
]);
|
|
720
|
+
spinner.start("Generating AI context files...");
|
|
721
|
+
if (action === "prepend") {
|
|
722
|
+
writeFileSync3(claudeMdPath, claudeMdContentMinimal + "---\n\n" + existingContent);
|
|
723
|
+
claudeMdAction = "prepended";
|
|
724
|
+
} else if (action === "separate") {
|
|
725
|
+
writeFileSync3(join3(cwd, "KODE.md"), claudeMdContentFull);
|
|
726
|
+
claudeMdAction = "separate";
|
|
727
|
+
} else {
|
|
728
|
+
claudeMdAction = "skipped";
|
|
729
|
+
}
|
|
665
730
|
}
|
|
666
731
|
} else {
|
|
667
732
|
writeFileSync3(claudeMdPath, claudeMdContentFull);
|
|
@@ -676,6 +741,8 @@ config.json
|
|
|
676
741
|
console.log(chalk.dim(` \u251C\u2500\u2500 CLAUDE.md (AI agent instructions)`));
|
|
677
742
|
} else if (claudeMdAction === "prepended") {
|
|
678
743
|
console.log(chalk.dim(` \u251C\u2500\u2500 CLAUDE.md (Kode section prepended)`));
|
|
744
|
+
} else if (claudeMdAction === "updated") {
|
|
745
|
+
console.log(chalk.dim(` \u251C\u2500\u2500 CLAUDE.md (Kode section updated)`));
|
|
679
746
|
} else if (claudeMdAction === "separate") {
|
|
680
747
|
console.log(chalk.dim(` \u251C\u2500\u2500 CLAUDE.md (existing - unchanged)`));
|
|
681
748
|
console.log(chalk.dim(` \u251C\u2500\u2500 KODE.md (Kode AI instructions)`));
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED