Skip to main content
The completion command generates shell completion scripts that provide intelligent tab completion for Cloudstic commands, subcommands, flags, and values.

Usage

Supported Shells

  • bash: Bourne Again Shell
  • zsh: Z Shell
  • fish: Friendly Interactive Shell

Installation

1

Generate the completion script

Run the completion command for your shell. The script is printed to stdout.
2

Load the completion script

Source the completion script in your current shell session or add it to your shell configuration file.

Bash

For current session only:
Permanent installation:
Alternative: Install to system completion directory

Zsh

For current session only:
Permanent installation:
Alternative: Install to completion directory

Fish

For current session only:
Permanent installation:
3

Reload your shell or start a new session

For bash and zsh:
For fish:
Or simply open a new terminal window.
4

Test the completion

Try typing cloudstic and press Tab to see available commands:

Features

The completion scripts provide intelligent suggestions for:

Commands and Subcommands

Flags and Options

Flag Values

File Path Completion

Context-Aware Completions

The completion scripts understand the current command context:

Dynamic Completion for Profiles and Auth Entries

Unlike static flag values, -profile and -auth-ref are completed dynamically: the completion script shells out to cloudstic __complete under the hood, which reads your actual profiles.yaml and returns the live list of profile and auth-entry names.
This means completions always reflect the profiles and auth entries you’ve actually created, no regeneration required after editing profiles.yaml. The lookup honors -profiles-file / CLOUDSTIC_PROFILES_FILE if you point at a non-default profiles file, and silently returns no suggestions if the file doesn’t exist yet or can’t be parsed.
The -profile and -auth-ref flags are the only two with dynamic, file-backed completion. All other flag values (source types, store types, shell names, and so on) are completed from a static, built-in list.

Completion Examples

Completing Store Types

Completing Source Types

Completing Subcommands

Completing Shell Types

Troubleshooting

Bash: Completions not working

  1. Ensure bash-completion package is installed:
  2. Verify bash-completion is loaded in your .bashrc:

Zsh: Command not found: compdef

  1. Enable compinit in your .zshrc before sourcing the completion:

Fish: Completions not appearing

  1. Check that the completion file was created:
  2. Reload completions:

General: Old completions cached

If you update Cloudstic and completions don’t reflect new commands:

Available Completions

The completion scripts provide suggestions for:

Global Flags (available in all commands)

  • -store → URI completion (shows format hints: local:, s3:, b2:, sftp://)
  • -s3-endpoint → free text
  • -s3-region → free text
  • -s3-access-key → free text
  • -s3-secret-key → free text
  • -store-sftp-password → free text
  • -store-sftp-key → file path completion
  • -store-sftp-known-hosts → file path completion
  • -store-sftp-insecure → boolean flag
  • -source-sftp-password → free text
  • -source-sftp-key → file path completion
  • -source-sftp-known-hosts → file path completion
  • -source-sftp-insecure → boolean flag
  • -encryption-key → free text
  • -password → free text
  • -recovery-key → free text
  • -kms-key-arn → free text
  • -disable-packfile → boolean flag
  • -verbose → boolean flag
  • -quiet → boolean flag
  • -debug → boolean flag

Command-Specific Flags

init
  • -add-recovery-key
  • -no-encryption
backup
  • -sourcelocal, sftp, gdrive, gdrive-changes, onedrive, onedrive-changes
  • -tag → free text (repeatable)
  • -ignore-empty-snapshot
  • -dry-run
restore
  • -output → file or directory path completion (default: ./restore.zip)
  • -formatzip or dir
  • -path → free text
  • -dry-run
prune
  • -dry-run
forget
  • -prune
  • -dry-run
  • -keep-last → number
  • -keep-hourly → number
  • -keep-daily → number
  • -keep-weekly → number
  • -keep-monthly → number
  • -keep-yearly → number
  • -tag → free text (repeatable)
  • -source → free text
  • -account → free text
  • -path → free text
  • -group-by → free text (default: source,account,path)
cat
  • -json
key passwd
  • -new-password → free text
check
  • -read-data

Notes

  • Performance: Completions are generated dynamically based on the current command context
  • File completions: File and directory paths use native shell completion capabilities
  • No external dependencies: Completion scripts are self-contained and don’t require network access
  • Automatic updates: Regenerate completions after upgrading Cloudstic to get the latest commands and flags
  • : Display usage information
  • : Print version information