Skip to content

feat(cli): support shell completion (bash/zsh/fish) #2476

Description

@cbingb666

Feature request

Add shell completion for the kimi CLI (bash, zsh, fish).

Motivation

kimi has a growing set of subcommands (export, provider, acp, web, login, doctor, ...) and many flags (-m/--model, -p/--prompt, --output-format, --skills-dir, --agent, --add-dir, ...). Without completion, users have to remember exact flag names or run kimi --help repeatedly.

Proposal

  • Add a kimi completion <shell> command (like gh completion zsh) that prints a completion script for bash / zsh / fish, so users can do e.g.:

    kimi completion zsh > "${fpath[1]}/_kimi"
    # or: echo 'eval "$(kimi completion bash)"' >> ~/.bashrc
  • Completion should cover:

    • subcommand names
    • global and per-subcommand flags
    • dynamic values where feasible, e.g. session IDs for --session/export, model aliases for -m/--model (from config.toml), agent profile names for --agent

Environment

  • kimi-code version: 0.31.0
  • OS: macOS (but this applies to all platforms)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions