跳转到内容

mise config set

在 mise.toml 文件中设置某个配置项的值。

参数

  • <KEY> — 要显示的配置路径
  • [VALUE] — 要为键设置的值(如果以 KEY=VALUE 的形式提供,则可选)

选项

  • -f --file <FILE> — 要编辑的 mise.toml 文件路径

    可以是文件路径或目录。如果提供的是目录,则使用该目录中的配置文件。

    如果未提供,则使用最近的 mise.toml 文件

    别名: --path

  • -g --global — 编辑全局配置文件。

  • --system — 编辑系统配置文件。

  • --append — 追加值,不重复已有条目。

  • --remove — 从现有集合中移除值。

  • -t --type <TYPE>

    可选值: inferstringintegerfloatboollistset

    默认值: infer

  • -h --help — 打印帮助

示例:

$ mise config set tools.python 3.12
$ mise config set settings.always_keep_download true
$ mise config set env.TEST_ENV_VAR ABC
$ mise config set settings.disable_tools node,rust
$ mise config set --append env._.path ~/.local/bin
$ mise config set --remove env._.path ~/.local/bin

# `settings` 的类型是推断出来的
$ mise config set settings.jobs 4