Skip to content

feat(bootstrap): add dotfiles workflow#10376

Merged
jdx merged 2 commits into
mainfrom
codex/dotfiles-command
Jun 13, 2026
Merged

feat(bootstrap): add dotfiles workflow#10376
jdx merged 2 commits into
mainfrom
codex/dotfiles-command

Conversation

@jdx

@jdx jdx commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add the experimental mise dotfiles workflow with add, apply, edit, and status around a flat [dotfiles] table.
  • Add dotfiles.root and dotfiles.default_mode, with symlink as the default mode and implied source paths under the dotfiles root.
  • Move experimental bootstrap config to [bootstrap.packages], [bootstrap.macos.defaults], and [bootstrap.user]; remove the public mise system command surface.
  • Update mise bootstrap to converge packages, dotfiles, macOS defaults, user login shell, tools, and the optional bootstrap task in order.
  • Update OCI dotfiles/package layering, generated CLI/man/schema output, docs, sidebar structure, and e2e coverage.

Notable behavior

  • No backwards compatibility is kept for unreleased experimental [system.*], mise system *, or mise dotfiles install shapes.
  • mise bootstrap packages install is package-only; dotfiles and login shell are applied by mise bootstrap or their narrower bootstrap/dotfiles commands.
  • Whole-file dotfiles and inline edit entries share [dotfiles], with source-only tables treated as whole-file entries.

Validation

  • mise run lint
  • mise run docs:build
  • mise run test:e2e e2e/cli/test_dotfiles_files e2e/cli/test_dotfiles_edits e2e/cli/test_bootstrap

This PR was prepared by an AI coding assistant.

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR introduces experimental mise dotfiles commands (add, apply, edit, status), adds a top-level [dotfiles] config schema and settings, migrates whole-file and edit handling from [system.files]/[system.edits] to [dotfiles], narrows mise system to packages and macOS defaults, updates OCI layering, docs, man pages, completion, and e2e tests.

Changes

Dotfiles Feature and System Scope Refactor

