CLI for Cure Kode CDN - manage, deploy, and sync JS/CSS scripts for Webflow sites with AI agent support
npm install @curenorway/kode-cliCommand-line tool for managing JavaScript and CSS scripts for Webflow sites via Cure Kode CDN.
- Pull/Push scripts - Sync scripts between local files and remote CDN with conflict detection
- Sync awareness - Staleness indicators show when local state is out of date
- Deploy dry-run - Preview what will be deployed before executing
- Doctor command - Diagnose configuration issues and check for CLI updates
- Watch mode - Auto-sync on file changes with retry on failure
- Staging/Production - Separate environments with explicit production enable
- Rollback - Quick recovery to previous deployments
- AI-ready - Auto-generates KODE.md documentation for AI agents
- MCP Integration - Works with Cure Kode MCP for AI agents
``bash`
npm install -g @curenorway/kode-clior
pnpm add -g @curenorway/kode-cli
`bashInitialize a new project (creates config + AI context)
kode init
Commands
$3
Initialize a Cure Kode project in the current directory.
`bash
kode init
`Creates:
-
.cure-kode/config.json - Site configuration and API key
- .cure-kode/KODE.md - Auto-generated documentation (scripts, pages, commands)
- .cure-kode/context.md - AI context file
- .cure-kode-scripts/ - Scripts directory
- CLAUDE.md - Reference to KODE.md (prepended, never overwrites existing content)
- .mcp.json - MCP server configuration (cure-kode, webflow, playwright)$3
Download scripts from remote to your local scripts directory.
`bash
kode pull # Pull all scripts
kode pull --force # Overwrite local changes
`Output shows script status:
-
[G] = Global scope, [P] = Page-specific
- ⚡ = Auto-load enabled, ○ = Manual load only$3
Upload local scripts to remote.
`bash
kode push # Push all changed scripts
kode push my-script.js # Push specific script
kode push --all # Push all scripts
kode push -m "Fixed bug" # Add change message
kode push --auto-load # Enable auto-load for new scripts
kode push --no-auto-load # Disable auto-load
`$3
Watch for file changes and automatically push to remote.
`bash
kode watch # Watch and push
kode watch --deploy # Watch, push, and deploy on changes
`Features:
- Retry on network failure with exponential backoff
- Session summary on exit (Ctrl+C)
- Debounced uploads to prevent rapid-fire pushes
$3
Deploy scripts to staging or production.
`bash
kode deploy # Deploy to staging (default)
kode deploy --dry-run # Preview deployment without executing
kode deploy --promote # Promote staging to production
kode deploy --force # Force release stale deploy lock
`Note: Production must be enabled before promoting. See
kode production.$3
Rollback to a previous deployment.
`bash
kode rollback # Rollback staging to previous version
kode rollback production # Rollback production to previous version
`$3
Manage production environment (disabled by default for safety).
`bash
kode production status # Check if production is enabled
kode production enable # Enable production environment
kode production enable --domain example.com # Enable with specific domain
kode production disable # Disable production environment
`$3
Fetch and analyze HTML from a URL.
`bash
kode html https://mysite.com # Analyze page
kode html https://mysite.com --json # Output as JSON
kode html https://mysite.com --scripts # Show scripts only
kode html https://mysite.com --styles # Show styles only
kode html https://mysite.com --save # Cache page context for AI
`$3
List cached page contexts.
`bash
kode pages # List all cached pages
kode pages --json # Output as JSON
`$3
View and manage AI context.
`bash
kode context # View current context
kode context --edit # Open context in editor
kode context --refresh # Refresh context from remote
kode context --json # Output as JSON
`$3
Show current project status with staleness indicators.
`bash
kode status
`Shows:
- Site info and CDN URL
- Production enabled state
- Script sync status with staleness warnings
- Per-script indicators: modified locally, server updated, conflicts
- Deployment versions
$3
Diagnose configuration and environment issues.
`bash
kode doctor
`Checks:
- Project configuration and API key validity
- Network connectivity and API access
- MCP server configuration
- KODE.md and CLAUDE.md setup
- Security (.gitignore for API key)
- Sync state staleness
- CLI version and available updates
$3
Show differences between local and remote script versions.
`bash
kode diff my-script # Compare local vs remote
`$3
Bidirectional sync with conflict detection.
`bash
kode sync # Sync both directions
kode sync --dry-run # Preview what would change
`Configuration
$3
`json
{
"siteId": "uuid",
"siteSlug": "my-site",
"siteName": "My Site",
"apiKey": "ck_...",
"scriptsDir": ".cure-kode-scripts",
"environment": "staging"
}
`$3
Default:
.cure-kode-scripts/ (avoids conflicts with AI-generated scripts/ folders)$3
-
CURE_KODE_API_KEY - API key (overrides project config)
- CURE_KODE_API_URL - API URL (default: https://app.cure.no)Project Structure
`
your-project/
├── .cure-kode/
│ ├── config.json # Project configuration (gitignored)
│ ├── scripts.json # Sync state for conflict detection
│ ├── KODE.md # Auto-generated documentation
│ ├── context.md # AI context (notes, discoveries)
│ └── pages/ # Cached page contexts
├── .cure-kode-scripts/ # Your scripts directory
│ ├── main.js
│ ├── form-handler.js
│ └── styles.css
├── .mcp.json # MCP server configuration
└── CLAUDE.md # Reference to KODE.md (your content preserved)
`Workflow Examples
$3
`bash
1. Initialize project
kode init2. Pull existing scripts
kode pull3. Start watch mode
kode watch4. Edit files - they auto-push on save
5. When ready, deploy to staging
kode deploy6. Test, then promote to production
kode production enable
kode deploy --promote
`$3
`bash
1. Initialize with MCP support
kode init2. Cache page structures for AI context
kode html https://mysite.com/page1 --save
kode html https://mysite.com/page2 --save3. AI can now use MCP tools to:
- Read page structure: kode_get_page_context
- Create scripts: kode_create_script
- Push changes: kode_push
- Deploy: kode_deploy
`$3
`bash
In your CI pipeline
kode push --all
kode deploy
Run tests...
kode deploy --promote
`$3
`bash
Something went wrong in production
kode rollback productionOr if deploy is stuck
kode deploy --force
`API Key
Get your API key from the Cure app:
1. Go to https://app.cure.no/tools/kode
2. Open your site settings
3. Generate an API key with appropriate permissions
$3
| Permission | CLI Commands |
|------------|--------------|
|
read | pull, status, html, pages, context |
| write | push, watch |
| deploy | deploy, rollback, production |
| delete | (delete scripts) |Security
$3
- API keys stored locally in
.cure-kode/config.json
- Directory is automatically gitignored during kode init
- Keys are SHA256/HMAC hashed before server storage (V2 keys use salt)$3
The HTML fetch feature includes protection against Server-Side Request Forgery:
- Blocks private IP ranges (127.x.x.x, 10.x.x.x, 172.16-31.x.x, 192.168.x.x)
- Blocks localhost and internal domain names
- Blocks cloud metadata endpoints (169.254.169.254)
- Only allows HTTP/HTTPS protocols
$3
1. Never commit
.cure-kode/config.json to version control
2. Use separate keys for different environments
3. Use read-only keys when possible
4. Rotate keys periodicallyTroubleshooting
$3
Run
kode init to initialize a project in the current directory.$3
Check that your API key:
- Starts with
ck_
- Has not expired
- Has the required permissions$3
Another deployment may be in progress. Wait or use:
`bash
kode deploy --force
`$3
Enable production before promoting:
`bash
kode production enable
kode deploy --promote
``- Node.js 18 or later
- Cure Kode API key
MIT