Skip to content

Commit 0c2d83e

Browse files
Update docs, root command description, and add Dependabot config
Refresh root command Short/Long to reflect current CLI capabilities. Expand automation docs with CI examples, auth patterns, and JSON error handling. Add schema validation guide and stability notes. Add Dependabot for Go modules and GitHub Actions. Remove outdated Chocolatey README.
1 parent e906209 commit 0c2d83e

29 files changed

Lines changed: 246 additions & 74 deletions

.github/dependabot.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: "09:00"
9+
timezone: America/Los_Angeles
10+
open-pull-requests-limit: 5
11+
labels:
12+
- dependencies
13+
- go
14+
commit-message:
15+
prefix: deps
16+
groups:
17+
go-dependencies:
18+
patterns:
19+
- "*"
20+
update-types:
21+
- minor
22+
- patch
23+
24+
- package-ecosystem: github-actions
25+
directory: /
26+
schedule:
27+
interval: weekly
28+
day: monday
29+
time: "09:00"
30+
timezone: America/Los_Angeles
31+
open-pull-requests-limit: 5
32+
labels:
33+
- dependencies
34+
- github-actions
35+
commit-message:
36+
prefix: deps
37+
groups:
38+
github-actions:
39+
patterns:
40+
- "*"
41+
update-types:
42+
- minor
43+
- patch

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@
44

