Skip to main content

dirpluck

dirpluck is a tool that records decisions about which files belong together in TOML and builds a ZIP Archive from that declaration. The CLI is the primary entry point, and the same invocation model is also available through a small Python API.

Rather than copying everything around it like a backup, it is intended to repeatedly gather only the files needed for a particular purpose, such as review, handoff, research, recurring work, or a working context handled with an LLM.

Where it fits

Gather the material you need into one Archive

Material spread across multiple directories can be collected into one Archive when it serves the same purpose.

For example, a review package might bring together:

  • the source of the project being reviewed
  • review guidelines
  • reference material

You can gather only fixed material, or attach fixed material to a Target selected at runtime.

Apply the same extraction to different Targets

If you record decisions such as "collect README, src/, and tests/" or "exclude secrets and generated files" in a Configuration, you can reuse the same rules while changing the project being handled.

The Scope from which a Target is selected is defined separately, so the Configuration and the actual project tree do not need to live in the same place.

Why keep it declarative

For a one-off task, creating a ZIP by hand may be simpler.

dirpluck is useful when the same kind of decision needs to be made again later.

A Configuration lets you record:

  • what must always be included
  • what should be included only when present
  • what should be excluded
  • which fixed material should be collected alongside the Target

without relying on shell history, conversation history, or human memory.

Use --preview to inspect what would be selected from the current filesystem before writing an Archive.

When Configurations need to be shared across related uses, one Configuration can also reuse another as its base. See docs/CONFIGURATION.md for authoring guidance and docs/SPECIFICATION.md for exact composition and resolution rules.

Before sharing an Archive

dirpluck does not infer which files contain sensitive information.

Before creating an Archive that will leave the local environment, use --preview to review its contents and explicitly exclude anything that should not be included.

For example, .env files, private keys, credentials, and project-specific sensitive files may use different names and locations in different projects.

See docs/TRUST.md for the trust boundary around Configurations and filesystem operations, including absolute paths, overwrite behavior, and Archives intended to leave the local environment.

A small example

When --config is omitted, dirpluck uses default.dirpluck from the current working directory. Starting with this default Configuration is the simplest way to begin.

Save the following as default.dirpluck:

[about]
description = "Review package for the example project."

[pluck]
description = "Project files selected for review."
must = ["README.md", "src", "tests"]
ignore = [".git/", "__pycache__/", "*.pyc"]

[always.guidelines]
path = "review-guidelines"
description = "Review guidelines shared across projects."
must = ["*.md"]

[output]
path = "review.zip"

Suppose the same directory contains these files:

.
├── default.dirpluck
├── example/
│   ├── README.md
│   ├── src/
│   │   └── main.py
│   └── tests/
│       └── test_main.py
└── review-guidelines/
    └── review.md

First, use --preview to inspect what would go into the Archive:

dirpluck example --preview

For this example, the preview is:

├── README.md
├── example/
│   ├── README.md
│   ├── src/
│   │   └── main.py
│   └── tests/
│       └── test_main.py
└── review-guidelines/
    └── review.md

The leading README.md is generated by dirpluck to describe the Archive contents.

If the preview looks right, build the Archive with the same Target:

dirpluck example

The [output] declaration creates review.zip. It contains the files shown by the preview together with the generated README.md.

For this example, the generated README.md is:

# Archive contents

Review package for the example project.

## `example/`

Files: 3

Project files selected for review.

## `review-guidelines/`

Files: 1

Review guidelines shared across projects.

Descriptions written in the Configuration are used as human-facing context in this Archive README:

  • [about].description describes the Archive as a whole.
  • [pluck].description describes the source collected from the Target.
  • [always.guidelines].description describes the fixed review-guidelines/ source.

These description values are optional. Omitting a source description does not change extraction semantics.

This lets a Configuration record not only what to collect, but also enough context to explain what the resulting Archive is for when that context is useful.

This example selects a Target from the default Scope and places it directly at the Archive root. In larger setups, additional Scopes can separate the filesystem ranges from which Targets are selected, and a Namespace can organize sources under an explicit path inside the Archive.

When the same combination of Configuration, Target, and Case is used repeatedly, an Invocation Template can store the call. A single Invocation Template can contain multiple named Invocations, so calls for purposes such as review, docs, and release can be kept in one file.

See docs/CONFIGURATION.md for Configuration fields, Scope, Case, Always, Output, Namespace, and related authoring details. See docs/CLI.md for CLI options, Configuration selection, and Invocation Templates.

Installation

The current version is 0.10.0.

Python 3.11 or later is required.

pip install dirpluck
dirpluck --version

dirpluck has no third-party runtime dependencies.

Documentation

The documentation is separated by purpose:

  • GLOSSARY.md: meanings of the concepts used throughout the documentation.
  • docs/CONFIGURATION.md: a guide for writing .dirpluck Configurations.
  • docs/CLI.md: a guide to the CLI and .dirpluck-inv Invocation Templates.
  • docs/PYTHON_API.md: the small official Python API for using the same execution model as the CLI.
  • docs/SPECIFICATION.md: exact rules for Configuration composition, resolution, matching, filesystem traversal, Archives, Output, and validation.
  • docs/TRUST.md: the trust boundary for Configurations and filesystem operations, and what users are responsible for reviewing.
  • CHANGELOG.md: release history.

License

dirpluck is released under the MIT License.

See LICENSE for details.

Metadata

Release files for dirpluck 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dirpluck 0.10.0
File Size Uploaded
dirpluck-0.10.0.tar.gz 258.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dirpluck 0.10.0
File Interpreter ABI Platform
dirpluck-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 310.5 kB

Release files / dirpluck-0.10.0.tar.gz

Download URL dirpluck-0.10.0.tar.gz
Size 258.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f9554ec022c01ac6d5c8a3139ead1122cc2e5ad1e8925a92941d9cb717a30ef1
BLAKE2b-256 checksum
How to use checksums
1a644b4b6e40a6ee346cd54dce144dfbc6463cf63302de0f0c46ab7d40c41b65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / dirpluck-0.10.0-py3-none-any.whl

Download URL dirpluck-0.10.0-py3-none-any.whl
Size 52.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d71d8f2e456ba39d6876470c551969f81510cf926f0cc087e090ee62966dbee
BLAKE2b-256 checksum
How to use checksums
e3a08d61f30fab48bfa47bb6a1da44d97ff2621643f2bb92248d8f0c58568357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

0.14.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page