Table of Contents

DynamicWeb CLI

Tools for deploying to and operating DynamicWeb 10 solutions from outside the backend, and how to choose between them.

Implementers work with a DynamicWeb 10 solution from outside the backend all the time: deploying templates and designs, installing custom add-ins, moving integration files, pulling logs, taking backups, and running the same steps in a pipeline for every environment. Two tools cover this work:

  • The DynamicWeb CLI is a command-line tool for automation, CI/CD pipelines, scheduled jobs, and AI assistants. It reaches files, add-ins, the database, and every Management API query and command
  • DW Desktop is a desktop application for interactive file work: browsing a solution side by side with your computer, and deploying or getting files with a preview of every change

This article helps you choose a tool and a CLI version, and links to the articles that cover each.

Choosing a tool

Both tools connect to a running solution through the Management API and authenticate with OAuth client credentials or API keys. Use the one that fits how the work is done:

Task DynamicWeb CLI 2.x DW Desktop
Deploy a design or templates by hand, with a preview dw files diff followed by dw files deploy Sync with Preview changes
Deploy from a CI/CD pipeline Yes No
Run on a schedule or without a person present Yes No
Browse a solution and compare it with a local folder dw files -l and dw files diff Yes, visually
Upload or download individual files Yes Yes, by drag and drop
Detect files changed on the server since your last deploy --fail-on-remote-change and diff Conflicts in the sync preview
Roll back a deploy dw files rollback No
Install add-ins dw install No
Run Management API queries and commands dw query and dw command No
Export the database, download Swift dw database and dw swift No
Let an AI assistant work with the solution Yes, see Using the CLI with AI No

Many teams use both: DW Desktop for day-to-day work on a solution, and the CLI in pipelines and scheduled jobs. They use the same File Transfer API, so files deployed with one look the same to the other.

Choosing a version

The CLI exists in two major versions. Version 2 is an automation-first overhaul of version 1, and it is the version to use for new work:

Capability Version 1 Version 2
npm package @dynamicweb/cli@1 @dynamicweb/cli, the latest tag, currently 2.0.1
Node.js 20.12 or later 20.19 or later, or 22.12 or later
Authentication User login, API key User login, API key, OAuth client credentials
Machine-readable output dw install only --output json on every command except config
Exit codes Some failures exit with code 0 Every failure exits with code 1, nothing on stderr on success
Upload and download Multipart uploads, zip exports Checksum-verified chunked uploads, resumable downloads, with DynamicWeb 10.29 or later
Remove files that are gone locally No dw files sync --delete and dw files deploy
Atomic deploy with rollback No dw files deploy --keep-backup and dw files rollback
Delete, copy, and move on the server No dw files and dw folders
Protection against overwriting server changes No --fail-on-remote-change
Works with DynamicWeb 10 versions All All. Sync, deploy, and similar features need 10.29 or later

Use version 2 for new pipelines, scheduled jobs, and AI-assisted work. Keep version 1 only for existing scripts until you have migrated them. Most version 1 commands work unchanged in version 2, and Migrating from v1 lists the differences.

Quick start

To install version 2 and connect it to a solution with an OAuth client, run:

npm install -g @dynamicweb/cli
export DW_CLIENT_ID="<client id>"
export DW_CLIENT_SECRET="<client secret>"
dw env staging --host https://staging.example.com
dw login --oauth --output json
dw files / -l

The last command lists the top folders of the solution's file archive. If it does, you are connected. In PowerShell, set the variables with $env:DW_CLIENT_ID = "<client id>".

Git Bash on Windows

Git Bash converts arguments that look like Unix paths, which breaks remote paths such as /Files/Templates, and the CLI prints a warning that links to this article. To turn the conversion off for the current session, run:

export MSYS_NO_PATHCONV=1

Alternatively, prefix local paths with ./, or use PowerShell. See Troubleshooting for version 2 and Git Bash path conversion for version 1.

Articles in this section

These articles cover the tools in detail:

  • DynamicWeb CLI 2.x: installation, authentication, everyday tasks, sync and deploy, JSON output, CI/CD, and the full command reference
  • DynamicWeb CLI 1.x: reference for version 1, for existing scripts
  • Scheduling CLI jobs: recurring jobs with Windows Task Scheduler, cron, and scheduled pipelines, such as file exchange with an ERP system, backups, log collection, and monitoring
  • Using the CLI with AI: let an AI assistant retrieve and analyze logs, diagnose failing jobs, and compare environments
  • DW Desktop: the desktop application for browsing, deploying, and syncing files
To top