npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@curenorway/kode-cli

v2.0.0

Published

CLI for Cure Kode CDN - manage, deploy, and sync JS/CSS scripts for Webflow sites with AI agent support

Downloads

364

Readme

Cure Kode CLI

Command-line tool for managing JavaScript and CSS scripts for Webflow sites via Cure Kode CDN.

Features

  • Webflow Integration - Verifies init.js injection status (auto-injected at site creation in Cure App)
  • 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

Installation

npm install -g @curenorway/kode-cli
# or
pnpm add -g @curenorway/kode-cli

Quick Start

# Initialize a new project (creates config + AI context)
kode init

# Pull existing scripts from remote
kode pull

# Edit your scripts locally in .cure-kode-scripts/

# Push changes
kode push

# Deploy to staging
kode deploy

# Watch for changes and auto-push
kode watch

Commands

kode init

Initialize a Cure Kode project in the current directory.

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)
  • .claude/skills/deploy/ - /deploy slash command for Claude Code
  • .claude/skills/webflow-patterns/ - Webflow DOM reference (auto-loaded by Claude when relevant)

Verifies that init.js has been auto-injected into Webflow (this happens when the site is created in the Cure App). If not yet injected, prompts you to run kode webflow inject.

kode pull

Download scripts from remote to your local scripts directory.

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

kode push

Upload local scripts to remote.

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

kode watch

Watch for file changes and automatically push to remote.

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

kode deploy

Deploy scripts to staging or production.

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.

kode rollback

Rollback to a previous deployment.

kode rollback               # Rollback staging to previous version
kode rollback production    # Rollback production to previous version

kode production

Manage production environment (disabled by default for safety).

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

kode html <url>

Fetch and analyze HTML from a URL.

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

kode pages

List cached page contexts.

kode pages                  # List all cached pages
kode pages --json           # Output as JSON

kode library

Browse and use the global script library (Bibliotek). Contains reusable snippets like GSAP animations, form handlers, scroll effects. Supports folders, editing, and soft-delete with 30-day recovery.

kode library                    # List all library snippets
kode library --tree             # Show folder tree view
kode library search "scroll"    # Search by name or tags
kode library add gsap-scroll-reveal  # Copy snippet into project
kode library pull               # Download all as local references
kode library push my-script.js  # Push a local script to the library
kode library push my-script.js --folder animations  # Push to folder
kode library update <slug>      # Update snippet from local file
kode library update <slug> --file path/to/file.js   # Update from specific file
kode library folders            # List library folders
kode library folders --create "Animations"           # Create folder
kode library trash              # List trashed snippets
kode library trash --restore <id>  # Restore from trash
kode library trash --empty      # Permanently delete all trash

Library snippets are reference material — they live in .cure-kode-scripts/library/ and are never deployed. Use kode library add to copy a snippet into your project scripts, then adapt it.

kode context

View and manage AI context.

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

kode status

Show current project status with staleness indicators.

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

kode doctor

Diagnose configuration and environment issues.

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

kode diff <script>

Show differences between local and remote script versions.

kode diff my-script    # Compare local vs remote

kode sync

Bidirectional sync with conflict detection.

kode sync              # Sync both directions
kode sync --dry-run    # Preview what would change

kode webflow

Manage the Webflow Custom Code integration. The init.js script is auto-injected when a Kode site is created in the Cure App. These commands let you verify status, re-inject, or remove it.

kode webflow status                  # Check if init.js is injected (default)
kode webflow inject                  # Inject init.js into Webflow <head>
kode webflow inject --location footer  # Inject into footer instead
kode webflow remove                  # Remove init.js from Webflow

How it works:

  1. Registers init.js as a hosted script with Webflow
  2. Applies it to the site's <head> via the Custom Code API
  3. Preserves any other scripts already managed by the API
  4. Does not affect manually-added code in the Webflow Designer

Note: After inject/remove, you must publish the Webflow site for changes to take effect.

Configuration

Project Config (.cure-kode/config.json)

{
  "siteId": "uuid",
  "siteSlug": "my-site",
  "siteName": "My Site",
  "apiKey": "ck_...",
  "scriptsDir": ".cure-kode-scripts",
  "environment": "staging"
}

Scripts Directory

Default: .cure-kode-scripts/ (avoids conflicts with AI-generated scripts/ folders)

Environment Variables

  • CURE_KODE_API_KEY - API key (overrides project config)
  • CURE_KODE_API_URL - API URL (default: https://app.cure.no)

Project Structure

your-project/
├── .claude/skills/       # Claude Code skills
│   ├── deploy/           # /deploy — push and deploy workflow
│   └── webflow-patterns/ # Auto-loaded Webflow DOM reference
├── .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
│   └── library/          # Reference only (never deployed)
│       ├── animations/
│       ├── forms/
│       └── utilities/
├── .mcp.json             # MCP server configuration
└── CLAUDE.md             # Reference to KODE.md (your content preserved)

Claude Code Skills

kode init generates two Claude Code skills in .claude/skills/:

/deploy

Type /deploy in Claude Code to push and deploy to staging. Add --promote to promote to production.

Both you and Claude can use this — Claude will also invoke it when it finishes making changes and needs to publish them.

webflow-patterns (auto-loaded)

Background knowledge about Webflow DOM structure, reliable selectors, component patterns, and common pitfalls. Claude loads this automatically when writing or debugging Webflow scripts — it doesn't appear in the / menu.

Includes:

  • Reliable vs unreliable CSS selectors for Webflow
  • DOM-ready patterns with Webflow's IX2 engine
  • Component reference (Navbar, Tabs, Slider, Dropdown, CMS lists, Forms)
  • CSS specificity rules with Webflow's stylesheet
  • Cure Kode script loading order and window.CK API

The detailed reference lives in webflow-patterns/reference.md — Claude reads it when it needs specifics.

Workflow Examples

Basic Development

# 1. Initialize project
kode init

# 2. Pull existing scripts
kode pull

# 3. Start watch mode
kode watch

# 4. Edit files - they auto-push on save

# 5. When ready, deploy to staging
kode deploy

# 6. Test, then promote to production
kode production enable
kode deploy --promote

AI-Assisted Development

# 1. Initialize with MCP support
kode init

# 2. Cache page structures for AI context
kode html https://mysite.com/page1 --save
kode html https://mysite.com/page2 --save

# 3. 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

CI/CD Integration

# In your CI pipeline
kode push --all
kode deploy
# Run tests...
kode deploy --promote

Emergency Rollback

# Something went wrong in production
kode rollback production

# Or 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

Permissions

| Permission | CLI Commands | |------------|--------------| | read | pull, status, html, pages, context | | write | push, watch | | deploy | deploy, rollback, production | | delete | (delete scripts) |

Security

API Key Storage

  • 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)

SSRF Protection

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

Best Practices

  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 periodically

Troubleshooting

"No project found"

Run kode init to initialize a project in the current directory.

"API key invalid"

Check that your API key:

  • Starts with ck_
  • Has not expired
  • Has the required permissions

"Deploy lock held"

Another deployment may be in progress. Wait or use:

kode deploy --force

"Production not enabled"

Enable production before promoting:

kode production enable
kode deploy --promote

Requirements

  • Node.js 18 or later
  • Cure Kode API key

License

MIT