Skip to content

feat: support alias for command names, resolves #152 - #224

Closed
ratiofu wants to merge 1 commit into
unjs:mainfrom
ratiofu:alias-support-for-commands
Closed

ratiofu wants to merge 1 commit into
unjs:mainfrom
ratiofu:alias-support-for-commands

Conversation

@ratiofu

@ratiofu ratiofu commented Feb 8, 2026 •

Copy link
Copy Markdown
Contributor

🔗 Linked issue

add alias support #152

❓ Type of change

  • ✨ New feature (a non-breaking change that adds functionality)

📚 Description

Support providing a (short) alias for a command, resolve based on it, and render the alias as part of the usage output.

const install = defineCommand({
  meta: {
    name: "install",
    alias: "i", // ← this is new ✨
    description: "Install dependencies",
  },
  run() {
    console.log("Installing...");
  },
});

const main = defineCommand({
  meta: {
    name: "my-cli",
    description: "My Awesome CLI",
  },
  subCommands: {
    install,
  },
});

runMain(main);
My Awesome CLI (my-cli)

USAGE my-cli install

COMMANDS

  install, i    Install dependencies
...

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 mentioned this pull request Mar 15, 2026
7 tasks done
@pi0

pi0 commented Mar 15, 2026

Copy link
Copy Markdown
Member

Thanks for PR ❤️ Landing via #236

@pi0 pi0 closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants