The --include flag currently only supports individual files and copies them to the worktree root. This is limiting when repos have untracked files/directories needed for testing and running (e.g., .env, config directories, fixture data).
Two improvements
1. Directory support for --include
--include should accept directories in addition to files. When a directory is passed, it should be copied recursively into the worktree, preserving the relative path from the current working directory.
mog 123 --include .env --include config/local/
The cleanup step should also handle removing directories after Claude finishes (currently only handles individual files via fs.unlinkSync).
2. .moginclude file for automatic includes
A .moginclude file in the repo root that lists paths (one per line) to always copy into the worktree. This avoids having to pass --include repeatedly for the same files.
# .moginclude
.env
config/local/
test/fixtures/credentials.json
Paths in .moginclude should be resolved relative to the repo root. --include flags should be additive on top of .moginclude. Lines starting with # are comments.
The
--includeflag currently only supports individual files and copies them to the worktree root. This is limiting when repos have untracked files/directories needed for testing and running (e.g.,.env, config directories, fixture data).Two improvements
1. Directory support for
--include--includeshould accept directories in addition to files. When a directory is passed, it should be copied recursively into the worktree, preserving the relative path from the current working directory.The cleanup step should also handle removing directories after Claude finishes (currently only handles individual files via
fs.unlinkSync).2.
.mogincludefile for automatic includesA
.mogincludefile in the repo root that lists paths (one per line) to always copy into the worktree. This avoids having to pass--includerepeatedly for the same files.Paths in
.mogincludeshould be resolved relative to the repo root.--includeflags should be additive on top of.moginclude. Lines starting with#are comments.