Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

@dollardeploy/cli

Deploy apps to your own servers from the command line. Zero DevOps, full control.

npm versionLicense: MIT

The DollarDeploy CLI (ddc) lets you manage servers, deploy applications, and control your infrastructure — all from the terminal. Designed for CI/CD pipelines, AI agents, and developers who prefer the command line.

Installation

npm install -g @dollardeploy/cli

Or use npx:

npx @dollardeploy/cli help

Quick Start

1. Get an API Key

  1. Sign in at dollardeploy.com
  2. Go to SettingsAPI Keys
  3. Click Create API Key and copy it

2. Authenticate

# Interactive
ddc auth
# Non-interactive
ddc auth --api-key <your-api-key>

Your API key is saved to ~/.dollardeploy/auth and can be overridden with the --api-key flag or DOLLARDEPLOY_API_KEY environment variable.

3. Deploy

# Deploy from GitHub to an existing host
ddc deploy --url https://github.com/your-org/your-app --hostId <host-id># Deploy and auto-create a host
ddc deploy --url https://github.com/your-org/your-app --create-host
# Deploy from a template
ddc deploy --template nextjs-boilerplate --hostId <host-id>

Host Lifecycle

A host goes through a few stages: createprovisionprepare → (deploy apps) → deprovision / destroy.

ddc host create --provider ... runs all of the setup steps for you in one call. The individual commands exist for when you want to run a stage on its own — for example, provisioning a server for a host you created earlier, or re-preparing a host without touching the VM.

# 1. Create the host record and provision a server in one step
ddc host create --name my-server --provider hetzner
# ↳ creates the host, provisions the VM, tests SSH, installs services, prepares it# --- or run the stages yourself ---# 1a. Create just the host record (no server yet)
ddc host create --name my-server
# → prints the new host id, status: draft# 1b. Provision a server for that host
ddc host provision <host-id> --provider hetzner
# → status: active, IP assigned# 1c. Verify SSH connectivity
ddc host test<host-id># 1d. Prepare the host for deployments (installs Docker, configures the box)
ddc host prepare <host-id># 2. Deploy apps to it
ddc deploy --url https://github.com/org/repo --hostId <host-id># 3. When you're done, tear it down
ddc host destroy <host-id># deprovision the VM AND delete the host record# or, to keep the host record but delete the server:
ddc host deprovision <host-id># or, to stop managing it without deleting the server:
ddc host remove <host-id>

Tip: run ddc host list at any point to see each host's status and ip. Long-running stages (provision, prepare, deploy) print progress; add --json for machine-readable output.

Commands

ddc auth

Save your API key for future commands.

ddc auth # Interactive prompt
ddc auth --api-key <key># Non-interactive

API key resolution order: --api-key flag > DOLLARDEPLOY_API_KEY env var > ~/.dollardeploy/auth file.

ddc user

Show current user information.

ddc user

ddc host list

List all hosts in your account.

ddc host list
ddc host list --status active
ddc host list --json # Machine-readable output

ddc host get <id>

Show a single host. Plain-text output lists every host field except the noisy objects (health, apps, project) and includes the provision config formatted inline. Use --json or --all for the full host object.

ddc host get <host-id>
ddc host get <host-id> --json # Full host object incl. provision
ddc host get <host-id> --all # Full host object as key: value

ddc host create

Create and provision a new host. You need to set the integration with your cloud provider first in the DollarDeploy Settings => Integrations.

# Just create a host entry
ddc host create --name my-server
# Create a host on Hetzner
ddc host create --name my-server --provider hetzner --type cpx31 --region fsn1
# Create a host on DigitalOcean
ddc host create --name my-server --provider do --type s-2vcpu-4gb --region fra1
# Create a host on Verda Cloud (formerly DataCrunch)
ddc host create --name my-server --provider verda --type CPU.4V.16G --region FIN-01
# Create a host with Docker and PostgreSQL
ddc host create --name my-server --services docker,postgres
OptionDescriptionDefault
--nameHost nameauto-generated
--providerCloud provider: hetzner, do, datacrunchhetzner
--typeInstance typecax11
--regionProvider regionfsn1
--imageOS imageubuntu-24.04
--servicesComma-separated services to installdocker
--skip-prepareSkip host preparation stepfalse
--timeoutTimeout in milliseconds600000

