Skip to content

Enable plugability or alias support for commands #487

@jrschumacher

Description

@jrschumacher

There is desire to override the default behavior of a command with an alias. This enables the use of the CLI in a way where the behavior is consistent and reduces the number of options.

Use Case

I am developing a script which will be applied to various machines to process logs. I want to ensure that every time the encrypt process is used a default attribute is applied.

This could be done via scripting, but since new developers might not know about that script I'd prefer to pre-configure the CLI to always add this command.

Example

The GitHub CLI gh supports this via the alias subcommand.

Aliases can be used to make shortcuts for gh commands or to compose multiple commands.

Run `gh help alias set` to learn more.


USAGE
  gh alias <command> [flags]

AVAILABLE COMMANDS
  delete:      Delete set aliases
  import:      Import aliases from a YAML file
  list:        List your aliases
  set:         Create a shortcut for a gh command

INHERITED FLAGS
  --help   Show help for command

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual
  Learn about exit codes using `gh help exit-codes`

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions