Dev Configuration
Configure dev mode for local template development
Dev Configuration
The dev: section in cyan.yaml configures dev mode for rapid local template development. When enabled with cyanprint try template --dev, it connects directly to a locally-running template server instead of building a Docker image.
Dev mode provides instant iteration by skipping Docker builds. Code changes take effect immediately when you re-run the try command.
Basic Structure
username: myorgname: my-template# ... other fields ...dev:template_url: http://localhost:5550blob_path: ./cyan
Configuration Reference
Prop
Type
template_url
The URL where your template server is accessible. The template server is typically started by running your template code locally.
Common values:
# Default port for TypeScript/JavaScript templatestemplate_url: http://localhost:5550# Custom porttemplate_url: http://localhost:8080# Full URL with path (if applicable)template_url: http://localhost:5550/api
The template server must be running before you execute cyanprint try template --dev. Pre-flight validation will fail if the URL is unreachable.
blob_path
Path to the directory containing your template's blob files (static files to be copied during generation). This path is used for direct filesystem access in dev mode.
# Relative path (recommended)blob_path: ./cyan# Absolute pathblob_path: /home/user/projects/my-template/cyan# Subdirectoryblob_path: ./template-files
How Dev Mode Works
Normal Mode: code ──► docker build ──► container ──► outputDev Mode: code ──────────────────────────────────► output
| Step | Normal Mode | Dev Mode |
|---|---|---|
| Build | Docker buildx | Skipped |
| Template access | Container on dynamic port | Direct to template_url |
| File access | Container filesystem | Local blob_path |
| Iteration speed | Slow (rebuild required) | Instant |
Complete Example
# Organization and identityusername: myorgname: node-servicedescription: Production-ready Node.js microservice template# Linksproject: https://docs.myorg.io/templates/node-servicesource: https://github.com/myorg/node-service-templatereadme: README.md# Discoverytags:- nodejs- microservice- typescript# Processor dependenciesprocessors:- myorg/base-processor# Plugin dependenciesplugins:- cyan/init-git# Dev mode configurationdev:template_url: http://localhost:5550blob_path: ./cyan
Usage
1. Start Your Template Server
Start your template locally (typically on port 5550):
cd cyanbun installbun run --watch index.ts
2. Run Try with Dev Flag
cyanprint try template . ./output --dev
The command:
- Reads the
dev:section fromcyan.yaml - Skips Docker image building
- Validates that
template_urlis reachable - Connects directly to your template server
- Uses
blob_pathfor filesystem access
Always test in normal mode before publishing. Dev mode skips the Docker build step, which may hide issues that would appear in production.