Conversation
Complete rewrite of the CLI documentation for v2, structured around the automation-first identity: OAuth client credentials, JSON output, CI/CD patterns, and the updated config shape. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds OAuth client credentials support, --output json on all API-driven commands, improved env/auth config shape, file workflow improvements (-af, -ad, progress reporting), and structured error responses. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Supports deployment scenarios with dynamically named files that accumulate over time. Adds --delete (with --empty modifier), --copy, and --move flags backed by the DirectoryDelete, DirectoryEmpty, FileDelete, AssetCopy, and AssetMove APIs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a v2/beta overhaul of the DynamicWeb CLI focused on automation-first usage: OAuth client-credentials authentication, consistent --output json envelopes across API-driven commands, expanded file operations (delete/copy/move), and updated documentation/changelog to reflect the new behaviors.
Changes:
- Add OAuth client-credentials support (
--auth oauth,dw login --oauth, env-var based client ID/secret) and surface auth type in the basedwcommand. - Add structured JSON output (
--output json, deprecated--json) toenv,login,files,query, andcommand. - Expand
dw fileswith destructive/mutating operations (--delete,--empty,--copy,--move) and update docs/README/changelog for v2.
Reviewed changes
Copilot reviewed 4 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Rewrites README for v2 beta: OAuth, JSON output, files workflows, CI/CD guidance. |
| package.json | Bumps version to 2.0.0-beta.0. |
| package-lock.json | Updates lockfile version metadata to 2.0.0-beta.0. |
| cliv2-documentation.md | Adds full v2 documentation article covering auth, JSON envelopes, command refs. |
| CHANGELOG.md | Adds v2 beta changelog entries for breaking changes/features/improvements. |
| bin/index.js | Adds global OAuth flags and improves base command display (incl. auth type). |
| bin/commands/env.js | Adds --output json support and restructures env command output/error handling. |
| bin/commands/login.js | Adds OAuth login/config flow and JSON envelope support. |
| bin/commands/query.js | Adds --output json, structured output envelope, and improved error propagation. |
| bin/commands/command.js | Adds --output json and structured output envelope. |
| bin/commands/files.js | Adds JSON output, deprecated flag aliases, and new delete/copy/move operations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…de, improve error handling - Login: block interactive prompts in JSON mode; add non-interactive OAuth login path; always apply --host override on existing environments - Files: skip full-export confirmation in JSON mode - Command: throw error for unimplemented --list instead of returning string - Login: extract shared OAuth finalization into finalizeOAuthLogin helper - Install: add JSON output example to README for documentation consistency - Docs: include install in --output json command lists Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…or testability - Export parseHostInput, getQueryParams, buildInteractiveQueryParams, buildQueryParamsFromArgv, extractQueryPropertyPrompts, getFieldNameFromPropertyPrompt, parseCookies, shouldUseOAuth, resolveOAuthConfig, prepareDownloadCommandData, isFilePath, wildcardToRegExp, getFilesOperation from their respective modules - Add setConfigForTests() to config.js and guard getConfig() against null return - Inject deps (interactiveEnvFn, getPropertiesFn, promptFn) via optional deps param in setupEnv and getQueryParams for easier unit testing - Add test/ suite covering command, env, files, login, query, and utility helpers - Add qa/ smoke harness (run-smoke.mjs) with fixtures, profile.example.json, and README covering saved-env and ephemeral CI flows against a real DynamicWeb solution - Wire npm run test (node --test) and npm run qa:smoke scripts in package.json - Bump version to 2.0.0-beta.1 - Ignore qa/artifacts/ and qa/profile.json in .gitignore Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…files; add tests for JSON parsing and formatting functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--oauthlogin flow,--authflag to override auth mode, env-var-based client credentials (--clientIdEnv/--clientSecretEnv)--output jsonacross all commands with consistent response envelope (ok,status,data,errors,meta), replacing the deprecated--jsonflag--delete,--copy,--movesupport with--asFile/--asDirectoryoverrides and interactive confirmation for destructive actionsoutput.finish()viafinallyblocks, extractedisFilePathhelper, encapsulated meta access in output objects, verbose logging for archive cleanup errors, fixed missingoutputparameter threading throughsetupEnv/interactiveEnv/interactiveOAuthLoginQA test scripts
To run the unit tests:
npm testFor QA to run the test smoke harness against a real solution:
Full instructions (profile format, CI usage, --mode flag, etc.) are in qa/README.md.
https://github.com/dynamicweb/CLI/blob/7ce694f8464dd53c659f26d1950d6fc947b8aebd/qa/README.md
Test plan
dwwith no args — verify environment status display, including when env is missingdw login --oauth— verify interactive OAuth setup stores config correctlydw query <name> --output json— verify clean JSON output with no console noisedw files --delete <path>— verify confirmation prompt and correct API calldw files --copy <src> --output json— verify JSON envelopedw files --export <path> -v— verify verbose log shows correct operation context--output jsonand--interactiveconflict on the query command--jsonflag on files command emits warning and still works