CLI: Static Sites
Deploy and manage static sites using the DanubeData CLI.
Prerequisites
- DanubeData CLI installed
- Authenticated via
danube loginorDANUBE_TOKEN
Quick start
Deploy a static site in 3 commands:
# 1. Link your project directory to a site
danube pages link
# 2. Deploy
danube pages deploy
That's it. Your site is live.
Linking a project
Before deploying, link your local directory to a DanubeData static site:
danube pages link
The CLI prompts you to:
- Select a team (if you belong to multiple)
- Choose an existing site or create a new one
This creates .danube/project.json in your project directory with the site ID and team ID.
Headless linking (CI/CD)
Skip interactive prompts by setting environment variables:
export DANUBE_SITE_ID="01a0d8fa-35fa-709d-b9d1-319c28ba28fa"
export DANUBE_TEAM_ID="4"
The site ID is a UUID — danube pages link prints it, and saves it as siteId in .danube/project.json. DANUBE_TEAM_ID is the project the site belongs to (teamId). Headless deploys need CLI 1.6.0 or newer.
Deploying
Basic deploy
danube pages deploy
Deploys the current directory. The CLI:
- Packages all files into a ZIP (excluding
.git,node_modules,.danube,.gitignorepatterns) - Uploads the ZIP to DanubeData
- Waits for that upload's build, then for the new revision to be published, then until your site's URL serves it — and only then prints
Live at. If the build fails, the error is printed and the command exits with status 1.
Deploy a specific directory
danube pages deploy --dir ./dist
Useful for framework builds where the output is in a subdirectory.
Deploy without waiting
danube pages deploy --no-wait
Uploads the files and exits immediately without waiting for the build to complete.
Using danube.json
Create a danube.json in your project root to configure the default deployment directory and exclude patterns:
{
"outputDir": "dist",
"ignore": ["*.map", "test/**", "*.test.js"]
}
With this in place, danube pages deploy automatically deploys the dist/ directory.
Framework examples
React (Vite):
npm run build
danube pages deploy --dir ./dist
Next.js (static export):
npx next build
danube pages deploy --dir ./out
Vue:
npm run build
danube pages deploy --dir ./dist
Astro:
npm run build
danube pages deploy --dir ./dist
Hugo:
hugo
danube pages deploy --dir ./public
Plain HTML:
danube pages deploy
Deployments
List deployments
danube pages deployments ls
Shows all deployments with revision number, status, trigger type, and timestamps.
Roll back
danube pages deployments rollback 3
Activates deployment revision 3. The rollback is instant — no rebuild required. The CLI waits until the platform has published it; add --no-wait to return as soon as the rollback is accepted.
Custom domains
List domains
danube pages domains ls
Shows all domains with their type (default/custom), status, and verification date.
Add a domain
danube pages domains add www.example.com
The CLI returns DNS verification instructions. You need to:
- Add a DNS TXT record:
_danubedata-verify.www.example.comwith the provided token - Verify the domain:
danube pages domains verify www.example.com - Add a CNAME record pointing
www.example.comto your site's default domain
Verify a domain
danube pages domains verify www.example.com
Triggers a DNS lookup to verify ownership and waits for the result. Run this after adding the TXT record. If the record is not found yet, the CLI prints it again and exits with status 1 — DNS changes can take a while to propagate, so try again later. Add --no-wait to only start the check.
Remove a domain
danube pages domains remove www.example.com
Complete workflow example
# Install the CLI
npm install -g @danubedata/cli
# Authenticate
danube login
# Navigate to your project
cd my-website
# Build your site (if using a framework)
npm run build
# Link to a DanubeData static site
danube pages link
# Deploy
danube pages deploy --dir ./dist
# Add a custom domain
danube pages domains add www.mysite.com
# Check deployment status
danube pages deployments ls
Next steps
- CLI Overview — Installation, auth, and configuration
- CLI: Serverless Containers — Container deployment commands
- Static Sites overview — Full product reference
- Build with AI — Generate a site with an LLM and deploy via CLI
Questions? Contact support at support@danubedata.ro