Skip to content

[Feature]: alias | Alias a version to a common name #359

Closed

Description

@yaragos

1. Your usage scenarios?

Switch SDK versions faster, similar to fnm

fnm alias [OPTIONS] <TO_VERSION> <NAME>

2. What is your expected outcome?

# 用大版本号替代具体版本号
vfox alias [email protected] node22
# 设置默认使用版本
vfox alias [email protected] default-node

Switching nodejs version :

vfox use node22
vfox use -g defautl-node

Activity

  1. added
    enhancement
    on Sep 27, 2024
  2. linghengqian commented on Oct 22, 2026

    @linghengqian
    Member
  3. self-assigned this
    on Oct 22, 2026
  4. linghengqian commented on Oct 23, 2026

    @linghengqian
    Member

    Aliases are available on main since #736 (merged, not released yet):

    $ vfox alias set nodejs node22 22.9.0
    $ vfox use nodejs@node22              # selects 22.9.0
    $ vfox use -g nodejs@node22
    $ vfox alias list
    nodejs@node22 -> [email protected]
    $ vfox alias unset nodejs node22

    How it differs from the fnm form in the description:

    • The alias is used as nodejs@node22, so the SDK name is still required: vfox use node22 is not supported.
    • An alias is resolved for what you type on the command line (use, uninstall, info, exec, doctor) and is never written to .vfox.toml, so version files stay valid for people who do not have the alias. vfox use -p nodejs@node22 writes 22.9.0.
    • An installed version with the same name always wins over an alias, and vfox list shows the aliases next to their versions.
    • An alias names one specific installed version. There is no moving default alias; vfox use -g already sets the global version.

    See vfox alias. It will be in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions