Skip to content

Support Ruby's short subcommand aliases (lc i dev CRY-37, etc.) #14

Description

@bougyman

Optimus's subcommand spec has no alias mechanism (verified: no alias support in vendor/optimus/lib/optimus.ex/subcommand.ex), so only canonical subcommand names work today - lc i dev CRY-37 fails, you have to type lc issue develop CRY-37.

Ruby's linear-cli supports short aliases at both the top-level-command and subcommand level, registered via each command module's ALIASES constant (cli.rb's register/register_sub!, not just the README's incomplete prose list). Full authoritative table, pulled from source:

Top-level commands:

  • whoami -> me, w, who, whodat
  • version -> v
  • issue -> i, issues
  • team -> t, teams
  • project -> p, projects

issue subcommands:

  • create -> c, new, add
  • develop -> d, dev
  • list -> l, ls
  • update -> u
  • pr -> pull-request
  • (take has no alias in Ruby either)

team subcommands:

  • list -> l, ls

project subcommands:

  • list -> l, ls

Plan: a pre-parse rewrite step, same pattern as LinearCli.CLI.normalize_aliases/1 (flag aliases) and normalize_help/1 - expand the leading 1-2 tokens to their canonical form via a plain map lookup before Optimus.parse!/3 ever sees them, so --help/dispatch/everything downstream just works unchanged. Needs to run before normalize_help/1 (which inspects the leading non-flag-token path to build help <path> - it needs the canonical path, not the alias, since Optimus's own help only recognizes real subcommand names).

Out of scope: lc completion (dry-cli-specific, no Optimus equivalent) and the console/pry command (dev-only Ruby tooling, not part of this port).

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