{"slug":"cli-pages","title":"CLI: Static Sites","description":"Deploy and manage static sites using the DanubeData CLI.","section":"CLI","url":"https://docs.danubedata.ro/cli-pages","markdown_url":"https://docs.danubedata.ro/cli-pages.md","breadcrumbs":[{"title":"CLI","slug":null},{"title":"Static Sites","slug":"cli-pages"}],"headings":[{"level":1,"title":"CLI: Static Sites","id":"cli-static-sites"},{"level":2,"title":"Prerequisites","id":"prerequisites"},{"level":2,"title":"Quick start","id":"quick-start"},{"level":2,"title":"Linking a project","id":"linking-a-project"},{"level":3,"title":"Headless linking (CI/CD)","id":"headless-linking-cicd"},{"level":2,"title":"Deploying","id":"deploying"},{"level":3,"title":"Basic deploy","id":"basic-deploy"},{"level":3,"title":"Deploy a specific directory","id":"deploy-a-specific-directory"},{"level":3,"title":"Deploy without waiting","id":"deploy-without-waiting"},{"level":3,"title":"Using danube.json","id":"using-danubejson"},{"level":3,"title":"Framework examples","id":"framework-examples"},{"level":2,"title":"Deployments","id":"deployments"},{"level":3,"title":"List deployments","id":"list-deployments"},{"level":3,"title":"Roll back","id":"roll-back"},{"level":2,"title":"Custom domains","id":"custom-domains"},{"level":3,"title":"List domains","id":"list-domains"},{"level":3,"title":"Add a domain","id":"add-a-domain"},{"level":3,"title":"Verify a domain","id":"verify-a-domain"},{"level":3,"title":"Remove a domain","id":"remove-a-domain"},{"level":2,"title":"Complete workflow example","id":"complete-workflow-example"},{"level":2,"title":"Next steps","id":"next-steps"}],"format":"markdown","word_count":596,"content":"# CLI: Static Sites\n\nDeploy and manage static sites using the DanubeData CLI.\n\n## Prerequisites\n\n- [DanubeData CLI installed](https://docs.danubedata.ro/cli-overview)\n- Authenticated via `danube login` or `DANUBE_TOKEN`\n\n## Quick start\n\nDeploy a static site in 3 commands:\n\n```bash\n# 1. Link your project directory to a site\ndanube pages link\n\n# 2. Deploy\ndanube pages deploy\n```\n\nThat's it. Your site is live.\n\n## Linking a project\n\nBefore deploying, link your local directory to a DanubeData static site:\n\n```bash\ndanube pages link\n```\n\nThe CLI prompts you to:\n\n1. Select a team (if you belong to multiple)\n2. Choose an existing site or create a new one\n\nThis creates `.danube/project.json` in your project directory with the site ID and team ID.\n\n### Headless linking (CI/CD)\n\nSkip interactive prompts by setting environment variables:\n\n```bash\nexport DANUBE_SITE_ID=\"42\"\nexport DANUBE_TEAM_ID=\"1\"\n```\n\n## Deploying\n\n### Basic deploy\n\n```bash\ndanube pages deploy\n```\n\nDeploys the current directory. The CLI:\n\n1. Packages all files into a ZIP (excluding `.git`, `node_modules`, `.danube`, `.gitignore` patterns)\n2. Uploads the ZIP to DanubeData\n3. Polls the build status until completion (or timeout after 5 minutes)\n\n### Deploy a specific directory\n\n```bash\ndanube pages deploy --dir ./dist\n```\n\nUseful for framework builds where the output is in a subdirectory.\n\n### Deploy without waiting\n\n```bash\ndanube pages deploy --no-wait\n```\n\nUploads the files and exits immediately without waiting for the build to complete.\n\n### Using danube.json\n\nCreate a `danube.json` in your project root to configure the default deployment directory and exclude patterns:\n\n```json\n{\n  \"outputDir\": \"dist\",\n  \"ignore\": [\"*.map\", \"test/**\", \"*.test.js\"]\n}\n```\n\nWith this in place, `danube pages deploy` automatically deploys the `dist/` directory.\n\n### Framework examples\n\n**React (Vite):**\n```bash\nnpm run build\ndanube pages deploy --dir ./dist\n```\n\n**Next.js (static export):**\n```bash\nnpx next build\ndanube pages deploy --dir ./out\n```\n\n**Vue:**\n```bash\nnpm run build\ndanube pages deploy --dir ./dist\n```\n\n**Astro:**\n```bash\nnpm run build\ndanube pages deploy --dir ./dist\n```\n\n**Hugo:**\n```bash\nhugo\ndanube pages deploy --dir ./public\n```\n\n**Plain HTML:**\n```bash\ndanube pages deploy\n```\n\n## Deployments\n\n### List deployments\n\n```bash\ndanube pages deployments ls\n```\n\nShows all deployments with revision number, status, trigger type, and timestamps.\n\n### Roll back\n\n```bash\ndanube pages deployments rollback 3\n```\n\nActivates deployment revision 3. The rollback is instant — no rebuild required.\n\n## Custom domains\n\n### List domains\n\n```bash\ndanube pages domains ls\n```\n\nShows all domains with their type (default/custom), status, and verification date.\n\n### Add a domain\n\n```bash\ndanube pages domains add www.example.com\n```\n\nThe CLI returns DNS verification instructions. You need to:\n\n1. Add a DNS TXT record: `_danubedata-verify.www.example.com` with the provided token\n2. Verify the domain: `danube pages domains verify www.example.com`\n3. Add a CNAME record pointing `www.example.com` to your site's default domain\n\n### Verify a domain\n\n```bash\ndanube pages domains verify www.example.com\n```\n\nTriggers a DNS lookup to verify ownership. Run this after adding the TXT record.\n\n### Remove a domain\n\n```bash\ndanube pages domains remove www.example.com\n```\n\n## Complete workflow example\n\n```bash\n# Install the CLI\nnpm install -g @danubedata/cli\n\n# Authenticate\ndanube login\n\n# Navigate to your project\ncd my-website\n\n# Build your site (if using a framework)\nnpm run build\n\n# Link to a DanubeData static site\ndanube pages link\n\n# Deploy\ndanube pages deploy --dir ./dist\n\n# Add a custom domain\ndanube pages domains add www.mysite.com\n\n# Check deployment status\ndanube pages deployments ls\n```\n\n## Next steps\n\n- [CLI Overview](https://docs.danubedata.ro/cli-overview) — Installation, auth, and configuration\n- [CLI: Serverless Containers](https://docs.danubedata.ro/cli-serverless) — Container deployment commands\n- [Static Sites overview](https://docs.danubedata.ro/static-sites) — Full product reference\n- [Build with AI](https://docs.danubedata.ro/static-sites-ai) — Generate a site with an LLM and deploy via CLI\n\n---\n\n**Questions?** Contact support at support@danubedata.ro\n","prev":{"title":"Object Storage","slug":"cli-storage","url":"https://docs.danubedata.ro/cli-storage","markdown_url":"https://docs.danubedata.ro/cli-storage.md","json_url":"https://docs.danubedata.ro/cli-storage.json"},"next":{"title":"Rapids","slug":"cli-serverless","url":"https://docs.danubedata.ro/cli-serverless","markdown_url":"https://docs.danubedata.ro/cli-serverless.md","json_url":"https://docs.danubedata.ro/cli-serverless.json"},"index_url":"https://docs.danubedata.ro/index.json"}