Configuration Reference

Complete reference for dcupl CLI configuration options.

Configuration File

The CLI uses a dcupl.config.json file in your project directory. This file is created by dcupl init.

Location

The CLI searches for config in this order:

  1. ./dcupl.config.json (current directory)
  2. Parent directories (walks up to root)
  3. ~/.dcupl/config.json (global fallback)

File Structure

dcupl.config.json
{
  "projectId": "your-project-id",
  "version": "draft",
  "apiUrl": "https://api.dcupl.com",
  "ignore": [
    "node_modules",
    ".git",
    "*.log"
  ]
}

Configuration Options

projectId

Required. The Console project identifier.

Property Value
Type string
Default none
Env var DCUPL_PROJECT_ID
{
  "projectId": "abc123"
}

Find your project ID in Console → Project Settings.


version

The file version to sync with.

Property Value
Type string
Default "draft"
Env var DCUPL_VERSION
{
  "version": "draft"
}

Common values:

Version Use Case
draft Development and editing
published Stable production version
v1.0.0 Specific tagged version

apiUrl

The dcupl Console API endpoint.

Property Value
Type string
Default "https://api.dcupl.com"
Env var DCUPL_API_URL
{
  "apiUrl": "https://api.dcupl.com"
}

Only change this for enterprise or self-hosted deployments.


ignore

Files and directories to exclude from sync.

Property Value
Type string[]
Default []
Env var none
{
  "ignore": [
    "node_modules",
    ".git",
    "*.log",
    "*.tmp",
    ".env*",
    "build/",
    "dist/"
  ]
}

Pattern syntax:

Pattern Matches
*.log All .log files
node_modules Directory named node_modules
build/ Directory named build and contents
.env* Files starting with .env
**/*.tmp All .tmp files in any subdirectory

defaultApplication

Default application key for commands that support it.

Property Value
Type string
Default "default"
Env var none
{
  "defaultApplication": "production"
}

Environment Variables

Environment variables override config file values. This is useful for CI/CD and different environments.

Available Variables

Variable Overrides Description
DCUPL_PROJECT_ID projectId Project identifier
DCUPL_API_KEY - Authentication key
DCUPL_VERSION version Version to sync
DCUPL_API_URL apiUrl API endpoint

Precedence

Configuration is resolved in this order (highest to lowest):

  1. Command-line flags (--project-id)
  2. Environment variables (DCUPL_PROJECT_ID)
  3. Local config file (./dcupl.config.json)
  4. Global config file (~/.dcupl/config.json)
  5. Built-in defaults

CI/CD Example

.github/workflows/deploy.yml
name: Deploy to dcupl

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dcupl CLI
        run: npm install -g @dcupl/cli

      - name: Push to dcupl
        env:
          DCUPL_PROJECT_ID: ${{ secrets.DCUPL_PROJECT_ID }}
          DCUPL_API_KEY: ${{ secrets.DCUPL_API_KEY }}
        run: dcupl push

Example Configurations

Minimal

dcupl.config.json
{
  "projectId": "abc123"
}

Development

dcupl.config.json
{
  "projectId": "abc123",
  "version": "draft",
  "ignore": [
    "node_modules",
    ".git",
    "*.log",
    ".env*"
  ]
}

Production Pipeline

dcupl.config.json
{
  "projectId": "abc123",
  "version": "v1.0.0",
  "ignore": [
    "node_modules",
    ".git",
    "*.log",
    ".env*",
    "test/",
    "*.spec.ts"
  ]
}

Multi-Environment Setup

Use environment variables to switch between configurations:

Development
export DCUPL_VERSION=draft
dcupl push
Production
export DCUPL_VERSION=v1.0.0
dcupl pull

Validating Configuration

Check your configuration is valid:

dcupl config list

Output:

Configuration (./dcupl.config.json):
  projectId: abc123
  version: draft
  apiUrl: https://api.dcupl.com
  ignore: ["node_modules", ".git", "*.log"]

Environment overrides:
  DCUPL_API_KEY: set (hidden)

Security Best Practices

Do

  • Store API keys in environment variables or secrets managers
  • Add dcupl.config.json to version control (it doesn't contain secrets)
  • Use different API keys for dev/staging/production

Don't

  • Store API keys in dcupl.config.json
  • Commit .env files with API keys
  • Share API keys between team members (each person should have their own)

See Also