Skip to content

Proposal: shell completion for sqitch commands #866

@placetobejohan

Description

@placetobejohan

Problem Statement

Sqitch has a rich CLI with multiple subcommands (deploy, revert, log, etc.) and options. However, it currently lacks built-in shell completion, making command discovery and usage slower. Users must manually type full command names, database URIs, and change names without suggestions.

Proposed Solution

Implement shell completion scripts for popular shells:

  • Bash (sqitch-completion.bash)
  • Zsh (_sqitch)
  • Fish (sqitch.fish)

The completion should:

  1. Suggest Sqitch subcommands (deploy, revert, log, etc.).
  2. Auto-complete options (e.g., --target, --to).
  3. Suggest change names from sqitch.plan.
  4. (Optional) Auto-complete database URIs from a config file.

Implementation

Many CLI tools generate completion scripts dynamically (e.g., Git, Docker). Sqitch could provide:

  • A sqitch completion <shell> command to output the completion script.
  • Installation instructions for different shells.

Benefits

  • Faster command execution with fewer typos.
  • Easier onboarding for new users.
  • Improved developer experience when working with many changes.

Would this be useful for others? Feedback is welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions