Skip to content

feat(alias): rename alias to tool-alias, add shell-alias command#7357

Merged
jdx merged 8 commits into
mainfrom
fix/alias-deprecation-message
Dec 17, 2025
Merged

feat(alias): rename alias to tool-alias, add shell-alias command#7357
jdx merged 8 commits into
mainfrom
fix/alias-deprecation-message

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Dec 17, 2025

Summary

Fixes #7353

  • Renames the mise alias command to mise tool-alias (keeping alias and aliases as hidden aliases for backwards compatibility)
  • Renames internal alias module/directory to tool_alias and Alias* structs to ToolAlias*
  • Updates set_alias/set_backend_alias to write to [tool_alias] config section instead of deprecated [alias]
  • Updates remove_alias/remove_backend_alias to check both [tool_alias] and [alias] sections for removal
  • Adds new shell-alias command for managing shell aliases ([shell_alias] config section)
    • mise shell-alias ls - list shell aliases
    • mise shell-alias get <alias> - show command for an alias
    • mise shell-alias set <alias> <command> - add/update a shell alias
    • mise shell-alias unset <alias> - remove a shell alias
  • Fixes shell-alias tab completions to use correct generator (runs mise shell-alias ls instead of mise alias ls)

This ensures that when users run mise alias set node lts 20.0.0, the config is written to [tool_alias.node.versions] instead of [alias.node], aligning with the deprecation guidance.

Test plan

  • Unit tests pass
  • Lint passes
  • Manual test: mise tool-alias set node lts 20.0.0 writes to [tool_alias] section
  • Manual test: mise alias set node lts 20.0.0 still works (backwards compat)
  • Manual test: mise shell-alias set ll "ls -la" creates shell alias
  • Manual test: Tab completion for shell-alias commands suggests shell aliases

🤖 Generated with Claude Code


Note

Renames alias to tool-alias, adds shell-alias management, and updates config/docs/completions to use [tool_alias] and [shell_alias].

  • CLI:
    • Rename mise aliasmise tool-alias (keeps alias/aliases as hidden aliases).
    • New mise shell-alias command with ls/get/set/unset subcommands.
  • Config:
    • Write tool version aliases to [tool_alias] (instead of deprecated [alias]).
    • Removal functions check and clean both [tool_alias] and [alias].
    • Add shell alias setters/removers for [shell_alias].
  • Code Refactor:
    • Move alias module → tool_alias; rename Alias*ToolAlias*; wire into Commands.
  • Docs/Manpages/Usage:
    • Update docs, mise.usage.kdl, and man to reflect tool-alias and new shell-alias pages.
    • Remove old docs/cli/alias* pages; add docs/cli/tool-alias* and docs/cli/shell-alias*.
  • Completions & Generators:
    • Fig generators: add shellAliasGenerator, switch to tool-alias, auto-add debounce, and fix shell-alias completions.
    • VitePress cli_commands.ts updated with tool-alias and shell-alias.

Written by Cursor Bugbot for commit d964353. This will update automatically on new commits. Configure here.