55
[Full Changelog](https://github.com/dropbox/dbxcli/compare/v3.5.1...HEAD)
66

7+
**Added:**
8+
9+
- Added Dependabot configuration for Go modules and GitHub Actions dependencies.
10+
- Added automation documentation with CI, direct-token, saved-auth-file, and JSON error-handling examples.
11+
- Added richer JSON `error.details` fields for operation context, paths, URLs, revisions, email addresses, member IDs, Dropbox API summaries, and retry-after values.
12+
13+
**Changed:**
14+
15+
- Updated root command help and generated command docs to reflect current files, shared-link, team, and automation workflows.
16+
17+
**Infrastructure:**
18+
19+
- Added golden JSON error output fixtures and live JSON error envelope tests.
20+
- Hardened JSON error detail collection through wrapped and joined errors.
21+
- Reduced false-positive Dropbox `api_summary` detection for local path errors.
22+
723
## [v3.5.1](https://github.com/dropbox/dbxcli/tree/v3.5.1) (2026-06-28)
824
[Full Changelog](https://github.com/dropbox/dbxcli/compare/v3.5.0...v3.5.1)
925

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Go Report Card](https://goreportcard.com/badge/github.com/dropbox/dbxcli/v3?cache=v3)](https://goreportcard.com/report/github.com/dropbox/dbxcli/v3)
55

66
`dbxcli` is a scriptable Dropbox CLI for files, shared links, teams, and
7-
automation workflows. It is built for humans at the terminal, scripts, CI jobs,
7+
automation workflows. It is built for humans in the terminal, scripts, CI jobs,
88
and agent-style workflows.
99

1010
## Why use dbxcli?
@@ -26,6 +26,9 @@ dbxcli get /remote.txt ./remote.txt
2626
dbxcli share-link create /remote.txt
2727
```
2828

29+
On team accounts where `/` is not writable, run `dbxcli ls /` and use a
30+
writable personal or team folder instead.
31+
2932
For automation, use structured command output and JSON help discovery:
3033

3134
```sh
@@ -37,14 +40,19 @@ dbxcli put --help --output=json
3740
Stable JSON error codes and process exit codes are documented in
3841
[Automation and JSON output](https://github.com/dropbox/dbxcli/blob/master/docs/automation.md).
3942

40-
## JSON contract stability
43+
## JSON output
44+
45+
`--output=json` emits stable schema v1 success and error envelopes for
46+
automation. Use JSON help for machine-readable command manifests:
47+
48+
```sh
49+
dbxcli --help --output=json
50+
dbxcli put --help --output=json
51+
```
4152

42-
`--output=json` uses schema v1 success and error envelopes. Schema v1 keeps
43-
top-level fields, stable error codes, and result status meanings stable within
44-
the v1 contract; minor releases may add fields, commands, warnings, and error
45-
details. Use JSON help for machine-readable command manifests, and use the
53+
See the
4654
[JSON schema v1 docs](https://github.com/dropbox/dbxcli/blob/master/docs/json-schema/v1/README.md)
47-
for schemas, command contracts, and examples.
55+
for schemas, stability policy, command contracts, and examples.
4856

4957
## Common workflows
5058

@@ -116,6 +124,8 @@ folder or a team folder.
116124
brew install dbxcli
117125
```
118126

127+
Homebrew formula: [formulae.brew.sh/formula/dbxcli](https://formulae.brew.sh/formula/dbxcli)
128+
119129
### Release archives
120130

121131
Download the archive for your platform from the

cmd/help_json_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ func newJSONHelpTestRoot(t *testing.T) *cobra.Command {
886886

887887
root := &cobra.Command{
888888
Use: "dbxcli",
889-
Short: "A command line tool for Dropbox users and team admins",
889+
Short: "Scriptable Dropbox CLI for files, shared links, teams, and automation",
890890
SilenceUsage: true,
891891
SilenceErrors: true,
892892
PersistentPreRunE: initDbx,

cmd/root.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ func rootNamespaceID(account *users.FullAccount) string {
227227
// RootCmd represents the base command when called without any subcommands
228228
var RootCmd = &cobra.Command{
229229
Use: "dbxcli",
230-
Short: "A command line tool for Dropbox users and team admins",
231-
Long: `Use dbxcli to quickly interact with your Dropbox, upload/download files,
232-
manage your team and more. It is easy, scriptable and works on all platforms!`,
230+
Short: "Scriptable Dropbox CLI for files, shared links, teams, and automation",
231+
Long: `Use dbxcli to work with Dropbox files, folders, shared links, and team
232+
workflows from a terminal. It supports text output for humans, structured JSON
233+
output for automation, pipe-friendly transfers, refreshable OAuth login, and
234+
direct-token automation for scripts, CI jobs, and agent-style workflows.`,
233235
SilenceUsage: true,
234236
SilenceErrors: true,
235237
PersistentPreRunE: initDbx,

docs/automation.md

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Use JSON help to discover whether a command supports structured command output:
2323
dbxcli put --help --output=json
2424
```
2525

26-
JSON help is also the Command Manifest v1 surface for tools and agents. Each
27-
command manifest includes structured positional arguments, flag enum values and
28-
conflicts, prompt/sensitive-input metadata, examples, auth modes, best-effort
29-
Dropbox scopes, stdin/stdout behavior, schema refs, result statuses/kinds, and
30-
known warning codes.
26+
JSON help is also the Command Manifest v1 surface for tools and agents. Command
27+
manifests expose machine-readable metadata such as structured positional
28+
arguments, flag enum values and conflicts, prompt/sensitive-input metadata,
29+
examples, auth modes, best-effort Dropbox scopes, stdin/stdout behavior, schema
30+
refs, result statuses/kinds, and known warning codes when available.
3131

3232
Successful JSON responses use a stable envelope:
3333

@@ -88,7 +88,7 @@ Automation should treat the CLI and schemas as the stable interface:
8888
* Use `error.schema.json` to validate JSON error responses.
8989
* Prefer schema URLs from a pinned release tag when reproducibility matters.
9090

91-
dbxcli intentionally does not expose a separate machine protocol. Tools should
91+
dbxcli currently does not expose a separate machine protocol. Tools should
9292
invoke the CLI, read stdout as JSON in `--output=json` mode, and treat stderr as
9393
status, progress, warnings, diagnostics, and verbose logs.
9494

@@ -130,6 +130,60 @@ Use `--output=json` when the caller needs stable statuses, result kinds,
130130
warnings, or error codes. Use text output when a command is part of a human
131131
terminal workflow or when the command intentionally writes file bytes to stdout.
132132

133+
Check auth and identity before running a job:
134+
135+
```sh
136+
dbxcli account --output=json
137+
```
138+
139+
Use direct token auth for short-lived CI jobs:
140+
141+
```sh
142+
DBXCLI_ACCESS_TOKEN="$DROPBOX_ACCESS_TOKEN" dbxcli ls --output=json /
143+
```
144+
145+
Use a dedicated saved-auth file when a job needs refreshable credentials. Store
146+
the file in a private temp or secret-backed path, not in the repository working
147+
directory:
148+
149+
```sh
150+
export DBXCLI_AUTH_FILE="${RUNNER_TEMP:-/tmp}/dbxcli-auth.json"
151+
dbxcli login
152+
dbxcli ls /
153+
```
154+
155+
Do not commit, cache, or upload this file as an artifact; it can contain refresh
156+
tokens.
157+
158+
Capture JSON output and handle failure by exit code:
159+
160+
```sh
161+
if ! dbxcli put --if-exists fail --output=json report.md /Reports/report.md >result.json; then
162+
jq -r '.error.code + ": " + .error.message' result.json >&2
163+
exit 1
164+
fi
165+
166+
jq -r '.results[] | [.status, .kind] | @tsv' result.json
167+
```
168+
169+
GitHub Actions example:
170+
171+
This example assumes `dbxcli` is already installed on the runner.
172+
173+
```yaml
174+
jobs:
175+
publish-report:
176+
runs-on: ubuntu-latest
177+
steps:
178+
- uses: actions/checkout@v6
179+
- name: Upload report to Dropbox
180+
env:
181+
DBXCLI_ACCESS_TOKEN: ${{ secrets.DROPBOX_ACCESS_TOKEN }}
182+
run: |
183+
dbxcli account --output=json
184+
dbxcli put --if-exists fail --output=json report.md /Reports/report.md
185+
```
186+
133187
## Authentication for automation
134188
135189
By default, `dbxcli` stores OAuth credentials in:
@@ -225,6 +279,10 @@ Stdin uploads are spooled to a temp file before uploading, so disk space up to
225279
the full input size is required. Stdout downloads are byte-clean: progress,
226280
diagnostic output, human-facing warnings, and verbose logs go to stderr.
227281

282+
Commands that write file bytes to stdout cannot also write JSON results to
283+
stdout. `dbxcli get <path> - --output=json` and
284+
`dbxcli share-link download <url> - --output=json` return `invalid_arguments`.
285+
228286
A bare `-` means stdin/stdout only when it appears as the local operand. Dropbox
229287
paths named `-` are valid, for example `dbxcli put - /-` and `dbxcli get /- -`.
230288
To upload a local file literally named `-`, use `./-`.
@@ -245,19 +303,22 @@ exit `0`, including successful commands that return warnings.
245303
| `5` | Conflict | `path_conflict` |
246304
| `6` | Rate limited | `rate_limited` |
247305
| `7` | Validation or usage error | `invalid_arguments`, `unknown_command`, `unknown_flag`, `structured_output_unsupported` |
248-
| `8` | Partial stdout/output transfer | `partial_transfer` |
306+
| `8` | Partial stdout transfer | `partial_transfer` |
249307

250308
In JSON mode, inspect both the process exit code and `error.code` for the most
251309
specific machine-readable failure reason.
252310

253311
## Shell completion
254312

255-
Shell completion commands intentionally remain text-only because shells expect
256-
completion scripts or protocol output:
313+
Completion script/protocol output is text-only because shells expect completion
314+
scripts or protocol output:
257315

258316
```sh
259317
dbxcli completion bash
260318
dbxcli completion zsh
261319
dbxcli completion fish
262320
dbxcli completion powershell
263321
```
322+
323+
Passing `--output=json` to completion commands returns
324+
`structured_output_unsupported`.

docs/commands/dbxcli.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
## dbxcli
44

5-
A command line tool for Dropbox users and team admins
5+
Scriptable Dropbox CLI for files, shared links, teams, and automation
66

77
### Synopsis
88

9-
Use dbxcli to quickly interact with your Dropbox, upload/download files,
10-
manage your team and more. It is easy, scriptable and works on all platforms!
9+
Use dbxcli to work with Dropbox files, folders, shared links, and team
10+
workflows from a terminal. It supports text output for humans, structured JSON
11+
output for automation, pipe-friendly transfers, refreshable OAuth login, and
12+
direct-token automation for scripts, CI jobs, and agent-style workflows.
1113

1214
### Options
1315

docs/commands/dbxcli_account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ dbxcli account [flags] [<account-id>]
4646

4747
### SEE ALSO
4848

49-
* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins
49+
* [dbxcli](dbxcli.md) - Scriptable Dropbox CLI for files, shared links, teams, and automation
5050

docs/commands/dbxcli_completion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ dbxcli completion [bash|zsh|fish|powershell] [flags]
4040

4141
### SEE ALSO
4242

43-
* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins
43+
* [dbxcli](dbxcli.md) - Scriptable Dropbox CLI for files, shared links, teams, and automation
4444
* [dbxcli completion bash](dbxcli_completion_bash.md) - Generate the autocompletion script for bash
4545
* [dbxcli completion fish](dbxcli_completion_fish.md) - Generate the autocompletion script for fish
4646
* [dbxcli completion powershell](dbxcli_completion_powershell.md) - Generate the autocompletion script for powershell

docs/commands/dbxcli_cp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ dbxcli cp [flags] <source> [more sources] <target>
4040

4141
### SEE ALSO
4242

43-
* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins
43+
* [dbxcli](dbxcli.md) - Scriptable Dropbox CLI for files, shared links, teams, and automation
4444

0 commit comments

Comments
 (0)