Skip to content

feat(config): accept --file on mise unuse and --path on mise unset - #11616

Merged
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:feat/config-target-aliases-inverse
Aug 2, 2026
Merged

feat(config): accept --file on mise unuse and --path on mise unset#11616
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:feat/config-target-aliases-inverse

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #11577, which left the pair half-finished:

mise use --file works (#11577)
mise unuse --file does not
mise set --path works (#11577)
mise unset --path does not

So the command that adds a tool takes both spellings and the command that removes it does not. This adds --file as a visible alias for mise unuse --path, and --path for mise unset --file — the same one-line change #11577 made, applied to the two inverse commands.

The alias is accurate, not just a spelling: both commands accept a directory as well as a file. unset resolves through resolve_target_config_path, which has a path.is_dir() branch, and unuse calls config::config_file_in_dir when the argument is a directory.

Background

#4881 asks for --file/--path as synonyms on the config-target commands. #11116 implemented it across eleven commands and was closed the next day. #11577 narrowed it to the two the discussion actually names, and that merged — so I am walking the rest in small steps rather than re-proposing the wide change.

Remaining after this one: config get, config set, dotfiles add, and the four bootstrap packages commands (use, import, brew tap, brew untap).

Generated files

mise.usage.kdl and man/man1/mise.1 carry the four expected lines. They were written by hand from the shape #11577's merged output already has in-tree (mise set at man:3295, mise use at man:4468), so mise run render should be a no-op — the lint job will say so either way.

Tests

e2e/cli/test_config_target_aliases — the file #11577 added — gains the inverse half: unuse --file and unset --path remove what use --file and set --path wrote, and the canonical spellings still work afterwards.

Summary by CodeRabbit

  • New Features

    • Added --path as an alternative to --file for mise unset.
    • Added --file as an alternative to --path for mise unuse.
    • Existing option names remain supported.
    • File options now accept file or directory paths; directory targets use or create mise.toml.
  • Documentation

    • Clarified file and directory path handling.
  • Tests

    • Added end-to-end coverage for canonical options, aliases, and directory paths.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 33d1584f-4338-4c78-9f02-120dd1e81eb9

📥 Commits

Reviewing files that changed from the base of the PR and between 9a4769b and 4e43e26.

📒 Files selected for processing (6)
  • docs/cli/unset.md
  • e2e/cli/test_config_target_aliases
  • man/man1/mise.1
  • mise.usage.kdl
  • src/cli/unset.rs
  • src/cli/unuse.rs
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/cli/unset.md
  • src/cli/unset.rs
  • mise.usage.kdl
  • src/cli/unuse.rs
  • man/man1/mise.1
  • e2e/cli/test_config_target_aliases

📝 Walkthrough

Walkthrough

mise unset now accepts --path as an alias for --file. mise unuse now accepts --file as an alias for --path. Documentation and end-to-end tests cover file and directory config targets.

Changes

CLI option aliases

Layer / File(s) Summary
Add reciprocal aliases
src/cli/unset.rs, src/cli/unuse.rs, mise.usage.kdl, man/man1/mise.1, docs/cli/unset.md
The commands expose reciprocal aliases. Documentation describes file and directory handling for mise unset.
Validate alias behavior
e2e/cli/test_config_target_aliases
End-to-end tests verify canonical and alias options for file and directory config targets.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • jdx/mise#11116: Modifies the same commands and end-to-end coverage for related option aliases.
  • jdx/mise#11575: Fixes directory resolution for mise unuse.
  • jdx/mise#11577: Adds cross-compatible aliases for other config-targeting commands.

Suggested reviewers: greptile-apps

Poem

A rabbit checks each flag,
--file and --path align.
unset and unuse parse,
Directory tests confirm the path.
Hop, hop—config stays in line.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes both inverse CLI option aliases added by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JamBalaya56562
JamBalaya56562 marked this pull request as ready for review August 2, 2026 01:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
e2e/cli/test_config_target_aliases (1)

26-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for directory targets.

These tests exercise the new aliases with alias.toml, which is a file. The PR objective also promises file and directory targets. Add at least one directory-target case for unuse --file and unset --path, or point to existing end-to-end coverage for those paths.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/cli/test_config_target_aliases` around lines 26 - 42, Extend the config
target alias coverage to include directory targets, not only the file target
alias.toml. Add at least one end-to-end case exercising unuse --file and one
exercising unset --path against a directory target, verifying the corresponding
entry is removed while preserving the existing file-target and canonical-name
checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@man/man1/mise.1`:
- Around line 4288-4291: Update the source help text for the mise unset
--file/--path option to use <PATH> instead of <FILE> and document how file and
directory targets are resolved. Preserve the existing default and global-config
path details, then regenerate the generated man page so man/man1/mise.1 reflects
the source help.

---

Nitpick comments:
In `@e2e/cli/test_config_target_aliases`:
- Around line 26-42: Extend the config target alias coverage to include
directory targets, not only the file target alias.toml. Add at least one
end-to-end case exercising unuse --file and one exercising unset --path against
a directory target, verifying the corresponding entry is removed while
preserving the existing file-target and canonical-name checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: fc734979-458f-44f5-8153-7d3d15178765

📥 Commits

Reviewing files that changed from the base of the PR and between a8f6643 and f1da22b.

📒 Files selected for processing (5)
  • e2e/cli/test_config_target_aliases
  • man/man1/mise.1
  • mise.usage.kdl
  • src/cli/unset.rs
  • src/cli/unuse.rs

Comment thread man/man1/mise.1
Comment on lines +4288 to 4291
\fB\-f, \-\-file, \-\-path\fR \fI<FILE>\fR
Specify a file to use instead of `mise.toml`

Defaults to [`MISE_DEFAULT_CONFIG_FILENAME`](https://mise.jdx.dev/configuration.html#mise_default_config_filename) environment variable, or `mise.toml`. Use [`MISE_GLOBAL_CONFIG_FILE`](https://mise.jdx.dev/configuration.html#mise_global_config_file) to choose a different global config path.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Document directory targets for mise unset.

The option is rendered as <FILE> and says “Specify a file”, but mise unset accepts files and directories. Update the source help text to use <PATH> and describe directory resolution, then regenerate man/man1/mise.1.

Suggested wording
-\fB\-f, \-\-file, \-\-path\fR \fI<FILE>\fR
-Specify a file to use instead of `mise.toml`
+\fB\-f, \-\-file, \-\-path\fR \fI<PATH>\fR
+Specify a config file or directory to use instead of `mise.toml`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
\fB\-f, \-\-file, \-\-path\fR \fI<FILE>\fR
Specify a file to use instead of `mise.toml`
Defaults to [`MISE_DEFAULT_CONFIG_FILENAME`](https://mise.jdx.dev/configuration.html#mise_default_config_filename) environment variable, or `mise.toml`. Use [`MISE_GLOBAL_CONFIG_FILE`](https://mise.jdx.dev/configuration.html#mise_global_config_file) to choose a different global config path.
\fB\-f, \-\-file, \-\-path\fR \fI<PATH>\fR
Specify a config file or directory to use instead of `mise.toml`
Defaults to [`MISE_DEFAULT_CONFIG_FILENAME`](https://mise.jdx.dev/configuration.html#mise_default_config_filename) environment variable, or `mise.toml`. Use [`MISE_GLOBAL_CONFIG_FILE`](https://mise.jdx.dev/configuration.html#mise_global_config_file) to choose a different global config path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@man/man1/mise.1` around lines 4288 - 4291, Update the source help text for
the mise unset --file/--path option to use <PATH> instead of <FILE> and document
how file and directory targets are resolved. Preserve the existing default and
global-config path details, then regenerate the generated man page so
man/man1/mise.1 reflects the source help.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the inverse config-target commands accept the same synonymous option names as their counterparts.

  • Adds --path as a visible alias for mise unset --file.
  • Adds --file as a visible alias for mise unuse --path.
  • Updates generated usage, manual-page, and CLI documentation.
  • Extends end-to-end coverage across aliases, canonical spellings, and directory targets.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cli/unset.rs Adds the established Clap visible-alias mapping from --path to the existing file argument while preserving target-resolution behavior.
src/cli/unuse.rs Adds the established Clap visible-alias mapping from --file to the existing path argument without changing removal behavior.
e2e/cli/test_config_target_aliases Covers both new inverse-command aliases, canonical spellings, and file-or-directory config targets.
mise.usage.kdl Updates the generated CLI usage specification to expose the new aliases and clarify directory handling.
docs/cli/unset.md Clarifies that the unset target may be either a file or directory.
man/man1/mise.1 Updates the manual entries for both commands to advertise the synonymous long options.

Reviews (4): Last reviewed commit: "feat(config): accept --file on `mise unu..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 2, 2026
@JamBalaya56562
JamBalaya56562 force-pushed the feat/config-target-aliases-inverse branch from f1da22b to 8411bc5 Compare August 2, 2026 01:53
@greptile-apps
greptile-apps Bot dismissed their stale review August 2, 2026 01:53

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@JamBalaya56562

Copy link
Copy Markdown
Contributor Author

Both addressed, thanks — the first one was a real gap.

mise unset not documenting directory targets. Correct, and it is the only one of the four that did not: use --path and unuse --path both say "Specify a path to a config file or directory", and set --file says "Can be a file path or directory…". unset --file said only "Specify a file", while resolving through the same resolve_target_config_path with its path.is_dir() branch. Advertising --path as a spelling for it made that worse, so it is fixed here.

Fixed at the source (src/cli/unset.rs doc comment) rather than in man/man1/mise.1 — that file is generated, so editing it directly would be reverted by the next mise run render. mise.usage.kdl, man/man1/mise.1 and docs/cli/unset.md are updated to match; the lint job's render check will confirm.

I did not rename the placeholder from <FILE> to <PATH>. mise set --file — the counterpart this PR is pairing with, merged in #11577 — renders <FILE> and documents directory support in prose, so matching that keeps the two halves consistent. Renaming only unset's would make it the odd one out again, in the other direction.

Directory coverage in the e2e. Added: the test now exercises a directory target through all four commands under the aliased names, which is also what makes the new help text checkable rather than just asserted —

mise use --file subdir dummy@1
mise set --path subdir SUBDIR_VAR=via-dir
mise unuse --no-prune --file subdir dummy@1
mise unset --path subdir SUBDIR_VAR

@JamBalaya56562
JamBalaya56562 force-pushed the feat/config-target-aliases-inverse branch from 8411bc5 to 9a4769b Compare August 2, 2026 02:00
@JamBalaya56562
JamBalaya56562 force-pushed the feat/config-target-aliases-inverse branch from 9a4769b to 4e43e26 Compare August 2, 2026 02:38
@jdx
jdx merged commit a8182ba into jdx:main Aug 2, 2026
30 checks passed
@JamBalaya56562
JamBalaya56562 deleted the feat/config-target-aliases-inverse branch August 2, 2026 03:21
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