Skip to content

Accept pipe input for gh alias set #3487

@heaths

Description

@heaths

Describe the feature or problem you’d like to solve

Using gh version 1.9.2, I cannot reliably set aliases for complex commands with mixed quotations. Different shells have different rules on quotes, variable replacement characters e.g. $, and they can destroy the correct command line whether using multiline string literals, read in linux, or many other methods I've tried across PowerShell and bash.

Proposed solution

Like some other commands that might accept more complex input with mixed quotes or variable replacement characters, accept piped input instead, e.g.:

cat example.txt | gh alias set example -

The dash - would denote that stdin should be read for content instead and no escaping should be done on input. While - is fairly common, a switch would be sufficient as well.

Additional context

After many various attempts, I ended up just editing ~/.config/gh/config.yml directly, but for repeatability - like sharing useful aliases people can simply copy and paste into their terminal - it would be great to provide a command line-driven alternative like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions