🧭 DragonDev β€” Getting Started

Welcome to the DragonDev guide!
This document walks you through installing, configuring, and using the Dragon CLI to create, publish, and manage Go-based project blueprints.


πŸš€ 1️⃣ Install the CLI

From source

go install github.com/getDragon-dev/dragon-cli/cmd/dragon@latest

Or clone for local development

git clone https://github.com/getDragon-dev/dragon-cli.git
cd dragon-cli
go build ./cmd/dragon
./dragon

🧩 2️⃣ Core Commands

πŸ”§ Registry Management

Dragon supports multiple registries, local or remote. You can list, add, remove, or set defaults β€” or just use a URL directly.

# list all configured registries
dragon registry list

# use a remote registry (auto-adds and sets as default)
dragon registry use https://getdragon.dev/registry.json

# add a local registry
dragon registry add --name local --url ~/dev/dragon-registry/registry.json

# control lookup order
dragon registry order set --names public,local

πŸ” Discover Blueprints

Search or list available blueprints across all registries.

# list blueprints from default registry
dragon list

# list all registries and show where each blueprint comes from
dragon list --all

# filter by tag
dragon list --tag go

# fuzzy search (name, description, tags)
dragon search --query cli --all

πŸ› οΈ 3️⃣ Create Your First Project

Generate a new Go project from a published blueprint.

dragon gen \
  -b api-service \
  -o mysvc \
  --router chi \
  --db postgres-gorm \
  --remote \
  --version ">=1.0.0" \
  --set Module=github.com/acme/mysvc \
  --interactive

What happens:

  • Pulls the api-service blueprint (from your active registry or the public one at getdragon.dev)
  • Downloads and extracts the template (if –remote is set)
  • Prompts for missing variables interactively
  • Renders all files using Go’s text/template + Sprig functions
  • Resulting structure:
mysvc/
 β”œβ”€β”€ cmd/mysvc/main.go
 β”œβ”€β”€ internal/
 β”‚   β”œβ”€β”€ config/config.go
 β”‚   β”œβ”€β”€ db/open.go
 β”‚   └── server/handler.go
 β”œβ”€β”€ migrations/
 β”œβ”€β”€ go.mod
 β”œβ”€β”€ Dockerfile
 └── atlas.hcl

πŸ“¦ 4️⃣ Publish a Blueprint

When your blueprint is ready to share, run:

dragon publish

This will:

  • Tag a new semantic version (e.g. v1.0.0)
  • Generate or update a changelog
  • Package the blueprint and update the registry
  • Push everything to your configured GitHub repository

Your CI/CD can also handle this via the built-in release flow.

βš™οΈ 5️⃣ Consume a Blueprint

Apply a published blueprint directly from the registry:

dragon get api-service

By default, this fetches from https://getdragon.dev/registry.json .

πŸ’» 6️⃣ Automation & CI

Integrate dragon into your CI pipelines (GitHub Actions, Drone, etc.):

dragon release --auto

This command bumps versions, regenerates the changelog, and updates registry.json automatically.

🧠 Pro Tips

  • Interactive mode: –interactive prompts you for template variables.
  • Dynamic completions: dragon gen -b will suggest available blueprints.
  • Local development: run with –registry ../dragon-registry/registry.json to test unpublished blueprints.
  • Multi-registry search: dragon list –all aggregates across all configured registries.

πŸ”— Next Steps

πŸ‘‰ Browse the Registry

πŸ‘‰ Download CLI Source

πŸ‘‰ Contribute Blueprints