Skip to content

feat(cli): add --gw and --ws aliases for --gateway and --workspace #6200

In review

Description

@purp

User Story

I use OpenShell daily to work across multiple gateways and workspaces, passing --gateway and --workspace on most commands. I need shorter flag spellings that match the existing gw and ws subcommand aliases, so that commands are quicker to type and consistent.

Problem Statement

The openshell CLI already accepts gw and ws as aliases for the gateway and workspace subcommands. The global flags have no matching spellings: --gateway has only the short form -g, and --workspace has no short form or alias. Users must type the full flag names, and the flags are inconsistent with the subcommand aliases.

Impact / Why This Matters

Users who switch between gateways and workspaces type --gateway and --workspace repeatedly. Today they can set OPENSHELL_GATEWAY and OPENSHELL_WORKSPACE or define shell aliases. That works for a fixed target but not for one-off overrides, and it does not make the flags consistent with the gw and ws subcommand aliases.

Proposed Design

Accept --gw as an alias of --gateway and --ws as an alias of --workspace. Both remain global flags. The aliases keep the same environment variables (OPENSHELL_GATEWAY, OPENSHELL_WORKSPACE), defaults, and shell completion as the full flags. Existing spellings, including -g, continue to work.

Suggested UX (if applicable)

openshell --gw prod --ws team-a sandbox list
openshell sandbox list --gw prod --ws team-a

Acceptance Criteria

  • --gw <name> selects the gateway exactly as --gateway <name> does, before or after the subcommand.
  • --ws <name> selects the workspace exactly as --workspace <name> does, before or after the subcommand.
  • Both aliases appear in help output.
  • Shell completion works for both aliases.
  • Existing flags, -g, and the OPENSHELL_GATEWAY and OPENSHELL_WORKSPACE environment variables are unchanged.
  • Published CLI docs mention the aliases where the full flags are documented.

Alternatives Considered

  • Setting OPENSHELL_GATEWAY and OPENSHELL_WORKSPACE in the environment. This suits a fixed target but is clumsy for per-command overrides.
  • Shell aliases or functions. These are per-user, undiscoverable from openshell --help, and do not carry completion.

Activity

  1. added
    state:accepted
    area:platform
    topic:ux
    on Dec 3, 2026
  2. added a commit that references this issue on Dec 4, 2026
    90bc53d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platformstate:acceptedtopic:ux

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions