diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89d19a8..cce3b1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,18 @@ jobs: VERSION: ci - run: ./packaging/package-release.sh ci + docs: + name: Generated docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-go@v6 + with: + go-version: "1.25" + - run: go run ./tools/gen-docs + - run: git diff --exit-code docs/commands + - run: test -z "$(git status --porcelain -- docs/commands)" + chocolatey: name: Chocolatey package runs-on: windows-latest diff --git a/README.md b/README.md index e226843..c39501b 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,8 @@ Flags: Use "dbxcli [command] --help" for more information about a command. ``` +The complete generated command reference is available in [docs/commands/dbxcli.md](https://github.com/dropbox/dbxcli/blob/master/docs/commands/dbxcli.md). + ### Output formats Text output is the default. JSON output is available through the global `--output` flag for migrated commands: @@ -208,7 +210,7 @@ In JSON mode, error responses are written to stdout and the process exits with a } ``` -The full JSON command catalog, stable error codes, and schemas live in [docs/json-schema/v1](docs/json-schema/v1/). Commands that intentionally do not support JSON output yet include `login`, `logout`, and `completion`. Help output and shell-completion protocol commands are text-only. +The full JSON command catalog, stable error codes, and schemas live in [docs/json-schema/v1](https://github.com/dropbox/dbxcli/tree/master/docs/json-schema/v1). Commands that intentionally do not support JSON output yet include `login`, `logout`, and `completion`. Help output and shell-completion protocol commands are text-only. ### Authentication diff --git a/docs/commands/dbxcli.md b/docs/commands/dbxcli.md new file mode 100644 index 0000000..eea78d4 --- /dev/null +++ b/docs/commands/dbxcli.md @@ -0,0 +1,42 @@ + + +## dbxcli + +A command line tool for Dropbox users and team admins + +### Synopsis + +Use dbxcli to quickly interact with your Dropbox, upload/download files, +manage your team and more. It is easy, scriptable and works on all platforms! + +### Options + +``` + --as-member string Member ID to perform action as + -h, --help help for dbxcli + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli account](dbxcli_account.md) - Display account information +* [dbxcli completion](dbxcli_completion.md) - Generate the autocompletion script for the specified shell +* [dbxcli cp](dbxcli_cp.md) - Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its contents will be copied. +* [dbxcli du](dbxcli_du.md) - Display usage information +* [dbxcli get](dbxcli_get.md) - Download a file or folder +* [dbxcli login](dbxcli_login.md) - Log in and save Dropbox credentials +* [dbxcli logout](dbxcli_logout.md) - Log out of the current session +* [dbxcli ls](dbxcli_ls.md) - List files and folders +* [dbxcli mkdir](dbxcli_mkdir.md) - Create a new directory +* [dbxcli mv](dbxcli_mv.md) - Move files +* [dbxcli put](dbxcli_put.md) - Upload files or directories +* [dbxcli restore](dbxcli_restore.md) - Restore a file revision +* [dbxcli revs](dbxcli_revs.md) - List file revisions +* [dbxcli rm](dbxcli_rm.md) - Remove files or folders +* [dbxcli search](dbxcli_search.md) - Search +* [dbxcli share](dbxcli_share.md) - Sharing commands +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands +* [dbxcli team](dbxcli_team.md) - Team management commands +* [dbxcli version](dbxcli_version.md) - Print version information + diff --git a/docs/commands/dbxcli_account.md b/docs/commands/dbxcli_account.md new file mode 100644 index 0000000..7f3c402 --- /dev/null +++ b/docs/commands/dbxcli_account.md @@ -0,0 +1,35 @@ + + +## dbxcli account + +Display account information + +``` +dbxcli account [flags] [] +``` + +### Examples + +``` + dbxcli account + dbxcli account dbid:xxxx +``` + +### Options + +``` + -h, --help help for account +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_completion.md b/docs/commands/dbxcli_completion.md new file mode 100644 index 0000000..a651d84 --- /dev/null +++ b/docs/commands/dbxcli_completion.md @@ -0,0 +1,38 @@ + + +## dbxcli completion + +Generate the autocompletion script for the specified shell + +### Synopsis + +Generate the autocompletion script for dbxcli for the specified shell. +See each sub-command's help for details on how to use the generated script. + + +``` +dbxcli completion [bash|zsh|fish|powershell] [flags] +``` + +### Options + +``` + -h, --help help for completion +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins +* [dbxcli completion bash](dbxcli_completion_bash.md) - Generate the autocompletion script for bash +* [dbxcli completion fish](dbxcli_completion_fish.md) - Generate the autocompletion script for fish +* [dbxcli completion powershell](dbxcli_completion_powershell.md) - Generate the autocompletion script for powershell +* [dbxcli completion zsh](dbxcli_completion_zsh.md) - Generate the autocompletion script for zsh + diff --git a/docs/commands/dbxcli_completion_bash.md b/docs/commands/dbxcli_completion_bash.md new file mode 100644 index 0000000..95a54d0 --- /dev/null +++ b/docs/commands/dbxcli_completion_bash.md @@ -0,0 +1,53 @@ + + +## dbxcli completion bash + +Generate the autocompletion script for bash + +### Synopsis + +Generate the autocompletion script for the bash shell. + +This script depends on the 'bash-completion' package. +If it is not installed already, you can install it via your OS's package manager. + +To load completions in your current shell session: + + source <(dbxcli completion bash) + +To load completions for every new session, execute once: + +#### Linux: + + dbxcli completion bash > /etc/bash_completion.d/dbxcli + +#### macOS: + + dbxcli completion bash > $(brew --prefix)/etc/bash_completion.d/dbxcli + +You will need to start a new shell for this setup to take effect. + + +``` +dbxcli completion bash +``` + +### Options + +``` + -h, --help help for bash + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli completion](dbxcli_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/commands/dbxcli_completion_fish.md b/docs/commands/dbxcli_completion_fish.md new file mode 100644 index 0000000..1063915 --- /dev/null +++ b/docs/commands/dbxcli_completion_fish.md @@ -0,0 +1,44 @@ + + +## dbxcli completion fish + +Generate the autocompletion script for fish + +### Synopsis + +Generate the autocompletion script for the fish shell. + +To load completions in your current shell session: + + dbxcli completion fish | source + +To load completions for every new session, execute once: + + dbxcli completion fish > ~/.config/fish/completions/dbxcli.fish + +You will need to start a new shell for this setup to take effect. + + +``` +dbxcli completion fish [flags] +``` + +### Options + +``` + -h, --help help for fish + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli completion](dbxcli_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/commands/dbxcli_completion_powershell.md b/docs/commands/dbxcli_completion_powershell.md new file mode 100644 index 0000000..ff0b5c2 --- /dev/null +++ b/docs/commands/dbxcli_completion_powershell.md @@ -0,0 +1,41 @@ + + +## dbxcli completion powershell + +Generate the autocompletion script for powershell + +### Synopsis + +Generate the autocompletion script for powershell. + +To load completions in your current shell session: + + dbxcli completion powershell | Out-String | Invoke-Expression + +To load completions for every new session, add the output of the above command +to your powershell profile. + + +``` +dbxcli completion powershell [flags] +``` + +### Options + +``` + -h, --help help for powershell + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli completion](dbxcli_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/commands/dbxcli_completion_zsh.md b/docs/commands/dbxcli_completion_zsh.md new file mode 100644 index 0000000..716e400 --- /dev/null +++ b/docs/commands/dbxcli_completion_zsh.md @@ -0,0 +1,55 @@ + + +## dbxcli completion zsh + +Generate the autocompletion script for zsh + +### Synopsis + +Generate the autocompletion script for the zsh shell. + +If shell completion is not already enabled in your environment you will need +to enable it. You can execute the following once: + + echo "autoload -U compinit; compinit" >> ~/.zshrc + +To load completions in your current shell session: + + source <(dbxcli completion zsh) + +To load completions for every new session, execute once: + +#### Linux: + + dbxcli completion zsh > "${fpath[1]}/_dbxcli" + +#### macOS: + + dbxcli completion zsh > $(brew --prefix)/share/zsh/site-functions/_dbxcli + +You will need to start a new shell for this setup to take effect. + + +``` +dbxcli completion zsh [flags] +``` + +### Options + +``` + -h, --help help for zsh + --no-descriptions disable completion descriptions +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli completion](dbxcli_completion.md) - Generate the autocompletion script for the specified shell + diff --git a/docs/commands/dbxcli_cp.md b/docs/commands/dbxcli_cp.md new file mode 100644 index 0000000..5f37acc --- /dev/null +++ b/docs/commands/dbxcli_cp.md @@ -0,0 +1,28 @@ + + +## dbxcli cp + +Copy a file or folder to a different location in the user's Dropbox. If the source path is a folder all its contents will be copied. + +``` +dbxcli cp [flags] [more sources] +``` + +### Options + +``` + -h, --help help for cp +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_du.md b/docs/commands/dbxcli_du.md new file mode 100644 index 0000000..e1b80b3 --- /dev/null +++ b/docs/commands/dbxcli_du.md @@ -0,0 +1,28 @@ + + +## dbxcli du + +Display usage information + +``` +dbxcli du [flags] +``` + +### Options + +``` + -h, --help help for du +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_get.md b/docs/commands/dbxcli_get.md new file mode 100644 index 0000000..aeff3db --- /dev/null +++ b/docs/commands/dbxcli_get.md @@ -0,0 +1,46 @@ + + +## dbxcli get + +Download a file or folder + +### Synopsis + +Download a file or folder from Dropbox. + - Use --recursive (-r) to download entire directories. + - Use - as target to write file bytes to stdout. + Stdout is byte-clean: all progress and errors go to stderr. + + +``` +dbxcli get [flags] [] +``` + +### Examples + +``` + dbxcli get /remote/file.txt ./local-file.txt + dbxcli get -r /remote/folder ./local-folder + dbxcli get /backups/src.tgz - | tar tz + dbxcli get /file.txt - > local-copy.txt +``` + +### Options + +``` + -h, --help help for get + -r, --recursive Recursively download a folder +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_login.md b/docs/commands/dbxcli_login.md new file mode 100644 index 0000000..c98966c --- /dev/null +++ b/docs/commands/dbxcli_login.md @@ -0,0 +1,36 @@ + + +## dbxcli login + +Log in and save Dropbox credentials + +### Synopsis + +Log in and save Dropbox credentials. + +By default, login stores credentials for regular Dropbox user commands. +Use "team-access" for --as-member commands or "team-manage" for team commands. + +``` +dbxcli login [personal|team-access|team-manage] [flags] +``` + +### Options + +``` + --app-key string Dropbox app key to use for this login + -h, --help help for login +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_logout.md b/docs/commands/dbxcli_logout.md new file mode 100644 index 0000000..ec10a28 --- /dev/null +++ b/docs/commands/dbxcli_logout.md @@ -0,0 +1,28 @@ + + +## dbxcli logout + +Log out of the current session + +``` +dbxcli logout [flags] +``` + +### Options + +``` + -h, --help help for logout +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_ls.md b/docs/commands/dbxcli_ls.md new file mode 100644 index 0000000..3152ab0 --- /dev/null +++ b/docs/commands/dbxcli_ls.md @@ -0,0 +1,45 @@ + + +## dbxcli ls + +List files and folders + +``` +dbxcli ls [flags] [] +``` + +### Examples + +``` + dbxcli ls / # Or just 'ls' + dbxcli ls /some-folder # Or 'ls some-folder' + dbxcli ls /some-folder/some-file.pdf + dbxcli ls -l +``` + +### Options + +``` + -h, --help help for ls + -d, --include-deleted Include deleted files + -l, --long Long listing + -D, --only-deleted Only show deleted files + -R, --recurse Recursively list all subfolders + -r, --reverse Reverse sort order + --sort string Sort by: name, size, time, type + --time string Time field: server, client (default "server") + --time-format string Time format: short (2006-01-02 15:04), rfc3339 +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_mkdir.md b/docs/commands/dbxcli_mkdir.md new file mode 100644 index 0000000..6023f4a --- /dev/null +++ b/docs/commands/dbxcli_mkdir.md @@ -0,0 +1,29 @@ + + +## dbxcli mkdir + +Create a new directory + +``` +dbxcli mkdir [flags] +``` + +### Options + +``` + -h, --help help for mkdir + -p, --parents No error if existing, create parent directories as needed +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_mv.md b/docs/commands/dbxcli_mv.md new file mode 100644 index 0000000..d0b307c --- /dev/null +++ b/docs/commands/dbxcli_mv.md @@ -0,0 +1,28 @@ + + +## dbxcli mv + +Move files + +``` +dbxcli mv [flags] +``` + +### Options + +``` + -h, --help help for mv +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_put.md b/docs/commands/dbxcli_put.md new file mode 100644 index 0000000..9248fc2 --- /dev/null +++ b/docs/commands/dbxcli_put.md @@ -0,0 +1,52 @@ + + +## dbxcli put + +Upload files or directories + +### Synopsis + +Upload files or directories to Dropbox. + - If target is not provided, uploads to the root of your Dropbox. + - Use --recursive (-r) to upload entire directories. + - Use - as source to read from stdin (target is required). + Stdin is spooled to a temp file before upload and may use disk + space up to the full input size. + + +``` +dbxcli put [flags] [] +``` + +### Examples + +``` + dbxcli put file.txt /destination/file.txt + dbxcli put -r ./project /backup/project + printf 'hello' | dbxcli put - /hello.txt + tar cz ./src | dbxcli put - /backups/src.tgz +``` + +### Options + +``` + -c, --chunksize int Chunk size to use (should be multiple of 4MiB) (default 16777216) + -d, --debug Print debug timing + -h, --help help for put + --if-exists string What to do when the destination file exists: overwrite, skip, or fail (default "overwrite") + -r, --recursive Recursively upload directories + -w, --workers int Number of concurrent upload workers to use (default 4) +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_restore.md b/docs/commands/dbxcli_restore.md new file mode 100644 index 0000000..9b73abf --- /dev/null +++ b/docs/commands/dbxcli_restore.md @@ -0,0 +1,42 @@ + + +## dbxcli restore + +Restore a file revision + +### Synopsis + +Restore a Dropbox file at to the supplied revision. + +The target path is the Dropbox path where the restored file is saved. +Use "dbxcli revs " to list available revisions. + +``` +dbxcli restore [flags] +``` + +### Examples + +``` + dbxcli revs /Reports/old.pdf + dbxcli restore /Reports/old.pdf 015f... +``` + +### Options + +``` + -h, --help help for restore +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_revs.md b/docs/commands/dbxcli_revs.md new file mode 100644 index 0000000..1e3056c --- /dev/null +++ b/docs/commands/dbxcli_revs.md @@ -0,0 +1,31 @@ + + +## dbxcli revs + +List file revisions + +``` +dbxcli revs [flags] +``` + +### Options + +``` + -h, --help help for revs + -l, --long Long listing + --time string Time field: server, client (default "server") + --time-format string Time format: short (2006-01-02 15:04), rfc3339 +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_rm.md b/docs/commands/dbxcli_rm.md new file mode 100644 index 0000000..33e9577 --- /dev/null +++ b/docs/commands/dbxcli_rm.md @@ -0,0 +1,31 @@ + + +## dbxcli rm + +Remove files or folders + +``` +dbxcli rm [flags] +``` + +### Options + +``` + -f, --force Allow removing non-empty folders; same as --recursive + -h, --help help for rm + --permanent Permanently delete instead of moving to Dropbox trash + -r, --recursive Recursively remove folders +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_search.md b/docs/commands/dbxcli_search.md new file mode 100644 index 0000000..b0f0fda --- /dev/null +++ b/docs/commands/dbxcli_search.md @@ -0,0 +1,33 @@ + + +## dbxcli search + +Search + +``` +dbxcli search [flags] [path-scope] +``` + +### Options + +``` + -h, --help help for search + -l, --long Long listing + -r, --reverse Reverse sort order + --sort string Sort by: name, size, time, type + --time string Time field: server, client (default "server") + --time-format string Time format: short (2006-01-02 15:04), rfc3339 +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/commands/dbxcli_share-link.md b/docs/commands/dbxcli_share-link.md new file mode 100644 index 0000000..5fbd31e --- /dev/null +++ b/docs/commands/dbxcli_share-link.md @@ -0,0 +1,34 @@ + + +## dbxcli share-link + +Shared link commands + +### Synopsis + +Create, list, inspect, download, update, and revoke Dropbox shared links. + +### Options + +``` + -h, --help help for share-link +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins +* [dbxcli share-link create](dbxcli_share-link_create.md) - Create a shared link +* [dbxcli share-link download](dbxcli_share-link_download.md) - Download shared link content +* [dbxcli share-link info](dbxcli_share-link_info.md) - Display shared link information +* [dbxcli share-link list](dbxcli_share-link_list.md) - List shared links +* [dbxcli share-link revoke](dbxcli_share-link_revoke.md) - Revoke shared links +* [dbxcli share-link update](dbxcli_share-link_update.md) - Update shared link settings + diff --git a/docs/commands/dbxcli_share-link_create.md b/docs/commands/dbxcli_share-link_create.md new file mode 100644 index 0000000..7ba3658 --- /dev/null +++ b/docs/commands/dbxcli_share-link_create.md @@ -0,0 +1,53 @@ + + +## dbxcli share-link create + +Create a shared link + +### Synopsis + +Create a shared link for a Dropbox file or folder. +If a direct shared link already exists, dbxcli returns that existing URL. +Settings flags request Dropbox shared-link settings; account, team, and folder policies may still restrict the result. + +``` +dbxcli share-link create [flags] +``` + +### Examples + +``` + dbxcli share-link create /file.txt + dbxcli share-link create /folder + dbxcli share-link create /file.txt --audience team + dbxcli share-link create /file.txt --expires 2026-07-01T00:00:00Z + dbxcli share-link create /file.txt --password-prompt +``` + +### Options + +``` + --access string Set shared link access level: viewer, editor, or max + --allow-download Allow downloads from the shared link + --audience string Set shared link audience: public, team, members, or no-one + --disallow-download Disallow downloads from the shared link + --expires string Set shared link expiration time as an RFC3339 timestamp + -h, --help help for create + --password string Password for password-protected shared links + --password-file string Read the shared link password from a file + --password-prompt Prompt for the shared link password + --remove-expiration Remove expiration when returning an existing shared link +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share-link_download.md b/docs/commands/dbxcli_share-link_download.md new file mode 100644 index 0000000..1f758dc --- /dev/null +++ b/docs/commands/dbxcli_share-link_download.md @@ -0,0 +1,52 @@ + + +## dbxcli share-link download + +Download shared link content + +### Synopsis + +Download content from a Dropbox shared link. + - If target is omitted, the local filename comes from shared-link metadata. + - Use --path to download a file inside a folder shared link. + - Use - as target to write file bytes to stdout. + Stdout is byte-clean: all progress and errors go to stderr. + - Use --recursive (-r) to download folder shared links. + + +``` +dbxcli share-link download [target] [flags] +``` + +### Examples + +``` + dbxcli share-link download https://www.dropbox.com/s/example/file.txt + dbxcli share-link download https://www.dropbox.com/s/example/file.txt ./local-file.txt + dbxcli share-link download https://www.dropbox.com/s/example/folder --path /nested/file.txt + dbxcli share-link download https://www.dropbox.com/s/example/file.txt - | tar tz +``` + +### Options + +``` + -h, --help help for download + --password string Password for password-protected shared links + --password-file string Read the shared link password from a file + --password-prompt Prompt for the shared link password + --path string Download a file path inside a folder shared link + -r, --recursive Recursively download a folder shared link +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share-link_info.md b/docs/commands/dbxcli_share-link_info.md new file mode 100644 index 0000000..e9ece49 --- /dev/null +++ b/docs/commands/dbxcli_share-link_info.md @@ -0,0 +1,44 @@ + + +## dbxcli share-link info + +Display shared link information + +### Synopsis + +Display metadata and permissions for a shared link. +Use --path to inspect a file or folder inside a folder shared link. + +``` +dbxcli share-link info [flags] +``` + +### Examples + +``` + dbxcli share-link info https://www.dropbox.com/s/example/file.txt + dbxcli share-link info https://www.dropbox.com/s/example/folder --path /nested/file.txt +``` + +### Options + +``` + -h, --help help for info + --password string Password for password-protected shared links + --password-file string Read the shared link password from a file + --password-prompt Prompt for the shared link password + --path string Display metadata for a path inside the shared link +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share-link_list.md b/docs/commands/dbxcli_share-link_list.md new file mode 100644 index 0000000..788f9dc --- /dev/null +++ b/docs/commands/dbxcli_share-link_list.md @@ -0,0 +1,40 @@ + + +## dbxcli share-link list + +List shared links + +### Synopsis + +List shared links. +When path is supplied, dbxcli lists direct shared links for that Dropbox path only. + +``` +dbxcli share-link list [path] [flags] +``` + +### Examples + +``` + dbxcli share-link list + dbxcli share-link list /file.txt +``` + +### Options + +``` + -h, --help help for list +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share-link_revoke.md b/docs/commands/dbxcli_share-link_revoke.md new file mode 100644 index 0000000..0fec1b0 --- /dev/null +++ b/docs/commands/dbxcli_share-link_revoke.md @@ -0,0 +1,40 @@ + + +## dbxcli share-link revoke + +Revoke shared links + +### Synopsis + +Revoke a shared link by URL, or revoke all direct shared links for a Dropbox path with --path. + +``` +dbxcli share-link revoke [url] [flags] +``` + +### Examples + +``` + dbxcli share-link revoke https://www.dropbox.com/s/example/file.txt + dbxcli share-link revoke --path /file.txt +``` + +### Options + +``` + -h, --help help for revoke + --path string Revoke direct shared links for a Dropbox path +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share-link_update.md b/docs/commands/dbxcli_share-link_update.md new file mode 100644 index 0000000..dd70836 --- /dev/null +++ b/docs/commands/dbxcli_share-link_update.md @@ -0,0 +1,52 @@ + + +## dbxcli share-link update + +Update shared link settings + +### Synopsis + +Update settings for an existing shared link. +At least one setting flag is required. Dropbox account, team, and folder policies may reject or constrain requested settings. + +``` +dbxcli share-link update [flags] +``` + +### Examples + +``` + dbxcli share-link update https://www.dropbox.com/s/example/file.txt --audience team + dbxcli share-link update https://www.dropbox.com/s/example/file.txt --expires 2026-07-01T00:00:00Z + dbxcli share-link update https://www.dropbox.com/s/example/file.txt --remove-expiration + dbxcli share-link update https://www.dropbox.com/s/example/file.txt --password-prompt + dbxcli share-link update https://www.dropbox.com/s/example/file.txt --remove-password +``` + +### Options + +``` + --allow-download Allow downloads from the shared link + --audience string Set shared link audience: public, team, members, or no-one + --disallow-download Disallow downloads from the shared link + --expires string Set shared link expiration time as an RFC3339 timestamp + -h, --help help for update + --password string Password for password-protected shared links + --password-file string Read the shared link password from a file + --password-prompt Prompt for the shared link password + --remove-expiration Remove the shared link expiration time + --remove-password Remove the shared link password +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share-link](dbxcli_share-link.md) - Shared link commands + diff --git a/docs/commands/dbxcli_share.md b/docs/commands/dbxcli_share.md new file mode 100644 index 0000000..e482874 --- /dev/null +++ b/docs/commands/dbxcli_share.md @@ -0,0 +1,25 @@ + + +## dbxcli share + +Sharing commands + +### Options + +``` + -h, --help help for share +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins +* [dbxcli share list](dbxcli_share_list.md) - List shared things + diff --git a/docs/commands/dbxcli_share_list.md b/docs/commands/dbxcli_share_list.md new file mode 100644 index 0000000..19d05b6 --- /dev/null +++ b/docs/commands/dbxcli_share_list.md @@ -0,0 +1,25 @@ + + +## dbxcli share list + +List shared things + +### Options + +``` + -h, --help help for list +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share](dbxcli_share.md) - Sharing commands +* [dbxcli share list folder](dbxcli_share_list_folder.md) - List shared folders + diff --git a/docs/commands/dbxcli_share_list_folder.md b/docs/commands/dbxcli_share_list_folder.md new file mode 100644 index 0000000..bd6563f --- /dev/null +++ b/docs/commands/dbxcli_share_list_folder.md @@ -0,0 +1,28 @@ + + +## dbxcli share list folder + +List shared folders + +``` +dbxcli share list folder [flags] +``` + +### Options + +``` + -h, --help help for folder +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli share list](dbxcli_share_list.md) - List shared things + diff --git a/docs/commands/dbxcli_team.md b/docs/commands/dbxcli_team.md new file mode 100644 index 0000000..9f2280e --- /dev/null +++ b/docs/commands/dbxcli_team.md @@ -0,0 +1,29 @@ + + +## dbxcli team + +Team management commands + +### Options + +``` + -h, --help help for team +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins +* [dbxcli team add-member](dbxcli_team_add-member.md) - Add a new member to a team +* [dbxcli team info](dbxcli_team_info.md) - Get team information +* [dbxcli team list-groups](dbxcli_team_list-groups.md) - List groups +* [dbxcli team list-members](dbxcli_team_list-members.md) - List team members +* [dbxcli team remove-member](dbxcli_team_remove-member.md) - Remove member from a team + diff --git a/docs/commands/dbxcli_team_add-member.md b/docs/commands/dbxcli_team_add-member.md new file mode 100644 index 0000000..b451e3f --- /dev/null +++ b/docs/commands/dbxcli_team_add-member.md @@ -0,0 +1,28 @@ + + +## dbxcli team add-member + +Add a new member to a team + +``` +dbxcli team add-member [flags] +``` + +### Options + +``` + -h, --help help for add-member +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli team](dbxcli_team.md) - Team management commands + diff --git a/docs/commands/dbxcli_team_info.md b/docs/commands/dbxcli_team_info.md new file mode 100644 index 0000000..11c731c --- /dev/null +++ b/docs/commands/dbxcli_team_info.md @@ -0,0 +1,28 @@ + + +## dbxcli team info + +Get team information + +``` +dbxcli team info [flags] +``` + +### Options + +``` + -h, --help help for info +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli team](dbxcli_team.md) - Team management commands + diff --git a/docs/commands/dbxcli_team_list-groups.md b/docs/commands/dbxcli_team_list-groups.md new file mode 100644 index 0000000..f07f63a --- /dev/null +++ b/docs/commands/dbxcli_team_list-groups.md @@ -0,0 +1,28 @@ + + +## dbxcli team list-groups + +List groups + +``` +dbxcli team list-groups [flags] +``` + +### Options + +``` + -h, --help help for list-groups +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli team](dbxcli_team.md) - Team management commands + diff --git a/docs/commands/dbxcli_team_list-members.md b/docs/commands/dbxcli_team_list-members.md new file mode 100644 index 0000000..55d412e --- /dev/null +++ b/docs/commands/dbxcli_team_list-members.md @@ -0,0 +1,28 @@ + + +## dbxcli team list-members + +List team members + +``` +dbxcli team list-members [flags] +``` + +### Options + +``` + -h, --help help for list-members +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli team](dbxcli_team.md) - Team management commands + diff --git a/docs/commands/dbxcli_team_remove-member.md b/docs/commands/dbxcli_team_remove-member.md new file mode 100644 index 0000000..ff780fd --- /dev/null +++ b/docs/commands/dbxcli_team_remove-member.md @@ -0,0 +1,28 @@ + + +## dbxcli team remove-member + +Remove member from a team + +``` +dbxcli team remove-member [flags] +``` + +### Options + +``` + -h, --help help for remove-member +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli team](dbxcli_team.md) - Team management commands + diff --git a/docs/commands/dbxcli_version.md b/docs/commands/dbxcli_version.md new file mode 100644 index 0000000..90d75cc --- /dev/null +++ b/docs/commands/dbxcli_version.md @@ -0,0 +1,28 @@ + + +## dbxcli version + +Print version information + +``` +dbxcli version [flags] +``` + +### Options + +``` + -h, --help help for version +``` + +### Options inherited from parent commands + +``` + --as-member string Member ID to perform action as + --output string Output format: text, json (default "text") + -v, --verbose Enable verbose logging +``` + +### SEE ALSO + +* [dbxcli](dbxcli.md) - A command line tool for Dropbox users and team admins + diff --git a/docs/json-schema/v1/error.schema.json b/docs/json-schema/v1/error.schema.json index 947ea52..dd9209a 100644 --- a/docs/json-schema/v1/error.schema.json +++ b/docs/json-schema/v1/error.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://github.com/dropbox/dbxcli/docs/json-schema/v1/error.schema.json", + "$id": "https://raw.githubusercontent.com/dropbox/dbxcli/master/docs/json-schema/v1/error.schema.json", "title": "dbxcli JSON error response", "type": "object", "additionalProperties": false, diff --git a/docs/json-schema/v1/success.schema.json b/docs/json-schema/v1/success.schema.json index 00b9c97..d61df3a 100644 --- a/docs/json-schema/v1/success.schema.json +++ b/docs/json-schema/v1/success.schema.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://github.com/dropbox/dbxcli/docs/json-schema/v1/success.schema.json", + "$id": "https://raw.githubusercontent.com/dropbox/dbxcli/master/docs/json-schema/v1/success.schema.json", "title": "dbxcli JSON success response", "type": "object", "additionalProperties": false, diff --git a/go.mod b/go.mod index e41c704..08394f2 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,10 @@ require ( ) require ( + github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.10 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/sys v0.46.0 // indirect ) diff --git a/go.sum b/go.sum index c2eba8b..bf8f5b9 100644 --- a/go.sum +++ b/go.sum @@ -39,6 +39,7 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dropbox/dropbox-sdk-go-unofficial/v6 v6.0.5 h1:FT+t0UEDykcor4y3dMVKXIiWJETBpRgERYTGlmMd7HU= @@ -105,8 +106,10 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -115,6 +118,7 @@ github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= @@ -131,6 +135,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -364,6 +369,7 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/tools/gen-docs/main.go b/tools/gen-docs/main.go new file mode 100644 index 0000000..8c9b09b --- /dev/null +++ b/tools/gen-docs/main.go @@ -0,0 +1,71 @@ +// Copyright © 2026 Dropbox, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/dropbox/dbxcli/cmd" + "github.com/spf13/cobra" + "github.com/spf13/cobra/doc" +) + +const outputDir = "docs/commands" + +func main() { + if err := run(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} + +func run() error { + if _, err := os.Stat("go.mod"); err != nil { + return fmt.Errorf("run from repository root: %w", err) + } + + root := cmd.RootCmd + if _, _, err := root.Find([]string{"version"}); err != nil { + root.AddCommand(cmd.NewVersionCommand("dev")) + } + disableAutoGenTag(root) + + if err := os.RemoveAll(outputDir); err != nil { + return fmt.Errorf("remove %s: %w", outputDir, err) + } + if err := os.MkdirAll(outputDir, 0o755); err != nil { + return fmt.Errorf("create %s: %w", outputDir, err) + } + + prepender := func(_ string) string { + return "\n\n" + } + linkHandler := func(name string) string { + return filepath.Base(name) + } + if err := doc.GenMarkdownTreeCustom(root, outputDir, prepender, linkHandler); err != nil { + return fmt.Errorf("generate command docs: %w", err) + } + return nil +} + +func disableAutoGenTag(command *cobra.Command) { + command.DisableAutoGenTag = true + for _, child := range command.Commands() { + disableAutoGenTag(child) + } +}