一度信頼した設定ファイルの信頼を取り消したい

【mise】mise trustで設定ファイルを信頼する で紹介したmise trustは、[env][tasks]を含むmise.tomlを明示的に信頼するコマンドである。信頼済みの設定ファイルを未信頼の状態に戻したい場合はmise untrustを使う。

mise untrustの基本

信頼済みのディレクトリでmise untrustを実行すると、カレントディレクトリのmise.tomlの信頼が解除される。

$ mise untrust
mise untrusted /path/to/project

信頼を解除した後は、mise.toml[env][tasks]が含まれていると、再びmise envなどが未信頼エラーになる。

$ mise env
mise ERROR error parsing config file: /path/to/project/mise.toml
mise ERROR Config files in /path/to/project/mise.toml are not trusted.

信頼状況はmise trust --showで確認できる。

$ mise trust --show
/path/to/project: untrusted

mise trust –untrustと同じ機能

mise untrustは独立したコマンドだが、実はmise trust --untrustと全く同じ機能である。mise trust --helpにも--untrust(Remove explicit trust for this config)というフラグが用意されており、mise untrustはこのフラグを省略できる短縮形にあたる。

$ mise trust --untrust
mise untrusted /path/to/project

どちらのコマンドを使っても結果は同じなので、覚えやすい方を使えばよい。

引数でファイルパスを指定する

引数に設定ファイルのパスを渡すと、カレントディレクトリ以外のmise.tomlの信頼も解除できる。

$ mise untrust ./other-project/mise.toml
mise untrusted /path/to/other-project

別のディレクトリへ移動せずに、任意のプロジェクトの信頼を取り消したい場合に使える。