{"slug":"cli-overview","title":"DanubeData CLI","description":"The DanubeData CLI (danube) lets you manage your entire DanubeData infrastructure from the terminal — VPS instances, object storage, static sites, and serverless containers. Built with Node.js, it pro...","section":"CLI","url":"https://docs.danubedata.ro/cli-overview","markdown_url":"https://docs.danubedata.ro/cli-overview.md","breadcrumbs":[{"title":"CLI","slug":null},{"title":"Overview","slug":"cli-overview"}],"headings":[{"level":1,"title":"DanubeData CLI","id":"danubedata-cli"},{"level":2,"title":"Installation","id":"installation"},{"level":2,"title":"Authentication","id":"authentication"},{"level":3,"title":"Browser auth (recommended)","id":"browser-auth-recommended"},{"level":3,"title":"Interactive login","id":"interactive-login"},{"level":3,"title":"Token flag","id":"token-flag"},{"level":3,"title":"Environment variable","id":"environment-variable"},{"level":3,"title":"Check your identity","id":"check-your-identity"},{"level":3,"title":"Log out","id":"log-out"},{"level":2,"title":"Configuration","id":"configuration"},{"level":3,"title":"Credentials","id":"credentials"},{"level":3,"title":"Project configuration","id":"project-configuration"},{"level":3,"title":"Build configuration","id":"build-configuration"},{"level":3,"title":"Environment variables","id":"environment-variables"},{"level":2,"title":"Commands overview","id":"commands-overview"},{"level":3,"title":"General","id":"general"},{"level":3,"title":"VPS Instances (danube vps)","id":"vps-instances-danube-vps"},{"level":3,"title":"Object Storage (danube storage)","id":"object-storage-danube-storage"},{"level":3,"title":"Static Sites (danube pages)","id":"static-sites-danube-pages"},{"level":3,"title":"Serverless Containers (danube rapids)","id":"serverless-containers-danube-rapids"},{"level":2,"title":"File exclusion","id":"file-exclusion"},{"level":2,"title":"CI/CD usage","id":"cicd-usage"},{"level":3,"title":"GitHub Actions example","id":"github-actions-example"},{"level":2,"title":"Update notifications","id":"update-notifications"},{"level":2,"title":"Exit codes","id":"exit-codes"},{"level":2,"title":"Next steps","id":"next-steps"}],"format":"markdown","word_count":954,"content":"# DanubeData CLI\n\nThe DanubeData CLI (`danube`) lets you manage your entire DanubeData infrastructure from the terminal — VPS instances, object storage, static sites, and serverless containers. Built with Node.js, it provides interactive prompts, real-time build tracking, and CI/CD-friendly configuration.\n\n## Installation\n\nRequires Node.js 18 or later.\n\n```bash\nnpm install -g @danubedata/cli\n```\n\nVerify the installation:\n\n```bash\ndanube --version\n```\n\n## Authentication\n\n### Browser auth (recommended)\n\n```bash\ndanube auth\n```\n\nOpens your browser to log in and authorize the CLI automatically — no manual token copying.\n\n### Interactive login\n\n```bash\ndanube login\n```\n\nYou will be prompted to enter your API token. To create a token:\n\n1. Log in to the DanubeData dashboard\n2. Go to **Settings > API Tokens**\n3. Click **Create New Token** and copy the token\n\n### Token flag\n\n```bash\ndanube login --token YOUR_API_TOKEN\n```\n\n### Environment variable\n\nSet the `DANUBE_TOKEN` environment variable to skip the login step entirely. This is the recommended method for CI/CD pipelines.\n\n```bash\nexport DANUBE_TOKEN=\"your-api-token\"\n```\n\n### Check your identity\n\n```bash\ndanube whoami\n```\n\nShows your name, email, and team memberships.\n\n### Log out\n\n```bash\ndanube logout\n```\n\nRemoves stored credentials from `~/.danube/config.json`.\n\n## Configuration\n\n### Credentials\n\nStored at `~/.danube/config.json` with `0600` permissions:\n\n```json\n{\n  \"token\": \"your-api-token\"\n}\n```\n\n### Project configuration\n\nCreated by `danube pages link`, stored at `.danube/project.json`:\n\n```json\n{\n  \"siteId\": 42,\n  \"teamId\": 1,\n  \"siteName\": \"my-portfolio\",\n  \"defaultDomain\": \"my-portfolio-abc.pages.danubedata.ro\"\n}\n```\n\n### Build configuration\n\nOptional `danube.json` in your project root:\n\n```json\n{\n  \"outputDir\": \"dist\",\n  \"ignore\": [\"*.map\", \"test/**\"]\n}\n```\n\n- **outputDir** — Directory to deploy (default: current directory)\n- **ignore** — Additional file patterns to exclude from the deployment\n\n### Environment variables\n\n| Variable | Description |\n|----------|-------------|\n| `DANUBE_TOKEN` | API token (alternative to `danube login`) |\n| `DANUBE_API_BASE` | Override API base URL (default: `https://danubedata.ro`) |\n| `DANUBE_SITE_ID` | Site ID for headless CI/CD (skips interactive linking) |\n| `DANUBE_TEAM_ID` | Team ID for headless CI/CD |\n| `DANUBE_SITE_NAME` | Site name for headless CI/CD |\n| `CI` | Suppresses update notifications |\n| `DANUBE_NO_UPDATE_CHECK` | Suppresses update notifications |\n\n## Commands overview\n\n### General\n\n| Command | Description |\n|---------|-------------|\n| `danube auth` | Authenticate via browser (recommended) |\n| `danube login` | Authenticate with an API token |\n| `danube logout` | Remove stored credentials |\n| `danube whoami` | Show current user and teams |\n\n### VPS Instances (`danube vps`)\n\n| Command | Description |\n|---------|-------------|\n| `danube vps ls` | List all VPS instances |\n| `danube vps create` | Create a new VPS (interactive or flags) |\n| `danube vps get <id>` | Show VPS details and connection info |\n| `danube vps update <id>` | Update VPS config (must be stopped) |\n| `danube vps delete <id>` | Delete a VPS instance |\n| `danube vps start <id>` | Start a stopped VPS |\n| `danube vps stop <id>` | Stop a running VPS |\n| `danube vps reboot <id>` | Reboot a running VPS |\n| `danube vps reinstall <id>` | Reinstall OS (destroys all data) |\n| `danube vps status <id>` | Show current status and capabilities |\n| `danube vps metrics <id>` | Show CPU/memory/storage/network usage |\n| `danube vps password <id>` | Show SSH password (with confirmation) |\n| `danube vps images` | List available OS images |\n\n### Object Storage (`danube storage`)\n\n| Command | Description |\n|---------|-------------|\n| `danube storage buckets ls` | List all buckets |\n| `danube storage buckets create` | Create a new bucket |\n| `danube storage buckets get <id>` | Show bucket details |\n| `danube storage buckets update <id>` | Update bucket settings |\n| `danube storage buckets delete <id>` | Delete a bucket |\n| `danube storage buckets metrics <id>` | Show current bucket metrics snapshot |\n| `danube storage buckets metrics trend <id>` | Time-series trend (sparkline/table/csv/json) |\n| `danube storage buckets metrics top <id>` | Top objects by size/egress/requests |\n| `danube storage buckets metrics health <id>` | Pending multipart uploads, deleted versions, last check |\n| `danube storage keys ls` | List all access keys |\n| `danube storage keys create` | Create a new access key |\n| `danube storage keys get <id>` | Show access key details |\n| `danube storage keys revoke <id>` | Revoke an access key |\n\n### Static Sites (`danube pages`)\n\n| Command | Description |\n|---------|-------------|\n| `danube pages link` | Link current directory to a static site |\n| `danube pages deploy` | Deploy static site files |\n| `danube pages deployments ls` | List deployments |\n| `danube pages deployments rollback <rev>` | Roll back to a previous deployment |\n| `danube pages domains ls` | List custom domains |\n| `danube pages domains add <domain>` | Add a custom domain |\n| `danube pages domains remove <domain>` | Remove a custom domain |\n| `danube pages domains verify <domain>` | Verify domain DNS |\n\n### Serverless Containers (`danube rapids`)\n\n| Command | Description |\n|---------|-------------|\n| `danube rapids ls` | List serverless containers |\n| `danube rapids create` | Create a new container |\n| `danube rapids deploy <name>` | Deploy from local directory |\n| `danube rapids show <name>` | Show container details |\n| `danube rapids update <name>` | Update container configuration |\n| `danube rapids rm <name>` | Delete a container |\n| `danube rapids deployments <name>` | List container deployments |\n| `danube rapids usage <name>` | Show usage and billing |\n\n## File exclusion\n\nWhen packaging files for deployment, the CLI automatically excludes:\n\n1. `.git`, `node_modules`, `.danube` (always excluded)\n2. Patterns from `.gitignore`\n3. Patterns from `.daubeignore` (custom ignore file)\n4. Extra patterns from `danube.json` `ignore` field\n\n## CI/CD usage\n\nFor automated deployments without interactive prompts, set environment variables:\n\n```bash\nexport DANUBE_TOKEN=\"your-api-token\"\nexport DANUBE_SITE_ID=\"42\"\nexport DANUBE_TEAM_ID=\"1\"\n\ndanube pages deploy --dir ./dist --no-wait\n```\n\n### GitHub Actions example\n\n```yaml\nname: Deploy to DanubeData\non:\n  push:\n    branches: [main]\n\njobs:\n  deploy:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - uses: actions/setup-node@v4\n        with:\n          node-version: 20\n\n      - run: npm ci && npm run build\n\n      - run: npm install -g @danubedata/cli\n\n      - run: danube pages deploy --dir ./dist\n        env:\n          DANUBE_TOKEN: ${{ secrets.DANUBE_TOKEN }}\n          DANUBE_SITE_ID: ${{ secrets.DANUBE_SITE_ID }}\n          DANUBE_TEAM_ID: ${{ secrets.DANUBE_TEAM_ID }}\n```\n\n## Update notifications\n\nThe CLI checks for updates automatically (once per 24 hours). Notifications are suppressed in CI environments or when `DANUBE_NO_UPDATE_CHECK` is set.\n\n## Exit codes\n\n| Code | Meaning |\n|------|---------|\n| 0 | Success |\n| 1 | Error (authentication, API, validation) |\n| 130 | Interrupted (Ctrl+C during polling) |\n\n## Next steps\n\n- [CLI: VPS Instances](https://docs.danubedata.ro/cli-vps) — Manage VPS instances\n- [CLI: Object Storage](https://docs.danubedata.ro/cli-storage) — Manage buckets and access keys\n- [CLI: Static Sites](https://docs.danubedata.ro/cli-pages) — Deploy and manage static sites\n- [CLI: Serverless Containers](https://docs.danubedata.ro/cli-serverless) — Deploy and manage containers\n- [API Authentication](https://docs.danubedata.ro/api-authentication) — Create API tokens\n\n---\n\n**Questions?** Contact support at support@danubedata.ro\n","prev":{"title":"Account Limits","slug":"account-limits","url":"https://docs.danubedata.ro/account-limits","markdown_url":"https://docs.danubedata.ro/account-limits.md","json_url":"https://docs.danubedata.ro/account-limits.json"},"next":{"title":"VPS Instances","slug":"cli-vps","url":"https://docs.danubedata.ro/cli-vps","markdown_url":"https://docs.danubedata.ro/cli-vps.md","json_url":"https://docs.danubedata.ro/cli-vps.json"},"index_url":"https://docs.danubedata.ro/index.json"}