ddc host provision <id>

Provision (or reprovision) a server for an existing host. Pass provider flags to save the provider config before provisioning; omit them to provision using the config already saved on the host.

# Provision using flags
ddc host provision <host-id> --provider hetzner --type cax11 --region fsn1
# Provision using the host's already-saved provider config
ddc host provision <host-id>
OptionDescriptionDefault
--providerSave this provider before provisioning
--typeInstance type (uses provider default if omitted)provider based
--regionProvider region (uses provider default if omitted)provider based
--imageOS image (uses provider default if omitted)provider based
--timeoutTimeout in milliseconds600000

Not sure which --type, --region, or --image values are valid? Run ddc provision --provider <p> to list everything the provider supports.

ddc host test <id>

Test the SSH connection to a host.

ddc host test<host-id>

ddc host prepare <id>

Prepare a host for deployment. This will install the necessary services and configure the host for deployment.

ddc host prepare <host-id>

ddc host service

Manage the services (Docker, PostgreSQL, etc.) installed on a host.

# List installed services
ddc host service list <host-id># Show a single service (--all for the full object)
ddc host service get <host-id><service-id># Install a service
ddc host service add <host-id> docker
# Remove a service
ddc host service remove <host-id><service-id>

ddc host deprovision <id>

Deprovision the server (removes the VM from your cloud provider) but keep the host record in DollarDeploy, so you can provision it again later.

ddc host deprovision <host-id>
ddc host deprovision <host-id> --yes # Skip confirmation

ddc host destroy <id>

Deprovision and permanently delete a host. This removes the VM from your cloud provider and deletes the host record along with all apps on it.

ddc host destroy <host-id>
ddc host destroy <host-id> --yes # DANGEROUS: Skip confirmation

ddc host remove <id>

Remove a host from DollarDeploy without deprovisioning. The server continues running but is no longer managed.

ddc host remove <host-id>
ddc host remove <host-id> --yes # DANGEROUS: Skip confirmation

ddc provision

List the regions, instance types, and images a provider supports, queried live from the provider API. Use it to discover valid --type, --region, and --image values before running ddc host create or ddc host provision.

The provider must be connected first (Settings → Integrations in the dashboard). --provider is required; all other flags narrow down the instance type list.

# List everything available for a provider
ddc provision --provider hetzner
# Only show types available in a region
ddc provision --provider hetzner --region fsn1
# Only show ARM types with at least 4 vCPUs and 8 GB memory
ddc provision --provider hetzner --arch arm64 --cpu 4 --memory 8192
# Full config as JSON (regions, types, images, defaults)
ddc provision --provider do --json

Example output:

Provider: hetzner default region: fsn1 default image: ubuntu-24.04 default arch: arm64
Regions:
id label
---- ------------
fsn1 Falkenstein
nbg1 Nuremberg
hel1 Helsinki
...
Instance types:
type cpu memoryGB diskGB arch gpu regions
----- --- -------- ------ ----- --- -------
cax11 2 4 40 arm64 all
cax21 4 8 80 arm64 all
...
Images:
image
------------
ubuntu-24.04
debian-12
...
OptionDescriptionDefault
--providerRequired. Cloud provider: hetzner, do, datacrunch
--regionFilter instance types available in a region
--typeShow details for a specific instance type
--archFilter by architecture (e.g. arm64, amd64)
--cpuFilter to types with at least N vCPUs
--memoryFilter to types with at least N MB of memory
--diskFilter to types with at least N GB of disk

ddc deploy

Deploy an application to a host. Supports GitHub repos, templates, and redeployment of existing apps.

Also available as ddc app deploy.

