Skip to content

Support including directories and auto-include via .moginclude #11

Description

@KeithGalli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions