Skip to content

Commit 1d0c204

Browse files
Merge pull request #303 from dropbox/docs/readme-auth-modes
Add auth modes to generated docs and polish README
2 parents 2b62d58 + 1d780da commit 1d0c204

40 files changed

Lines changed: 70 additions & 5 deletions

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# `dbxcli`: Dropbox from the command line
22

33
[![CI](https://github.com/dropbox/dbxcli/actions/workflows/ci.yml/badge.svg)](https://github.com/dropbox/dbxcli/actions/workflows/ci.yml)
4-
[![Go Report Card](https://goreportcard.com/badge/github.com/dropbox/dbxcli/v3)](https://goreportcard.com/report/github.com/dropbox/dbxcli/v3)
4+
[![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
77
automation workflows. It is built for humans at the terminal, scripts, CI jobs,
@@ -34,6 +34,9 @@ dbxcli --help --output=json
3434
dbxcli put --help --output=json
3535
```
3636

37+
Stable JSON error codes and process exit codes are documented in
38+
[Automation and JSON output](https://github.com/dropbox/dbxcli/blob/master/docs/automation.md).
39+
3740
## Common workflows
3841

3942
Upload a file:
@@ -66,12 +69,20 @@ Create a shared link:
6669
dbxcli share-link create /Reports/report.pdf
6770
```
6871

69-
Use JSON output:
72+
In text mode, `share-link create` prints only the shared-link URL to stdout:
7073

7174
```sh
72-
dbxcli ls --output=json /
75+
url="$(dbxcli share-link create /Reports/report.pdf)"
7376
```
7477

78+
## Troubleshooting
79+
80+
### Why can uploading to `/remote.txt` fail on team accounts?
81+
82+
Some team accounts may not have a writable Dropbox root namespace. Run
83+
`dbxcli ls /` first, then upload under a writable folder, such as your personal
84+
folder or a team folder.
85+
7586
## Features
7687

7788
* File operations: `ls`, `cp`, `mkdir`, `mv`, `rm`, `put`, and `get`
@@ -174,8 +185,8 @@ dbxcli put --help --output=json
174185
* [JSON schema v1](https://github.com/dropbox/dbxcli/blob/master/docs/json-schema/v1/README.md)
175186
* [Release history](https://github.com/dropbox/dbxcli/blob/master/CHANGELOG.md)
176187

177-
Generated Cobra command docs live under `docs/commands/` and are kept close to
178-
the actual CLI by `go run ./tools/gen-docs`.
188+
Generated Cobra command docs live under `docs/commands/`, and CI verifies they
189+
stay in sync with the CLI.
179190

180191
## Contributing
181192

cmd/help_json.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@ func setCommandDestructiveLevel(cmd *cobra.Command, level string) {
338338
setCommandAnnotationList(cmd, commandDestructiveLevelAnnotation, []string{level})
339339
}
340340

341+
// CommandManifestAuthModes returns the auth modes published in JSON help.
342+
func CommandManifestAuthModes(cmd *cobra.Command) []string {
343+
return commandManifestAuthModes(cmd)
344+
}
345+
341346
func setCommandAnnotationList(cmd *cobra.Command, key string, values []string) {
342347
if cmd.Annotations == nil {
343348
cmd.Annotations = make(map[string]string)

docs/commands/dbxcli.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ manage your team and more. It is easy, scriptable and works on all platforms!
2222

2323
* Structured JSON output: no
2424
* JSON help manifest: yes
25+
* Auth modes: none
2526

2627

2728
### SEE ALSO

docs/commands/dbxcli_account.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dbxcli account [flags] [<account-id>]
3333

3434
* Structured JSON output: yes
3535
* JSON help manifest: yes
36+
* Auth modes: `personal`, `team-access`
3637

3738

3839
### SEE ALSO

docs/commands/dbxcli_completion.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dbxcli completion [bash|zsh|fish|powershell] [flags]
3232

3333
* Structured JSON output: no
3434
* JSON help manifest: yes
35+
* Auth modes: none
3536

3637

3738
### SEE ALSO

docs/commands/dbxcli_completion_bash.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ dbxcli completion bash
5151

5252
* Structured JSON output: no
5353
* JSON help manifest: yes
54+
* Auth modes: none
5455

5556

5657
### SEE ALSO

docs/commands/dbxcli_completion_fish.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ dbxcli completion fish [flags]
4242

4343
* Structured JSON output: no
4444
* JSON help manifest: yes
45+
* Auth modes: none
4546

4647

4748
### SEE ALSO

docs/commands/dbxcli_completion_powershell.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dbxcli completion powershell [flags]
3939

4040
* Structured JSON output: no
4141
* JSON help manifest: yes
42+
* Auth modes: none
4243

4344

4445
### SEE ALSO

docs/commands/dbxcli_completion_zsh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ dbxcli completion zsh [flags]
5353

5454
* Structured JSON output: no
5555
* JSON help manifest: yes
56+
* Auth modes: none
5657

5758

5859
### SEE ALSO

docs/commands/dbxcli_cp.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dbxcli cp [flags] <source> [more sources] <target>
2626

2727
* Structured JSON output: yes
2828
* JSON help manifest: yes
29+
* Auth modes: `personal`, `team-access`
2930

3031

3132
### SEE ALSO

0 commit comments

Comments
 (0)