…alias]` config

- Rename CLI command from `alias` to `tool-alias` (keeping `alias` as hidden alias for backwards compatibility)
- Change `set_alias` and `set_backend_alias` to write to `[tool_alias]` section instead of deprecated `[alias]`
- Update `remove_alias` and `remove_backend_alias` to check both sections for backwards compatibility
- Update tests to use `[tool_alias]` section

This fixes the confusing situation where the deprecation warning for `[alias]` in config files told users to use `[tool_alias]`, but the CLI command `mise alias` was writing to the deprecated `[alias]` section.

Fixes #7353

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 17, 2025 16:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the mise alias command to mise tool-alias and updates the configuration storage to use the [tool_alias] section instead of the deprecated [alias] section. The changes maintain backwards compatibility by keeping alias and aliases as hidden aliases for the command.

Key changes:

  • Command renamed from alias to tool-alias with backwards-compatible hidden aliases
  • Configuration writes now target [tool_alias] instead of [alias]
  • Removal operations check both [tool_alias] and [alias] sections for comprehensive cleanup

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/cli/mod.rs Updates command enum and match arm from Alias to ToolAlias
src/cli/alias/mod.rs Renames command to tool-alias and adds backwards-compatible aliases
src/config/config_file/mise_toml.rs Updates config operations to use [tool_alias] section and handles both sections during removal

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/cli/alias/mod.rs
Comment on lines +15 to 16
alias = "alias",
alias = "aliases"
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backwards-compatible aliases should be marked as hidden to discourage their use in favor of the new tool-alias command name. Add hide = true to these alias attributes or use hidden_alias instead of alias.

Suggested change
alias = "alias",
alias = "aliases"
hidden_alias = "alias",
hidden_alias = "aliases"

Copilot uses AI. Check for mistakes.
@jdx jdx changed the title fix(cli): rename alias command to tool-alias and write to [tool_alias] config fix(alias): rename alias command to tool-alias and write to [tool_alias] config Dec 17, 2025
Comment thread src/cli/tool_alias/mod.rs
visible_alias = "a",
name = "tool-alias",
about = "Manage tool version aliases.",
alias = "alias",
alias = "aliases"
)]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Short alias a removed without backward compatibility

The original command had visible_alias = "a", allowing users to run mise a as a shortcut for the alias command. This was removed during the rename to tool-alias. While the PR explicitly aims to maintain backward compatibility by keeping alias and aliases as hidden aliases, the removal of the a shortcut is an undocumented breaking change that may affect existing workflows and scripts relying on mise a.

Fix in Cursor Fix in Web

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Shallow merge loses old aliases when adding new ones

When a user has existing aliases in the deprecated [alias] section and adds a new alias via set_alias, the existing aliases for that tool are lost when querying via aliases(). The set_alias function now writes to self.tool_alias instead of self.alias, but the aliases() merge logic at line 669 uses combined.insert(k, v) which replaces the entire Alias entry rather than merging the versions maps. This means if self.alias["node"] has version "16" and self.tool_alias["node"] has version "18", only "18" is returned—the "16" alias silently disappears.

src/config/config_file/mise_toml.rs#L219-L242

pub fn set_alias(&mut self, fa: &BackendArg, from: &str, to: &str) -> eyre::Result<()> {
self.tool_alias
.entry(fa.short.to_string())
.or_default()
.versions
.insert(from.into(), to.into());
self.doc_mut()?
.get_mut()
.unwrap()
.entry("tool_alias")
.or_insert_with(table)
.as_table_like_mut()
.unwrap()
.entry(&fa.to_string())
.or_insert_with(table)
.as_table_like_mut()
.unwrap()
.entry("versions")
.or_insert_with(table)
.as_table_like_mut()
.unwrap()
.insert(from, value(to));
Ok(())

Fix in Cursor Fix in Web


autofix-ci Bot and others added 2 commits December 17, 2025 16:45
- Rename alias directory/module to tool_alias
- Rename Alias* structs to ToolAlias*
- Add shell-alias command for managing shell aliases
- Add set_shell_alias/remove_shell_alias methods to MiseToml
- Update examples to use new command names
@jdx jdx changed the title fix(alias): rename alias command to tool-alias and write to [tool_alias] config feat(cli): rename alias to tool-alias, add shell-alias command Dec 17, 2025
@jdx jdx changed the title feat(cli): rename alias to tool-alias, add shell-alias command feat(alias): rename alias to tool-alias, add shell-alias command Dec 17, 2025
@jdx
Copy link
Copy Markdown
Owner Author

jdx commented Dec 17, 2025

bugbot run

Comment thread xtasks/fig/src/mise.ts Outdated
- Add shellAliasGenerator that runs 'mise shell-alias ls'
- Rename shell-alias args from 'alias' to 'shell_alias' to avoid conflicting with tool alias generator
- Update addCustomGenerators to add generators for matching arg names that don't have them
- Regenerate completions with correct shell alias completions
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 17, 2025

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 x -- echo 20.6 ± 0.5 19.5 24.1 1.00
mise x -- echo 21.0 ± 0.9 19.8 29.5 1.02 ± 0.05

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 env 19.7 ± 0.4 18.9 22.3 1.00
mise env 20.3 ± 0.5 19.3 22.1 1.03 ± 0.03

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 hook-env 19.8 ± 0.4 19.0 23.1 1.00
mise hook-env 20.4 ± 0.4 19.4 21.7 1.03 ± 0.03

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 ls 17.5 ± 0.4 16.6 20.0 1.00
mise ls 17.9 ± 0.4 16.9 19.3 1.02 ± 0.03

xtasks/test/perf

Command mise-2025.12.10 mise Variance
install (cached) 112ms 111ms +0%
ls (cached) 68ms 68ms +0%
bin-paths (cached) 74ms 75ms -1%
task-ls (cached) 282ms ⚠️ 2263ms -87%

⚠️ Warning: task-ls cached performance variance is -87%

@jdx
Copy link
Copy Markdown
Owner Author

jdx commented Dec 17, 2025

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


@jdx jdx enabled auto-merge (squash) December 17, 2025 17:50
@jdx jdx merged commit d6c5b0c into main Dec 17, 2025
29 checks passed
@jdx jdx deleted the fix/alias-deprecation-message branch December 17, 2025 17:55
jdx pushed a commit that referenced this pull request Dec 18, 2025
### 🚀 Features

- **(alias)** rename alias to tool-alias, add shell-alias command by
@jdx in [#7357](#7357)
- **(upgrade)** display summary of upgraded tools by @jdx in
[#7372](#7372)
- **(vfox)** embed vfox plugin Lua code in binary by @jdx in
[#7369](#7369)

### 🐛 Bug Fixes

- **(aqua)** add start_operations for progress reporting by @jdx in
[#7354](#7354)
- **(github)** improve asset detection for distro-specific and Swift
artifacts by @jdx in [#7347](#7347)
- **(github)** clean up static_helpers.rs and fix archive bin= option by
@jdx in [#7366](#7366)
- **(http)** add start_operations for progress reporting by @jdx in
[#7355](#7355)
- **(lockfile)** place lockfile alongside config file by @jdx in
[#7360](#7360)
- **(progress)** add start_operations to core plugins by @jdx in
[#7351](#7351)
- **(ruby-install)** Use ruby_install_bin to update by @calebhearth in
[#7350](#7350)
- **(rust)** add release_url for rust versions by @jdx in
[#7373](#7373)
- **(schema)** add `tool_alias`, mark `alias` as deprecated by @SKalt in
[#7358](#7358)
- **(toolset)** filter tools by OS in list_current_versions by @jdx in
[#7356](#7356)
- **(ubi)** only show deprecation warning during installation by @jdx in
[#7380](#7380)
- **(ui)** remove noisy "record size" message during install by @jdx in
[#7381](#7381)
- update mise-versions URL to use /tools/ prefix by @jdx in
[#7378](#7378)

### 🚜 Refactor

- **(backend)** unified AssetMatcher with checksum fetching by @jdx in
[#7370](#7370)
- **(backend)** deprecate ubi backend in favor of github by @jdx in
[#7374](#7374)
- **(toolset)** decompose mod.rs into smaller modules by @jdx in
[#7371](#7371)

### 🧪 Testing

- **(e2e)** fix and rename ubi and vfox_embedded_override tests by @jdx
in
[052ea40](052ea40)

### 📦 Registry

- add vfox-gcloud backend for gcloud by @jdx in
[#7349](#7349)
- convert amplify to use github backend by @jdx in
[#7365](#7365)
- add github backend for djinni tool by @jdx in
[#7363](#7363)
- switch glab to native gitlab backend by @jdx in
[#7364](#7364)
- add s5cmd by @jdx in [#7376](#7376)

### Chore

- **(registry)** disable flaky tests for gitu and ktlint by @jdx in
[64151cb](64151cb)
- resolve clippy warnings and add stricter CI check by @jdx in
[#7367](#7367)
- suppress dead_code warnings in asset_matcher module by @jdx in
[#7377](#7377)

### New Contributors

- @calebhearth made their first contribution in
[#7350](#7350)
jekis913 added a commit to jekis913/mise that referenced this pull request Dec 18, 2025
* upstream/main:
  fix(lockfile): place lockfile alongside config file (jdx#7360)
  feat(alias): rename alias to tool-alias, add shell-alias command (jdx#7357)
  fix(aqua): add start_operations for progress reporting (jdx#7354)
  fix(schema): add `tool_alias`, mark `alias` as deprecated (jdx#7358)
  fix(progress): add start_operations to core plugins (jdx#7351)
  fix(toolset): filter tools by OS in list_current_versions (jdx#7356)
  registry: add vfox-gcloud backend for gcloud (jdx#7349)
  fix(github): improve asset detection for distro-specific and Swift artifacts (jdx#7347)
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.

2 participants