# Deploy from GitHub (will redeploy existing app if URL matches)
ddc deploy --url https://github.com/org/repo --hostId <host-id># Deploy with a new host
ddc deploy --url https://github.com/org/repo --create-host
# Deploy a template
ddc deploy --template twenty-crm --hostId <host-id># Redeploy an existing app
ddc deploy --appId <app-id># Deploy with environment variables
ddc deploy --url https://github.com/org/repo --hostId <host-id> --env:DATABASE_URL postgres://...
# Deploy with app property overrides
ddc deploy --url https://github.com/org/repo --hostId <host-id> --set:mainPort 8080

The deploy command is smart about redeployment — if you deploy the same GitHub URL to the same host, it will detect the existing app and redeploy it instead of creating a duplicate.

OptionDescription
--urlGitHub repository URL
--templateTemplate ID to deploy
--appIdExisting app ID to redeploy
--hostIdTarget host ID
--create-hostCreate a new host for deployment
--nameApp name
--env NAME=VALUESet environment variable
--set:<key>Set app property (mainPort, env:PROPERTY_NAME, etc.)
--providerProvider for --create-host
--typeInstance type for --create-host
--regionRegion for --create-host
--servicesServices for --create-host
--timeoutTimeout in milliseconds (default: 600000)

ddc build

Build an app, optionally deploying it after build.

Also available as ddc app build.

ddc build <app-id>
ddc build <app-id> --deploy
OptionDescription
--deployDeploy after building
--timeoutTimeout in milliseconds (default: 600000)

ddc app list

List all apps in your account.

ddc app list
ddc app list --json

ddc app get <id>

Show a single app. Plain-text output lists every app field except the noisy objects (host, project); env is formatted inline. Use --fields to pick specific columns, or --json/--all for the full app object.

ddc app get <app-id>
ddc app get <app-id> --json # Full app object incl. env
ddc app get <app-id> --fields id,name,status,hostname
ddc app get <app-id> --all # Full app object as key: value

ddc app remove <id>

Undeploy an app from its host. By default the app is also deleted; use --keep to undeploy but keep the app configuration for later.

ddc app remove <app-id># Undeploy and delete the app
ddc app remove <app-id> --keep # Undeploy but keep the configuration
ddc app remove <app-id> --yes # Skip confirmation
OptionDescription
--keepKeep the app configuration (undeploy only)
--yes, --forceSkip confirmation prompt
--timeoutTimeout in milliseconds (default: 600000)

ddc template list

List all templates.

ddc template list
ddc template list <search>
ddc template list --json

ddc ssh add

Add an SSH public key to your DollarDeploy account.

ddc ssh add ${HOME}/.ssh/id_rsa --name my-key
OptionDescription
--nameKey name (default: cli-added-key)

ddc ssh list

List all SSH keys in your account.

ddc ssh list
ddc ssh list --name my-key

ddc ssh remove <id>

Delete an SSH key from your account.

ddc ssh remove <key-id>
ddc ssh remove <key-id> --yes # Skip confirmation

ddc task

Inspect and control the background tasks that run provisioning, builds, and deployments.

ddc task list # List recent tasks
ddc task list --status running # Filter by status
ddc task get <task-id># Show a single task
ddc task cancel <task-id># Cancel a running task

ddc logs

Show journal logs. Filter by task, app, or host, and optionally follow for new entries.

ddc logs --task <task-id>
ddc logs --app <app-id>
ddc logs --host <host-id>
ddc logs --app <app-id> --follow # Stream new log entries
OptionDescriptionDefault
--taskFilter logs by task ID
--appFilter logs by app ID
--hostFilter logs by host ID
--typeLog types (comma separated: info,warn,error,health,log,ai)info,warn,error
--limitNumber of records50
--follow, -fContinuously poll for new logsfalse

Global Options

