Groups
A group is a named directory tree of dotfiles, such as one per application or one per machine role. mise deploys every file in the tree without a list of entries, and each machine chooses which groups it applies.
Define a group
Declare a group with a [dotfile_groups.<name>] table:
[dotfile_groups.zsh]
root = "zsh" # links ~/.dotfiles/zsh/.zshrc to ~/.zshrc
[dotfile_groups.home]
root = "home" # ~/.dotfiles/home
target = "~"
mode = "symlink-each"
dot_prefix = true
exclude = ["README.md"]mise walks the root and deploys each file at the same path under the target. A table that leaves root out deploys the directory named after the group, so [dotfile_groups.zsh] with no root also reads ~/.dotfiles/zsh. A relative root always starts at dotfiles.root, not at the directory of the config file that declares the group. Group names can contain letters, digits, -, _, and .. If a more local config file defines a group with the same name, its table replaces the whole group.
Group keys
| Key | Default | Meaning |
|---|---|---|
root | the group name | The directory tree to deploy. A relative path starts at dotfiles.root. |
target | ~ | The directory the tree deploys into. |
mode | symlink-each | symlink-each links each file, copy copies each file, and symlink links the whole tree. dot_prefix, manifest, and entries need symlink-each or copy. |
exclude | Paths under the root to skip, using the pattern syntax. | |
dot_prefix | false | Deploy dot-<name> names as .<name>, as described in Visible source names. |
manifest | "git" deploys only files in Git's index, as described in Deploy only files committed to Git. | |
relative | Link by relative paths, as described in Relative symlinks. | |
depends | Groups (by name) and whole-file entries (by target path) mise writes before this group and its entries, as described in Wait for other entries. | |
entries | Whole-file entries for parts of the tree; see Group entries. Requires symlink-each or copy. |
A group with mode = "symlink" and an entries table is invalid: mise warns and ignores the whole group. With symlink, mise also ignores dot_prefix and manifest.
Group entries
[dotfile_groups.<name>.entries] describes parts of the tree with the same syntax as [dotfiles] entries, keyed by target path. Each entry is cut out of the walk, so it decides how its path is deployed. For example, to link a directory as a whole instead of each file in it, so that files the application creates there also land in your dotfiles:
[dotfile_groups.home]
root = "home"
dot_prefix = true
[dotfile_groups.home.entries]
"~/.config/kitty" = { mode = "symlink" } # ~/.config/kitty -> home/dot-config/kitty
"~/.ssh/config" = { mode = "copy", permissions = "0600" }
"~/.gitconfig" = { source = "git/config.tmpl", mode = "template" }
"~/.kitty-old.conf" = { mode = "absent" }- An entry without
sourcefinds it under the root, at its path inside the group's target:~/.config/kittyin thehomegroup reads~/.dotfiles/home/dot-config/kitty. Withmode = "template", a missing file falls back to the same path plus.tera, so"~/.config/git/config" = { mode = "template" }rendershome/dot-config/git/config.teraand does not also deploy it with the suffix. - A relative
sourcestarts at the root. When it lies inside the root, or inside the tree of another entry that walks a directory, that walk skips it, sogit/config.tmplis rendered to~/.gitconfigand not also linked to~/git/config.tmpl. - An entry without
modedeploys like the group: a directory the group's way, a file as one link, or as one copy in acopygroup. The exception is an entry that sets onlypermissions: it does not inherit the group'smode, deploys nothing, and only adjusts the permissions of an existing target (see Permissions). To deploy a file and set its permissions, setmodetoo, for example{ mode = "copy", permissions = "0600" }. - An entry that walks a directory inherits the group's
dot_prefixandmanifest, and the group'sexcludepatterns that contain no/, unless it sets its own. - An entry, and each target its
variantsname, cannot be the group's target or a directory that contains it. An entry beneath another walking entry is cut out of that one too. An entry beneath a directory linked as a whole would change a file in the root itself, so mise reports it as a conflict before anything is written.
To put an entry in a group, declare it under [dotfile_groups.<name>.entries]; a [dotfiles] entry with a group key is invalid.
Entries outside the target
An entry can deploy outside the group's target, so a package whose files land in more than one place is still one group. For example, on Windows VS Code reads its settings from ~/AppData/Roaming/Code but an extension reads ~/.crossnote:
[dotfile_groups.vscode]
root = "vscode/.config"
target = "~/AppData/Roaming"
[dotfile_groups.vscode.entries]
"~/.crossnote" = { source = "crossnote", mode = "symlink" }vscode/.config/Code is walked into ~/AppData/Roaming/Code, and ~/.crossnote links to vscode/.config/crossnote, which the walk skips.
- An entry outside the target has no path in the tree, so it needs a
source, unless its mode takes none, such asabsent. - The entry belongs to the group like any other: it applies only while the group is selected, and
mise dot unapply --groupandmise dot apply --pruneremove it with the rest of the group.
To deploy only the entries and nothing else from the root, exclude everything at the top of the tree. The / anchors the pattern, so entries that walk a directory do not inherit it:
[dotfile_groups.vscode]
root = "vscode"
exclude = ["/*"]
[dotfile_groups.vscode.entries]
"~/AppData/Roaming/Code/User/settings.json" = ".config/Code/User/settings.json"
"~/.crossnote" = ".config/crossnote"Edits in a group
An entry can also edit part of a file instead of deploying one. Key it like a [dotfiles] edit, with the path of the file followed by an id, and write it as a table with block, line, or merge:
[dotfile_groups.common]
root = "common"
[dotfile_groups.common.entries]
"~/.config/mise/conf.d/private.local.toml/defaults" = { source = "../templates/private.toml", merge = "missing", permissions = "0600" }- The edit applies only while the group is selected. A machine that selects other groups leaves the file alone.
- A relative
sourcestarts at the group root, like the group's other entries, and amergewithout one reads the file at the same path inside the root. A walking group does not also deploy a file that an edit reads or changes. - The file being edited can be outside the group's target; a
mergethere needs asource. An edit takes the keys it takes in[dotfiles], and a key that only whole-file entries take, such asmode, makes mise ignore the whole group with a warning. - Deselecting the group stops the edit but leaves what it wrote in the file.
mise dot unapply --groupremoves only the group's deployed files, so to remove an edit's block or line, runmise dot unapply <path>while the group is still selected.
Select groups
Every declared group applies until you select some. Use [bootstrap] dotfile_groups to choose the groups a machine applies, for example in that machine's ~/.config/mise/config.local.toml:
[bootstrap]
dotfile_groups = ["home", "zsh"]A more local config file's list replaces the others. [dotfiles] entries apply on every machine, whichever groups it selects; the entries of a group, including its edits, apply only while it is selected.
Two selected groups cannot deploy the same target file, and one group cannot link a directory as a whole while another places files inside it. mise reports either case as a conflict naming both groups, before anything is written.
Groups without a table
A selected name that no [dotfile_groups] table declares, but that names a directory under dotfiles.root, is a group with the defaults: its directory is the root, deployed into ~ file by file. A directory of packages then needs no tables at all:
~/.dotfiles/
├── kitty/.config/kitty/kitty.conf
├── nvim/.config/nvim/init.lua
└── zsh/.zshrc[bootstrap]
dotfile_groups = ["kitty", "nvim", "zsh"]~/.config/kitty/kitty.conf links to ~/.dotfiles/kitty/.config/kitty/kitty.conf, and so on. Write a table only for a group that needs more, such as entries, dot_prefix, or another target. The table holds only what differs, since its root is still the directory of that name:
[dotfile_groups.kitty]
exclude = ["README.md"]A group without a table exists only while a list selects it, while a declared group also applies when no list is set. mise warns when the list names something that is neither declared nor a directory.
Deselect and remove groups
Deselecting a group, or deleting its table, leaves its files in place, and mise dot status lists them as orphaned. mise knows those files because it records what each group deployed in its state directory. A file also becomes orphaned when a selected group stops deploying it, for example after a new exclude pattern or after you delete a copied source file. A file that any active entry still deploys is never orphaned, even when the entry has moved to another group. A permissions-only entry deploys nothing, so it does not keep a file from being orphaned: dropping mode from an entry that deployed a file leaves that file orphaned, and --prune removes it. If mise cannot read a group, for example because its root is missing, it warns about the group instead of listing its files.
To remove orphaned files, or every file of one group:
mise dot apply --prune # apply, then remove orphaned files
mise bootstrap --prune-dotfiles # the same, as part of a bootstrap run
mise dot unapply --group work # remove one group's files--prune and unapply --group remove a link only while it still points at the source mise linked, and a copied file only while it still holds what mise wrote. They leave anything you changed in place with a warning; add --force to remove changed copies too. Directories that mise created and that they empty are removed, up to the target of the group or entry that deployed the file; a directory you made stays, even when it is empty. A target that an older mise deployed is tracked from the first mise dot apply after the upgrade that applies an entry at that target, even one with nothing to change; a group left unselected is not applied, so its target is not tracked yet. Until then, any directory these commands empty goes, and from then on a directory that already held something mise deployed counts as mise's. unapply --group works whether or not the group is still selected or declared. --prune asks before it removes anything unless you pass --yes, and it covers every group, so it takes no target arguments.
Both commands compare files with what mise last wrote, not with the current source, so editing a group's root does not stop unapply --group from removing an untouched copy. Neither removes a path that resolves through a linked directory, for example after you link a directory as a whole, or a path inside dotfiles.root, even with --force, so they never delete source files.
Add files to a group
mise dot add captures a file inside a group's target into that group's root, without writing an entry. In a dot_prefix group, the source gets the dot- name. With the zsh and home groups from Define a group, which both deploy into ~, name the group for a new file:
mise dot add --group home ~/.config/starship.toml # -> ~/.dotfiles/home/dot-config/starship.tomlWhen several groups contain the path, mise picks the one whose target is deepest. Among groups at the same depth, the one whose root already holds the file wins. For a new file that no root holds yet, mise refuses until you pass --group.
mise dot edit opens the group's source file for a path inside a group's tree, and takes --group the same way when it has to create the file. A group with manifest = "git" deploys only files in Git's index, so add refuses to capture into it; copy the file into the root and git add it instead.
Coming from GNU Stow
Groups cover the same ground as Stow packages:
| GNU Stow | mise |
|---|---|
| A package directory | A directory under dotfiles.root that [bootstrap] dotfile_groups names; see Groups without a table |
stow --dotfiles | dot_prefix = true |
| Relative links (Stow's default) | dotfiles.relative_symlinks or relative = true |
stow -D <package> | mise dot unapply --group <name> |
stow --adopt | mise dot add --group <name> <file> |
| Choosing which packages to stow | [bootstrap] dotfile_groups |
Stow links a whole directory when nothing else lives in it. A symlink-each group always links file by file; to link a directory as a whole, add a symlink group entry for it.
To switch a machine from Stow, select the same packages and run mise dot apply; there is no need to unstow first. Where Stow linked a whole directory, such as ~/.config/kitty to ~/.dotfiles/kitty/.config/kitty, mise dot status reports the link, and apply replaces it with a real directory that links each file. A link into the group's root that does not point at the directory belonging there is refused, even with --force, because writing through it would change the files in the root.
See also
- Managed files covers the modes, templates, permissions, and conflict rules that group entries share with
[dotfiles]. - Edit part of a file covers the block, line, and merge edits a group can declare.
- Dotfiles reference lists every entry key and status state.