@cogitator-ai/deploy
v0.1.3
Published
One-command deployment for Cogitator agents
Readme
@cogitator-ai/deploy
One-command deployment engine for Cogitator agents. Supports Docker and Fly.io targets with auto-detection of project configuration.
Installation
pnpm add @cogitator-ai/deployQuick Start
Via CLI
# Deploy to Docker (default)
cogitator deploy
# Deploy to Fly.io
cogitator deploy --target fly
# Dry run — see what would happen
cogitator deploy --dry-run
# Check status
cogitator deploy status
# Tear down
cogitator deploy destroyProgrammatic API
import { Deployer } from '@cogitator-ai/deploy';
const deployer = new Deployer();
// Plan deployment (preflight checks, no execution)
const plan = await deployer.plan({
projectDir: process.cwd(),
target: 'docker',
noPush: true,
});
// Execute deployment
const result = await deployer.deploy({
projectDir: process.cwd(),
target: 'fly',
});
console.log(result.url); // https://my-app.fly.devConfiguration
Add a deploy section to cogitator.yml:
deploy:
target: fly
port: 3000
region: iad
instances: 2
registry: ghcr.io/myorg/myapp
services:
redis: true
postgres: true
secrets:
- OPENAI_API_KEY
- DATABASE_URLAuto-Detection
The deploy engine automatically detects:
| What | Source | Example |
| ---------------- | ----------------------------- | ---------------------------------- |
| Server adapter | package.json dependencies | @cogitator-ai/express → Express |
| Services | cogitator.yml memory config | adapter: redis → Redis service |
| Required secrets | LLM provider configs | openai → OPENAI_API_KEY |
| Ollama Cloud | Model suffix or API key | :cloud suffix → OLLAMA_API_KEY |
Deploy Targets
Docker
Generates a multi-stage Dockerfile and optional docker-compose.prod.yml:
cogitator deploy --target docker # Build only
cogitator deploy --target docker --push # Build + push to registryFly.io
Generates fly.toml and deploys via flyctl:
cogitator deploy --target fly --region iadRequires flyctl installed and authenticated.
Architecture
ProjectAnalyzer → ArtifactGenerator → DeployProvider → Result
(detect config) (Dockerfile, etc.) (docker/fly) (url, status)- ProjectAnalyzer — reads
package.jsonandcogitator.ymlto detect server, services, secrets - ArtifactGenerator — generates Dockerfile, docker-compose, fly.toml from templates
- DeployProvider — executes preflight checks, builds, deploys (Docker or Fly.io)
- Deployer — orchestrator that ties it all together
See Also
- Deployment Guide — full documentation with CI/CD examples
- CLI Reference — all CLI commands