OptionDescription
--api-key <key>API key (overrides stored auth and env var)
--base-url <url>API base URL (default: https://dollardeploy.com)
--jsonOutput as JSON (machine-readable)
--verbose, -vEnable verbose logging
--help, -hShow help
--version, -VShow version

JSON Output (AI Agent Friendly)

All commands support --json for structured, machine-readable output:

ddc host list --json
ddc deploy --url https://github.com/org/repo --hostId <id> --json

For get/list commands (app, host, host service), --json returns the full object — every field the API returns, including env — not just the curated columns shown in the plain-text table. Use --all to get the same full object in plain-text (key: value) form.

JSON output goes to stdout, while progress/status messages go to stderr, making it easy to pipe results into other tools.

Environment Variables

VariableDescriptionDefault
DOLLARDEPLOY_API_KEYYour API key
DOLLARDEPLOY_BASE_URLAPI base URLhttps://dollardeploy.com

Provider Defaults

ProviderTypeRegionImage
Hetznercax11fsn1ubuntu-24.04
DigitalOceans-2vcpu-4gbfra1ubuntu-24-04
Verda CloudCPU.4V.16GFIN-01ubuntu-24.04

CI/CD Integration

GitHub Actions

name: Deploy my appon:
push:
branches: [main]jobs:
deploy:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- name: Setup Node.jsuses: actions/setup-node@v4with:
node-version: "22"
- name: Deployenv:
DOLLARDEPLOY_API_KEY: ${{ secrets.DOLLARDEPLOY_API_KEY }}run: | npm install -g @dollardeploy/cli ddc deploy --url ${{ github.server_url }}/${{ github.repository }}

Programmatic Usage

Use the CLI as a Node.js library:

const{ createApiClient, waitForTask, checkUrl }=require("@dollardeploy/cli");constapi=createApiClient({apiKey: process.env.DOLLARDEPLOY_API_KEY,baseUrl: "https://dollardeploy.com"});// List all hostsconsthosts=awaitapi.listHosts();// Create and provision a hostconsthost=awaitapi.createHost("my-server");awaitapi.saveProvision(host.id,{provider: "hetzner",providerType: "cax11",providerRegion: "fsn1",image: "ubuntu-24.04"});consttask=awaitapi.startProvision(host.id);awaitwaitForTask(api,task.id);// Deploy an appconstapp=awaitapi.createApp({repositoryUrl: "https://github.com/org/repo",hostId: host.id,name: "my-app"});constbuildTask=awaitapi.buildApp(app.id,{deploy: true});awaitwaitForTask(api,buildTask.id);// Verify deploymentawaitcheckUrl(`https://${app.hostname}`);

API Client Methods

Hosts

MethodDescription
createHost(name?)Create a new host
getHost(id)Get host details
listHosts(status?)List all hosts
updateHost(id, data)Update host configuration
deleteHost(id)Delete a host
testConnection(hostId)Test SSH connection
prepareHost(hostId)Prepare host for deployments

Provisioning

MethodDescription
getProvision(hostId)Get provision config
saveProvision(hostId, data)Save provision config
provisionHost(hostId)Start provisioning
startProvision(hostId)Alias for provisionHost
getProviderConfig(provider, filters?)List a provider's regions, instance types, and images
deprovisionHost(hostId, deleteHost?)Deprovision (deletes the host record when deleteHost is true, the default)

Services

MethodDescription
listServices(hostId)List installed services
getService(hostId, serviceId)Get a single service
createService(hostId, type)Install a service
deleteService(hostId, serviceId)Remove a service

Apps

MethodDescription
createApp(config)Create a new app
getApp(id)Get app details
listApps()List all apps
updateApp(id, data)Update app configuration
suggestApp(app)Get AI configuration suggestions
buildApp(id, options?)Build app (optionally deploy)
deployApp(id)Deploy built app
deleteApp(id)Delete an app
removeApp(id, options?)Remove app from host

SSH Keys

MethodDescription
listSshKeys()List all SSH keys
createSshKey(data)Create an SSH key
deleteSshKey(id)Delete an SSH key

Templates

MethodDescription
getTemplates()List all templates
getTemplate(id)Get template details
launchTemplate(config)Launch from template

Tasks

MethodDescription
getTask(id)Get task status
listTasks(status?)List tasks (optionally filter)
cancelTask(id)Cancel a running task
getTaskJournal(id)Get task logs
getLogs(params)Query journal logs with filters

User

MethodDescription
getUser()Get current user info

Links

License

CLI is licensed under MIT © DollarDeploy

About

Deploy apps to your own servers from the command line. Zero DevOps, full control.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages