Getting Started with the CLI

Create a local dcupl project, sync it with Console, and make your first changes.

Prerequisites

  • CLI installed and authenticated (dcupl login)
  • A dcupl Console account with at least one project

Step 1: Create a Project Directory

Create a folder for your dcupl project:

mkdir my-dcupl-project
cd my-dcupl-project

Step 2: Initialize the Project

Connect this directory to a Console project:

dcupl init

The CLI prompts you to:

  1. Select a project - Choose from your Console projects
  2. Select a version - Usually draft for development

This creates a dcupl.config.json file linking the directory to your Console project.

Alternative: Initialize with Options

Skip prompts by providing options directly:

dcupl init --project-id abc123 --version draft

Step 3: Pull Existing Files

Download the current project files from Console:

dcupl pull

Your directory now contains the project files:

my-dcupl-project/
├── dcupl.config.json     # CLI configuration
├── dcupl.lc.json         # Loader configuration
├── models/
│   └── product.model.json
└── data/
    └── products.csv

Step 4: Make Changes Locally

Edit files using your preferred editor. For example, add a property to a model:

models/product.model.json
{
  "key": "Product",
  "properties": [
    { "key": "name", "type": "string" },
    { "key": "price", "type": "float" },
    { "key": "inStock", "type": "boolean" }
  ]
}

Step 5: Push Changes to Console

Upload your changes:

dcupl push

The CLI shows which files changed:

Pushing to project abc123 (draft)...
  ↑ models/product.model.json (modified)
Done. 1 file updated.

Open Console to see your changes reflected immediately.

Complete Workflow Example

Here's a typical development session:

Development workflow
# Start of session - get latest from Console
dcupl pull

# Check what files exist
ls -la

# Edit files...
code .

# See what changed locally
dcupl status

# Push changes
dcupl push

# Continue editing and pushing as needed

Project Structure

After initialization, your project has this structure:

File/Folder Purpose
dcupl.config.json CLI configuration (project ID, version)
dcupl.lc.json Loader configuration (models, resources, apps)
models/ Model definition files
data/ Data files (CSV, JSON)
workflows/ Workflow definitions (if using workflows)

Working with Versions

dcupl projects have two main versions:

  • draft - Working version for development
  • published - Stable version for production
# Pull draft version (default)
dcupl pull

# Pull published version
dcupl pull --version published

# Push to draft
dcupl push

# Note: Publishing requires Console UI or API

Team Collaboration

When working with a team:

  1. Always pull before editing - Get the latest changes
  2. Push frequently - Avoid merge conflicts
  3. Use Git - Track your dcupl configs in version control
Team workflow
# Morning: Get latest from Console
dcupl pull

# Commit to Git after pulling
git add .
git commit -m "Sync with Console"

# After local changes
dcupl push
git add .
git commit -m "Add inStock property to Product"

What's Next?

Now that you have a working project: