Skip to main content
The status command prints the status of managed files and scripts in a format similar to git status.

Usage

chezmoi status [target]...

Description

The status command shows a two-character status code for each managed file:
  • First column: Difference between the last state written by chezmoi and the actual state
  • Second column: Difference between the actual state and the target state (what chezmoi apply will do)

Status Codes

CharacterMeaningFirst ColumnSecond Column
SpaceNo changeNo changeNo change
AAddedEntry was createdEntry will be created
DDeletedEntry was deletedEntry will be deleted
MModifiedEntry was modifiedEntry will be modified
RRunNot applicableScript will be run

Flags

-x, --exclude
types
Exclude entry types (comma-separated: dirs, files, remove, scripts, symlinks, always, encrypted, externals, templates).
-i, --include
types
Include only specified entry types (comma-separated: dirs, files, remove, scripts, symlinks, always, encrypted, externals, templates).
--init
boolean
default:"false"
Recreate the config file from the template in the source directory.
-P, --parent-dirs
boolean
default:"false"
Show status of all parent directories.
-p, --path-style
string
default:"relative"
Path style to use in output. Options: absolute, relative. Can be configured via status.pathStyle in the config file.
-r, --recursive
boolean
default:"true"
Recurse into subdirectories.

Examples

Show status of all managed files

chezmoi status

Show status with absolute paths

chezmoi status --path-style=absolute

Show status for specific files

chezmoi status ~/.bashrc ~/.vimrc

Terminal Output

$ chezmoi status
 M .bashrc
A  .gitconfig
 D .vimrc
MM .tmux.conf
 R run_once_install-packages.sh

Interpreting Output

Clean state (no output)

$ chezmoi status
$
All files match the target state. Nothing to do.

Modified in destination

 M .bashrc
You modified .bashrc locally. chezmoi apply will overwrite it with the target state.

Modified in source

M  .bashrc
The source state changed (e.g., you edited it or pulled changes). The destination file was not modified locally.

Modified in both

MM .bashrc
Both the source and destination were modified. There may be a conflict. Use chezmoi diff or chezmoi merge to resolve.

Will be added

A  .gitconfig
A new file will be created by chezmoi apply.

Will be deleted

 D .vimrc
You deleted .vimrc from the source state. chezmoi apply will remove it from your home directory.

Script will run

 R run_once_install-packages.sh
A script will be executed by chezmoi apply.

Common Workflows

Before applying changes

chezmoi status    # See what will change
chezmoi diff      # See detailed differences  
chezmoi apply     # Apply the changes

After making local changes

chezmoi status    # Check status
chezmoi diff      # Review changes
chezmoi add ~/.bashrc  # Add changes to source state

After pulling from repository

chezmoi update --apply=false  # Pull changes
chezmoi status    # See what changed
chezmoi diff      # Review differences
chezmoi apply     # Apply changes

Checking for conflicts

$ chezmoi status
MM .bashrc        # Conflict detected
MM .vimrc         # Another conflict

$ chezmoi merge ~/.bashrc  # Resolve with merge tool
$ chezmoi merge ~/.vimrc

Exit Code

The status command exits with code 0 even if there are differences. Use the output to determine if action is needed.
  • diff - Show detailed differences
  • apply - Apply changes shown in status
  • merge - Resolve conflicts

Build docs developers (and LLMs) love