@curenorway/kode-cli
v1.9.2
Published
CLI tool for Cure Kode - manage JS/CSS scripts for Webflow sites
Readme
Cure Kode CLI
Command-line tool for managing JavaScript and CSS scripts for Webflow sites via Cure Kode CDN.
Installation
npm install -g @curenorway/kode-cli
# or
pnpm add -g @curenorway/kode-cliQuick Start
# Initialize a new project
kode init
# Pull existing scripts from remote
kode pull
# Edit your scripts locally...
# Push changes
kode push
# Deploy to staging
kode deploy
# Watch for changes and auto-push
kode watchCommands
kode init
Initialize a Cure Kode project in the current directory.
kode initThis creates a .cure-kode/config.json file with your site configuration.
kode pull
Download scripts from remote to your local scripts directory.
kode pull # Pull all scripts
kode pull --force # Overwrite local changeskode 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 messagekode watch
Watch for file changes and automatically push to remote.
kode watch # Watch and push
kode watch --deploy # Watch, push, and deploy
kode watch --env production # Watch with specific environmentkode deploy
Deploy scripts to staging or production.
kode deploy # Deploy to staging (default)
kode deploy --env production # Deploy to production
kode deploy --promote # Promote staging to production
kode deploy -n "Release v2" # Deploy with noteskode html <url>
Fetch and analyze HTML from a URL.
kode html https://mysite.com
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 onlykode status
Show current project status.
kode statusConfiguration
Project Config (.cure-kode/config.json)
{
"siteId": "uuid",
"siteSlug": "my-site",
"siteName": "My Site",
"apiKey": "ck_...",
"scriptsDir": "kode",
"environment": "staging"
}Global Config
Global configuration is stored in ~/.config/cure-kode/config.json:
{
"apiUrl": "https://app.cure.no"
}Environment Variables
CURE_KODE_API_KEY- API key (overrides project config)CURE_KODE_API_URL- API URL (overrides global config)
Project Structure
your-project/
├── .cure-kode/
│ ├── config.json # Project configuration
│ └── scripts.json # Script metadata (versions, sync status)
└── kode/ # Your scripts directory
├── init.js
├── tracking.js
└── styles.cssWorkflow Examples
Basic Development
# 1. Initialize project
kode init
# 2. Pull existing scripts
kode pull
# 3. Start watch mode
kode watch
# 4. Edit files in your editor - they auto-push on save
# 5. When ready, deploy
kode deployCI/CD Integration
# In your CI pipeline
kode push --all
kode deploy --env staging
# Run tests...
kode deploy --promoteTeam Workflow
# Developer 1: Pull latest
kode pull --force
# Developer 2: Push changes
kode push -m "Added new animation"
# Deploy to staging for review
kode deploy -n "Review build"
# After approval, promote to production
kode deploy --promoteAPI Key
Get your API key from the Cure app:
- Go to https://app.cure.no/tools/kode
- Open your site settings
- Generate an API key with appropriate permissions
Permissions
read- Pull scripts, view statuswrite- Push scriptsdeploy- Deploy to staging/productiondelete- Delete scripts
Requirements
- Node.js 18 or later
- Cure Kode API key
Security
API Key Storage
- API keys stored locally in
.cure-kode/config.json - Directory is automatically gitignored during
kode init - Keys are SHA256 hashed before server storage
Permissions Model
API keys have granular, site-scoped permissions:
| Permission | CLI Commands |
|------------|--------------|
| read | pull, status, html, pages, context |
| write | push, watch |
| deploy | deploy |
| delete | (delete scripts) |
Network Security
The HTML fetch feature (kode html) includes SSRF protection:
- 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
- Never commit
.cure-kode/config.jsonto version control - Use separate keys for different environments
- Use read-only keys when possible
- Rotate keys periodically and when team members leave
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
"Script not found"
The script may not exist on remote. Use kode push to create it.
License
MIT