Layer / File(s) Summary
Dotfiles config schema and trait wiring
src/config/config_file/mod.rs, src/config/config_file/mise_toml.rs, src/system/mod.rs, schema/mise.json, settings.toml
Adds DotfilesTomlConfig, ConfigFile::dotfiles_config() accessor, optional MiseToml.dotfiles field, and JSON/schema/settings for dotfiles (default_mode, root).
Whole-file dotfiles backend (files.rs)
src/system/files.rs
Refactors whole-file parsing to read [dotfiles], supports implied sources via dotfiles.root, default mode resolution, glob expansion, switches user-facing prefixes to [dotfiles], adds ApplyOpts.verbose and print_diff for verbose dry-run diffs.
Edit dotfiles backend (edits.rs)
src/system/edits.rs
Parses edits from [dotfiles] keyed by (path,id), records declaring config_path on EditRequest, updates messages to [dotfiles] context, and adds ApplyOpts.verbose with dry-run desired-state printing for non-conditional edits.
CLI module and command dispatch
src/cli/mod.rs, src/cli/dotfiles/mod.rs
Adds dotfiles module and Commands::Dotfiles variant; implements Dotfiles clap args with subcommands and editor helpers (open_in_editor, split_editor_command).
Dotfiles add command
src/cli/dotfiles/add.rs
Implements dotfiles add: validates flags, resolves per-target source/mode, plans additions, prints --dry-run TOML, and writes/creates managed sources and [dotfiles] entries.
Dotfiles apply command
src/cli/dotfiles/apply.rs
Implements dotfiles apply: filters files/edits by targets, enforces experimental gate, errors on unmatched filters when config exists, invokes backend apply handlers with dry_run/verbose/force/yes.
Dotfiles edit command
src/cli/dotfiles/edit.rs
Implements dotfiles edit: resolves managed source for a target, opens it in editor, optionally adds unmanaged targets via dotfiles add, and applies changes after editing.
Dotfiles status command
src/cli/dotfiles/status.rs
Implements dotfiles status: checks configured files and edits, supports --json and --missing (exit code 1 when any configured entry is not applied), and prints human tables or JSON.
System install/status narrowing and bootstrap integration
src/cli/system/install.rs, src/cli/system/status.rs, src/cli/system/mod.rs, src/cli/bootstrap.rs
Removes [system.files]/[system.edits] handling from system install/status, drops --force from system install, updates bootstrap to call mise dotfiles apply, and sets apply options verbose: false in bootstrap paths.
Usage spec, man, docs, and completion
mise.usage.kdl, man/man1/mise.1, docs/cli/*, docs/system-*.md, docs/.vitepress/*, xtasks/fig/src/mise.ts, docs/.vitepress/cli_commands.ts
Adds CLI usage KDL entries and man sections for dotfiles subcommands; creates markdown docs for dotfiles commands; renames and updates system-files/edits concept docs to dotfiles terminology; updates VitePress sidebar and completion spec.
OCI builder changes
src/cli/oci/common.rs, src/oci/builder.rs
Replaces system-files OCI layer with a dotfiles layer: Builder field renamed to dotfiles, adds with_dotfiles, writes layer annotation dev.mise.dotfiles=true, and updates layer assembly messages/validation.
E2E test migrations
e2e/cli/test_bootstrap, e2e/cli/test_dotfiles_edits, e2e/cli/test_dotfiles_files, e2e/oci/test_oci_build_slow
Retargets/extends e2e tests to [dotfiles] behavior: fixtures use [dotfiles], tests exercise apply/status/add/edit flows, wildcards, conflicts, idempotency, template exec dry-run behavior, and OCI layer annotation checks.

Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • jdx/mise#10373: Overlaps OCI builder/layer construction changes related to system-files/dotfiles layers.
  • jdx/mise#10374: Related work on files_from_config and glob expansion behavior in the files backend.
  • jdx/mise#10368: Prior edits implementation that this PR migrates from system.edits to the new dotfiles model.

"I nibble lines of TOML neat,
A rabbit's touch on every sheet,
Add, apply, edit, status bright,
Dotfiles hop into the light.
Bootstrap hums — the config's sweet." 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat(bootstrap): add dotfiles workflow' accurately describes a main change in the PR, introducing the dotfiles workflow feature. However, it is narrower in scope than the full changeset, which also significantly restructures configuration by moving file/edit management from [system.files]/[system.edits] to a new [dotfiles] section.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Comment thread src/cli/bootstrap.rs
Comment thread src/system/files.rs Outdated
@greptile-apps

greptile-apps Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extracts dotfile management (whole-file entries and in-file edits) out of mise system into a dedicated mise dotfiles command group (add, apply, edit, status) and moves the config surface from [system.files]/[system.edits] to a flat [dotfiles] table, while renaming the remaining machine-setup surface from [system.*] to [bootstrap.*].

  • [dotfiles] now uses a unified flat key format — whole-file entries and edit entries share one table, distinguished at parse time by key shape and value content.
  • mise bootstrap gains optional subcommands (packages, macos-defaults, user) that were previously spread across mise system install/status; the bootstrap sequence is updated to call mise dotfiles apply as step 2.
  • Docs, CLI usage, man page, JSON schema, and e2e tests are regenerated and rewritten to match the new surface.

Confidence Score: 4/5

Safe to merge after addressing the silent --source discard in dotfiles add; the rest of the restructuring is clean.

The DotfilesAdd command silently discards a user-supplied --source flag when the target is already managed — the file copy goes to the old configured path with no diagnostic, leaving the config and the new path untouched. Every other aspect of the rename and new command group looks correct and well-tested.

src/cli/dotfiles/add.rs — the already-managed path ignores --source without warning; src/oci/builder.rs — annotation rename may affect existing OCI consumers.

Important Files Changed

Filename Overview
src/cli/dotfiles/add.rs New mise dotfiles add command: --source is silently ignored for already-managed entries (no warning), and inline_entry contains an unreachable branch.
src/system/files.rs Refactored to support flat [dotfiles] table with implied-source semantics; classification heuristics for file vs. edit entries look sound.
src/system/edits.rs Migrated from nested [system.edits] to flat [dotfiles] key format; new edit_entry_from_toml / split_edit_key split logic looks correct.
src/cli/bootstrap.rs Bootstrap now accepts optional subcommands; inlines macos-defaults and user status/apply; outer flags (--dry-run, --yes) are unrelated to subcommand flags.
src/oci/builder.rs Renames system_files field and layer annotation to dotfiles; dev.mise.system.files annotation removed — breaking for OCI consumers that relied on it.
src/config/config_file/mise_toml.rs Splits system config into bootstrap and dotfiles fields; updates update_bootstrap_package and all related parsing/test helpers correctly.

Reviews (9): Last reviewed commit: "feat(dotfiles): add add and edit workflo..." | Re-trigger Greptile

Comment thread src/system/files.rs
Comment thread src/system/files.rs

@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: 3

🧹 Nitpick comments (1)
docs/system-edits.md (1)

106-112: ⚡ Quick win

Inconsistent wording for --missing flag semantics across file/edit docs.

Line 107 in system-edits.md states: exit 1 if anything is missing (CI check), but the equivalent in system-files.md line 87 says: exit 1 if anything is out of sync (CI check). The --missing flag should have consistent semantics for both files and edits — it should exit with code 1 if any entry is not in its desired state (applied), not just the "missing" status specifically.

For clarity and consistency, update line 107 to match the files semantics:

-mise dotfiles status --missing  # exit 1 if anything is missing (CI check)
+mise dotfiles status --missing  # exit 1 if anything is out of sync (CI check)
🤖 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 `@docs/system-edits.md` around lines 106 - 112, Update the wording for the
--missing flag in the "mise dotfiles status --missing" help text in
system-edits.md to match the files docs: change the phrase "exit 1 if anything
is missing (CI check)" to "exit 1 if anything is out of sync (CI check)" so that
the --missing flag semantics consistently mean exiting with code 1 whenever any
entry is not in its desired/applied state; modify the line that documents "mise
dotfiles status --missing" to use this exact wording and ensure it aligns with
the corresponding description in system-files.md.
🤖 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 `@mise.usage.kdl`:
- Around line 289-294: The documentation bullet list is out of sync with the
runtime ordering in src/cli/bootstrap.rs: the dotfiles phase runs before the
macOS defaults phase, so split the single "system" bullet or move the
"[system.defaults]" note so the order reflects actual execution; specifically,
ensure the list shows "mise system install" (macOS packages), then "mise
dotfiles install" (apply dotfiles), then a separate "mise system defaults" or a
moved note for `[system.defaults]`, and update the example summary below to
explicitly mention "mise dotfiles install" along with the other commands
(referencing the commands mise system install, mise dotfiles install, mise
install, mise run bootstrap and the bootstrap handling in src/cli/bootstrap.rs).

In `@src/cli/bootstrap.rs`:
- Around line 13-18: Update the top-of-file step list to match the actual
execution order in run(): move or reword the mention of applying
`[system.defaults]` so it appears after the `[dotfiles]` step (i.e., dotfiles
are applied first, then system defaults are written/applied, then tools
installed, then `run bootstrap`), ensuring the comment block describing steps
1–4 aligns exactly with the behavior implemented in the run() function.

In `@src/system/files.rs`:
- Around line 133-138: file_entry_from_toml currently rejects toml tables unless
they contain a "mode" key, which causes valid whole-file entries like { source =
"..." } to be misrouted; update file_entry_from_toml to explicitly accept tables
that represent whole-file entries (e.g., tables containing a "source" key or
another agreed discriminator) and only treat tables as edit-typed when the
explicit discriminator (e.g., "mode" or "edits") is present; make the
discriminator contract explicit and apply the same logic in the parser in
src/system/edits.rs so both parsers agree, and add regression tests covering
source-only table entries to ensure { source = "..." } is parsed as a
FileTomlEntry with default mode (e.g., symlink) rather than being dropped or
treated as edits.

---

Nitpick comments:
In `@docs/system-edits.md`:
- Around line 106-112: Update the wording for the --missing flag in the "mise
dotfiles status --missing" help text in system-edits.md to match the files docs:
change the phrase "exit 1 if anything is missing (CI check)" to "exit 1 if
anything is out of sync (CI check)" so that the --missing flag semantics
consistently mean exiting with code 1 whenever any entry is not in its
desired/applied state; modify the line that documents "mise dotfiles status
--missing" to use this exact wording and ensure it aligns with the corresponding
description in system-files.md.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a94916bc-8c4b-4ba2-9e96-af0e843b1882

📥 Commits

Reviewing files that changed from the base of the PR and between 797611e and 25c2c19.

📒 Files selected for processing (30)
  • docs/.vitepress/config.ts
  • docs/cli/bootstrap.md
  • docs/cli/dotfiles.md
  • docs/cli/dotfiles/install.md
  • docs/cli/dotfiles/status.md
  • docs/cli/index.md
  • docs/cli/system.md
  • docs/cli/system/install.md
  • docs/cli/system/status.md
  • docs/system-edits.md
  • docs/system-files.md
  • docs/system-packages/index.md
  • docs/tips-and-tricks.md
  • e2e/cli/test_bootstrap
  • e2e/cli/test_dotfiles_edits
  • e2e/cli/test_dotfiles_files
  • mise.usage.kdl
  • src/cli/bootstrap.rs
  • src/cli/dotfiles/install.rs
  • src/cli/dotfiles/mod.rs
  • src/cli/dotfiles/status.rs
  • src/cli/mod.rs
  • src/cli/system/install.rs
  • src/cli/system/mod.rs
  • src/cli/system/status.rs
  • src/config/config_file/mise_toml.rs
  • src/config/config_file/mod.rs
  • src/system/edits.rs
  • src/system/files.rs
  • src/system/mod.rs

Comment thread mise.usage.kdl Outdated
Comment thread src/cli/bootstrap.rs Outdated
Comment thread src/system/files.rs
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.5 x -- echo 17.8 ± 0.8 16.4 23.2 1.00
mise x -- echo 18.8 ± 1.6 17.1 49.3 1.05 ± 0.10

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.5 env 17.7 ± 0.8 16.1 20.8 1.00
mise env 18.4 ± 0.7 17.1 22.0 1.04 ± 0.06

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.5 hook-env 18.4 ± 0.7 16.9 22.2 1.00
mise hook-env 19.0 ± 0.8 17.3 22.6 1.04 ± 0.06

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.6.5 ls 14.9 ± 0.7 13.4 17.9 1.00
mise ls 15.7 ± 0.7 14.1 18.8 1.05 ± 0.07

xtasks/test/perf

Command mise-2026.6.5 mise Variance
install (cached) 129ms 131ms -1%
ls (cached) 57ms 58ms -1%
bin-paths (cached) 62ms 63ms -1%
task-ls (cached) 119ms 123ms -3%

@jdx jdx force-pushed the codex/dotfiles-command branch from 25c2c19 to 49bbff7 Compare June 13, 2026 04:41
Comment thread src/system/files.rs
Comment thread src/cli/dotfiles/apply.rs
Comment thread src/cli/dotfiles/add.rs

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
schema/mise.json (1)

3034-3075: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add the new system.brew contract to the generated schema and remove the stale files/edits wording.

src/system/mod.rs now accepts [system.brew.taps], but this schema still models [system] as only packages/defaults and describes it as owning files/edits. That makes a supported config look invalid in editors while still steering users toward removed keys.

Suggested schema shape
-    "system": {
-      "type": "object",
-      "description": "[experimental] machine-global bootstrapping (system packages, files, edits, macOS defaults)",
-      "properties": {
+    "system": {
+      "type": "object",
+      "description": "[experimental] machine-global bootstrapping (system packages, Homebrew taps, macOS defaults)",
+      "properties": {
+        "brew": {
+          "type": "object",
+          "description": "Homebrew-specific system config",
+          "properties": {
+            "taps": {
+              "type": "object",
+              "description": "Homebrew tap remotes keyed by owner/tap",
+              "additionalProperties": {
+                "type": "string"
+              }
+            }
+          }
+        },
         "packages": {
           "type": "object",
           "description": "system packages to install with `mise system install`, keyed by \"manager:package\" (e.g. \"apt:libssl-dev\", \"brew:postgresql@17\", \"dnf:openssl-devel\", \"pacman:base-devel\")",
🤖 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 `@schema/mise.json` around lines 3034 - 3075, The schema's "system" object is
outdated: add a new "brew" property describing the Homebrew-specific contract
(including a "taps" property that models [system.brew.taps] as an object keyed
by tap name with string or object values) and remove the stale wording that
claims "system" owns files/edits; specifically update the "system" properties to
include a "brew" entry (type: object, description referencing brew settings)
with a "taps" sub-property (type: object, propertyNames pattern,
additionalProperties allowing string or object) alongside the existing
"packages" and "defaults", and edit the "system" description to drop
"files/edits" language so it reflects the actual supported keys (packages,
defaults, brew).
🤖 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 `@e2e/cli/test_dotfiles_files`:
- Around line 193-195: Remove the first immediate execution assert_fail "mise
dotfiles apply --yes" so the command is only run once; run the command once and
capture its combined stdout/stderr into install_out using install_out="$(mise
dotfiles apply --yes 2>&1 || true)", then make assertions against that captured
output (e.g. assert_contains_text "$install_out" "sources do not exist") and, if
you need to assert it failed, check the exit status from the single run rather
than re-running the command.

In `@src/cli/dotfiles/add.rs`:
- Around line 72-110: The loop in add.rs currently treats targets as unmanaged
if files_from_config() doesn't return an exact whole-file entry, allowing adding
a whole-file when a `[dotfiles]` edit (e.g. "~/.zshrc/<id>") already exists;
update the planning logic in the loop that builds PlannedAdd so that after
resolving target with system::files::resolve_target_arg you check
managed.iter().find(...) for any matching req via system::files::matches_target
and if a match exists but req.target_raw != target_raw (i.e. the config has a
per-file edit for this path) bail early with a clear error (fail-fast) instead
of proceeding to create a whole-file PlannedAdd; keep the existing behavior only
when the match is an exact whole-file entry.

In `@src/cli/dotfiles/edit.rs`:
- Around line 89-114: source_for_target currently returns the first matching
edit source/config when multiple edits target the same path; change it to detect
ambiguous matches: iterate system::edits::edits_from_config(config) and collect
all matching req entries (use their unique ids from req.id or
req.config_path+req.path if no id), if the collection has more than one element
return an Err listing the candidate ids instead of picking the first, if exactly
one element return its source as before, and if none fall back to the earlier
system::files behavior; update the function's return/error path accordingly and
ensure you reference source_for_target, system::edits::edits_from_config,
EditOp, BlockSource, and req.config_path when locating and implementing this
change.

In `@src/system/edits.rs`:
- Around line 152-160: The current early-return in edit_entry_from_toml is
skipping all non-Table values so malformed or legacy edit entries never reach
the try_into() warning; change the match so we only suppress true whole-file
entries (e.g., an empty Table or a Table that signals whole-file via the "mode"
key) and let all other non-table or malformed values fall through to the
try_into() path (so split_edit_key()/try_into() will emit warnings). Update the
match in edit_entry_from_toml (and any related guards) to only return None for
the explicit whole-file case and not for every non-Table value.

---

Outside diff comments:
In `@schema/mise.json`:
- Around line 3034-3075: The schema's "system" object is outdated: add a new
"brew" property describing the Homebrew-specific contract (including a "taps"
property that models [system.brew.taps] as an object keyed by tap name with
string or object values) and remove the stale wording that claims "system" owns
files/edits; specifically update the "system" properties to include a "brew"
entry (type: object, description referencing brew settings) with a "taps"
sub-property (type: object, propertyNames pattern, additionalProperties allowing
string or object) alongside the existing "packages" and "defaults", and edit the
"system" description to drop "files/edits" language so it reflects the actual
supported keys (packages, defaults, brew).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4cdfb4c8-2c7f-43f2-9437-aa6e844ae1ff

📥 Commits

Reviewing files that changed from the base of the PR and between 25c2c19 and 49bbff7.

📒 Files selected for processing (39)
  • docs/.vitepress/cli_commands.ts
  • docs/.vitepress/config.ts
  • docs/cli/bootstrap.md
  • docs/cli/dotfiles.md
  • docs/cli/dotfiles/add.md
  • docs/cli/dotfiles/apply.md
  • docs/cli/dotfiles/edit.md
  • docs/cli/dotfiles/status.md
  • docs/cli/index.md
  • docs/cli/system.md
  • docs/cli/system/install.md
  • docs/cli/system/status.md
  • docs/system-edits.md
  • docs/system-files.md
  • docs/system-packages/index.md
  • docs/tips-and-tricks.md
  • e2e/cli/test_bootstrap
  • e2e/cli/test_dotfiles_edits
  • e2e/cli/test_dotfiles_files
  • man/man1/mise.1
  • mise.usage.kdl
  • schema/mise.json
  • settings.toml
  • src/cli/bootstrap.rs
  • src/cli/dotfiles/add.rs
  • src/cli/dotfiles/apply.rs
  • src/cli/dotfiles/edit.rs
  • src/cli/dotfiles/mod.rs
  • src/cli/dotfiles/status.rs
  • src/cli/mod.rs
  • src/cli/system/install.rs
  • src/cli/system/mod.rs
  • src/cli/system/status.rs
  • src/config/config_file/mise_toml.rs
  • src/config/config_file/mod.rs
  • src/system/edits.rs
  • src/system/files.rs
  • src/system/mod.rs
  • xtasks/fig/src/mise.ts
✅ Files skipped from review due to trivial changes (12)
  • docs/cli/dotfiles/edit.md
  • docs/system-packages/index.md
  • docs/cli/dotfiles/apply.md
  • docs/cli/dotfiles/add.md
  • src/cli/system/mod.rs
  • docs/cli/system/status.md
  • docs/cli/system/install.md
  • docs/cli/index.md
  • docs/.vitepress/config.ts
  • docs/cli/dotfiles/status.md
  • docs/cli/bootstrap.md
  • docs/cli/system.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/config/config_file/mod.rs
  • e2e/cli/test_bootstrap
  • src/cli/bootstrap.rs
  • docs/tips-and-tricks.md
  • src/cli/dotfiles/status.rs
  • src/config/config_file/mise_toml.rs
  • src/cli/system/status.rs
  • src/cli/system/install.rs

Comment thread e2e/cli/test_dotfiles_files Outdated
Comment thread src/cli/dotfiles/add.rs
Comment thread src/cli/dotfiles/edit.rs
Comment thread src/system/edits.rs
@jdx jdx force-pushed the codex/dotfiles-command branch 2 times, most recently from 4e63a11 to 94c5cff Compare June 13, 2026 05:00
Comment thread src/cli/dotfiles/add.rs Outdated

@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)
src/cli/dotfiles/add.rs (1)

249-273: 💤 Low value

Dead code: the already_managed branch is unreachable.

inline_entry is only called when item.already_managed.is_none() (lines 139 and 196), so the condition at line 258 checking item.already_managed.is_some() can never be true.

Simplify by removing unreachable branch
 fn inline_entry(item: &PlannedAdd) -> Value {
     let mut table = InlineTable::new();
     if !item.implied_source {
         table.insert(
             "source",
             Value::String(toml_edit::Formatted::new(
                 item.source.display_user().to_string(),
             )),
         );
-    } else if let Some(req) = &item.already_managed
-        && !system::files::source_is_implied(req)
-    {
-        table.insert(
-            "source",
-            Value::String(toml_edit::Formatted::new(
-                item.source.display_user().to_string(),
-            )),
-        );
     }
     table.insert(
         "mode",
         Value::String(toml_edit::Formatted::new(item.mode.name().to_string())),
     );
     Value::InlineTable(table)
 }
🤖 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 `@src/cli/dotfiles/add.rs` around lines 249 - 273, The else-if branch in
inline_entry is unreachable because inline_entry is only called when
PlannedAdd.already_managed is None; remove the entire else if let Some(req) =
&item.already_managed && !system::files::source_is_implied(req) { ... } branch
and simplify the function to only insert "source" when !item.implied_source,
leaving the existing insertion of "mode" unchanged; keep references to
inline_entry, PlannedAdd, implied_source, already_managed, and
system::files::source_is_implied in your mental model to locate and remove the
unreachable block.
🤖 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 `@src/cli/dotfiles/add.rs`:
- Around line 172-225: The final log is including planned items the user
skipped; fix by tracking which items were actually written and use that list for
logging and any post-actions: inside the loop over planned (where you currently
call write_entry(doc, item) and file::write/create paths), create a Vec<String>
written = Vec::new() and push item.target_raw.clone() (or another identifier)
whenever you successfully write/create or call write_entry for that item; then
replace the final filters that iterate planned.iter().filter(|item|
item.already_managed.is_none()) with the collected written list (use
written.join(", ")) for both the doc-present branch (after
file::write(&config_path, doc.to_string())) and the doc-absent branch so skipped
items are not reported as added/updated; ensure the code paths that continue on
user-decline do not push to written (so skipped items remain excluded).

---

Nitpick comments:
In `@src/cli/dotfiles/add.rs`:
- Around line 249-273: The else-if branch in inline_entry is unreachable because
inline_entry is only called when PlannedAdd.already_managed is None; remove the
entire else if let Some(req) = &item.already_managed &&
!system::files::source_is_implied(req) { ... } branch and simplify the function
to only insert "source" when !item.implied_source, leaving the existing
insertion of "mode" unchanged; keep references to inline_entry, PlannedAdd,
implied_source, already_managed, and system::files::source_is_implied in your
mental model to locate and remove the unreachable block.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a609edb-3800-4f03-b9a8-64bc6b470fd8

📥 Commits

Reviewing files that changed from the base of the PR and between 4e63a11 and 94c5cff.

📒 Files selected for processing (30)
  • docs/.vitepress/cli_commands.ts
  • docs/cli/bootstrap.md
  • docs/cli/dotfiles.md
  • docs/cli/dotfiles/add.md
  • docs/cli/dotfiles/apply.md
  • docs/cli/dotfiles/edit.md
  • docs/cli/dotfiles/status.md
  • docs/cli/index.md
  • docs/dev-tools/mise-oci.md
  • docs/system-edits.md
  • docs/system-files.md
  • docs/tips-and-tricks.md
  • e2e/cli/test_dotfiles_edits
  • e2e/cli/test_dotfiles_files
  • e2e/oci/test_oci_build_slow
  • man/man1/mise.1
  • mise.usage.kdl
  • schema/mise.json
  • settings.toml
  • src/cli/bootstrap.rs
  • src/cli/dotfiles/add.rs
  • src/cli/dotfiles/apply.rs
  • src/cli/dotfiles/edit.rs
  • src/cli/dotfiles/mod.rs
  • src/cli/dotfiles/status.rs
  • src/cli/oci/common.rs
  • src/oci/builder.rs
  • src/system/edits.rs
  • src/system/files.rs
  • xtasks/fig/src/mise.ts
✅ Files skipped from review due to trivial changes (9)
  • docs/cli/index.md
  • docs/cli/dotfiles/status.md
  • docs/cli/dotfiles/add.md
  • docs/cli/dotfiles/edit.md
  • docs/cli/bootstrap.md
  • docs/cli/dotfiles/apply.md
  • docs/cli/dotfiles.md
  • src/cli/bootstrap.rs
  • docs/system-files.md
🚧 Files skipped from review as they are similar to previous changes (18)
  • docs/.vitepress/cli_commands.ts
  • src/cli/oci/common.rs
  • docs/dev-tools/mise-oci.md
  • docs/tips-and-tricks.md
  • settings.toml
  • xtasks/fig/src/mise.ts
  • schema/mise.json
  • src/cli/dotfiles/mod.rs
  • src/cli/dotfiles/apply.rs
  • src/cli/dotfiles/status.rs
  • docs/system-edits.md
  • src/oci/builder.rs
  • src/cli/dotfiles/edit.rs
  • man/man1/mise.1
  • mise.usage.kdl
  • src/system/edits.rs
  • src/system/files.rs
  • e2e/cli/test_dotfiles_files

Comment thread src/cli/dotfiles/add.rs
@jdx jdx force-pushed the codex/dotfiles-command branch 2 times, most recently from 10827e8 to b500ed0 Compare June 13, 2026 05:43
@jdx jdx force-pushed the codex/dotfiles-command branch from b500ed0 to 7ad6d0a Compare June 13, 2026 05:53
Comment thread src/system/edits.rs
@jdx jdx force-pushed the codex/dotfiles-command branch 6 times, most recently from a40b13c to 358399d Compare June 13, 2026 06:30

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 358399d. Configure here.

Comment thread schema/mise.json
Comment thread schema/mise.json
@jdx jdx force-pushed the codex/dotfiles-command branch from 358399d to 99d3847 Compare June 13, 2026 06:39
@jdx jdx force-pushed the codex/dotfiles-command branch from 99d3847 to 3c0a041 Compare June 13, 2026 06:49
@jdx jdx changed the title feat(dotfiles): move file management to dotfiles feat(bootstrap): add dotfiles workflow Jun 13, 2026
@jdx jdx merged commit 9331e42 into main Jun 13, 2026
49 of 51 checks passed
@jdx jdx deleted the codex/dotfiles-command branch June 13, 2026 07:03
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Jun 13, 2026
mise v2026.6.6 has added an experimental dotfiles feature:

- https://github.com/jdx/mise/releases/tag/v2026.6.6
- jdx/mise#10376

Try it out and drop stow completely.

Benefits:

- fewer tools to manage
- stow's blocklist may lead to dangerous surprises - an allowlist is
  much safer (even though it's more annoying to maintain)
- the list of symlinks is easier to keep in sync with the list of tools
  since they are in the same file now
mikavilpas added a commit to mikavilpas/dotfiles that referenced this pull request Jun 13, 2026
mise v2026.6.6 has added an experimental dotfiles feature:

- https://github.com/jdx/mise/releases/tag/v2026.6.6
- jdx/mise#10376

Try it out and drop stow completely.

Benefits:

- fewer tools to manage
- stow's blocklist may lead to dangerous surprises - an allowlist is
  much safer (even though it's more annoying to maintain)
- the list of symlinks is easier to keep in sync with the list of tools
  since they are in the same file now
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.

1 participant