Skip to content

feat(config): accept --file wherever --path names a config to write - #11631

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

feat(config): accept --file wherever --path names a config to write#11631
jdx merged 1 commit into
jdx:mainfrom
JamBalaya56562:feat/config-target-aliases-write-path

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Third step of #4881, after #11577 (use/set) and #11616 (unuse/unset).

Five commands name a config file to write to under --path, and they all declare it identically:

/// Write to this config file or directory
#[clap(long, short, value_name = "PATH", conflicts_with_all = [...])]
path: Option<PathBuf>,
  • mise dotfiles add
  • mise bootstrap packages use
  • mise bootstrap packages import
  • mise bootstrap packages brew tap
  • mise bootstrap packages brew untap

Each gains --file as a visible alias. It reads as five commands but it is one change repeated five times — splitting it further would be noise rather than caution. The alias is accurate rather than cosmetic: the help already says "config file or directory", and all five resolve through resolve_target_config_path, the same function behind mise use --path.

Generated files

The counts differ on purpose. mise.usage.kdl gets six lines and man/man1/mise.1 gets five, because dotfiles add is mounted twice — as mise dotfiles add and mise bootstrap dotfiles add — and the kdl carries both mounts while the man page only has a MISE BOOTSTRAP DOTFILES ADD section. docs/cli/*.md is unchanged; the markdown generator does not render flag aliases.

Tests

Two layers, because these commands are not equally cheap to run.

src/cli/mod.rs gains a clap assertion covering all nine commands done so far. bootstrap packages use/import install things and dotfiles add applies them, so asserting through the parser is the only way to cover them uniformly — and it runs on Windows, where the bash e2e does not. The brew entries are guarded with cfg!(not(windows)) since that manager is not registered there.

e2e/cli/test_config_target_aliases gains brew tap/untap under both spellings. Those two only edit [bootstrap.brew.taps] — they do not touch a Homebrew installation, and default_tap_url formats the URL rather than fetching it — so they are the one pair here that can be exercised end to end for free.

Remaining

Only mise config get and mise config set after this. They are deliberately left out: both take -f --file and, unlike everything above, accept a file only — the value goes straight to read_to_string/MiseToml::from_file with no directory branch. Adding --path there needs that difference stated rather than glossed over, so it belongs in its own change.

Summary by CodeRabbit

  • New Features

    • Added --file as an alias for --path across bootstrap configuration commands, including dotfiles, package imports, package use, and Homebrew tap/untap operations.
    • The alias is also available for the deprecated dotfiles command.
    • Existing --path and short-option usage remains supported.
  • Tests

    • Added coverage confirming both option names target the specified configuration file correctly across supported commands.

@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: 1016fa24-7515-4bd0-ad08-9f077bded45c

📥 Commits

Reviewing files that changed from the base of the PR and between 8d0e004 and ad8b13d.

📒 Files selected for processing (9)
  • e2e/cli/test_config_target_aliases
  • man/man1/mise.1
  • mise.usage.kdl
  • src/cli/dotfiles/add.rs
  • src/cli/mod.rs
  • src/cli/system/brew/tap.rs
  • src/cli/system/brew/untap.rs
  • src/cli/system/import.rs
  • src/cli/system/use.rs
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/cli/dotfiles/add.rs
  • src/cli/system/use.rs
  • src/cli/mod.rs
  • src/cli/system/brew/untap.rs
  • e2e/cli/test_config_target_aliases
  • src/cli/system/brew/tap.rs
  • mise.usage.kdl
  • src/cli/system/import.rs
  • man/man1/mise.1

📝 Walkthrough

Walkthrough

Added --file as a visible alias for --path across dotfile and bootstrap package commands. Updated CLI declarations, generated documentation, Clap coverage, and Brew tap and untap end-to-end tests.

Changes

Config target aliases

Layer / File(s) Summary
CLI alias declarations and coverage
src/cli/dotfiles/add.rs, src/cli/system/..., src/cli/mod.rs
The affected commands expose --file alongside --path. Clap tests verify the aliases, including platform-gated Homebrew commands.
Documentation and end-to-end validation
mise.usage.kdl, man/man1/mise.1, e2e/cli/test_config_target_aliases
Usage documentation lists the aliases. Brew tap and untap tests verify both option names target the specified config file.

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

Possibly related PRs

  • jdx/mise#11116: Both changes update CLI option declarations and tests for configuration-target aliases.
  • jdx/mise#11577: Both changes add --file and --path aliases with documentation and tests.
  • jdx/mise#11616: Both changes update related aliases, CLI tests, generated documentation, and end-to-end tests.

Suggested reviewers: greptile-apps

Poem

A rabbit adds a flag today,
--file joins --path on the way.
Brew taps write and clear,
Clap tests make it clear,
Config targets now obey.

🚥 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 the main change: adding --file as an alias for --path on config-writing commands.
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.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds --file as a visible alias for config-targeting --path options across dotfiles and bootstrap package commands.

  • Updates five Clap argument declarations while preserving existing conflict behavior.
  • Regenerates usage and man-page metadata to expose the aliases.
  • Adds parser-level coverage for all related commands and end-to-end coverage for Homebrew tap configuration.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/cli/mod.rs Adds cross-platform parser assertions that all nine config-targeting commands expose both supported option names.
src/cli/dotfiles/add.rs Adds --file as a visible alias for the existing config-targeting --path argument.
src/cli/system/use.rs Adds the alias without changing target resolution or the existing global-option conflict.
src/cli/system/import.rs Adds the alias without changing import execution or config-path handling.
src/cli/system/brew/tap.rs Exposes --file for the existing tap configuration target while retaining the local-option conflict.
src/cli/system/brew/untap.rs Exposes --file for the existing untap configuration target while retaining the local-option conflict.
e2e/cli/test_config_target_aliases Verifies both spellings write to and remove entries from the requested Homebrew tap config file.
mise.usage.kdl Updates generated usage declarations for all command mounts, including both dotfiles mounts.
man/man1/mise.1 Documents the new visible alias in each affected command section.

Reviews (2): Last reviewed commit: "feat(config): accept --file wherever `--..." | 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-write-path branch from 8d0e004 to ad8b13d Compare August 2, 2026 04:18
@greptile-apps
greptile-apps Bot dismissed their stale review August 2, 2026 04:18

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

@jdx
jdx merged commit e6543b1 into jdx:main Aug 2, 2026
29 checks passed
@JamBalaya56562
JamBalaya56562 deleted the feat/config-target-aliases-write-path branch August 2, 2026 13:15
donbeave pushed a commit to donbeave/mise that referenced this pull request Aug 3, 2026
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