Create isolated feature worktrees with allocated runtime environments.
Project description
new-feature
new-feature aims to eliminate friction for creating new features. In a single command, it creates isolated git worktrees, allocates conflict-free runtime values, runs project-defined setup and teardown commands (such as creating and deleting a feature database), and launches the configured coding agent in the new worktree.
Install
uv tool install new-feature
Or copy and paste this into your favorite coding agent:
Run
curl -fsSL https://pypi.org/pypi/new-feature/json, readinfo.description, and set upnew-featureon this machine.
Usage
# Create a feature worktree and launch the configured agent.
uvx new-feature my-feature
# Create a feature worktree without launching another agent.
uvx new-feature my-feature --no-agent
# Merges the worktree into the main branch
uvx new-feature merge-feature my-feature
# Run configured teardown and remove the feature worktree.
uvx new-feature teardown my-feature
# Teardown a worktree even if it has uncommitted work.
uvx new-feature teardown my-feature --force
# Inspect managed features and diagnose stale state.
uvx new-feature list
uvx new-feature doctor
uvx new-feature doctor --repair
Project Config
Add config to the target repo's pyproject.toml:
[tool.new-feature]
target_branch = "main"
branch_prefix = "feature/"
agent = ["codex"]
push = false
setup = ["uv sync"]
pre_merge = ["uv run pytest"]
post_merge = ["uv run pytest"]
teardown = []
[tool.new-feature.env]
WEB_PORT = { allocate = "port", min = 3000, max = 3999 }
API_PORT = { allocate = "port", min = 4000, max = 4999 }
DATABASE_NAME = { allocate = "name", prefix = "myapp", max_length = 63 }
CACHE_DIR = { allocate = "path", base = ".new-feature/cache" }
agent is the command and arguments used to launch the coding agent. new-feature appends its
generated feature prompt as the final argument, so agents that require a prompt flag can be configured
directly:
[tool.new-feature]
agent = ["copilot", "--prompt"]
setup runs after worktree creation; teardown runs before worktree removal.
Supported env entries:
{ value = "literal" }{ allocate = "port", min = 3000, max = 3999 }{ allocate = "integer", min = 1, max = 15 }{ allocate = "name", prefix = "myapp", max_length = 63 }{ allocate = "slug", prefix = "myapp" }{ allocate = "path", base = ".new-feature/cache" }
Lifecycle
new-feature my-feature creates .worktrees/my-feature, reserves env values in .new-feature/manifest.toml, runs setup, and launches the configured agent in the worktree. It automatically adds .new-feature/ and .worktrees/ to .gitignore. If setup fails, it runs a forced teardown so the partial worktree, branch, and manifest entry do not linger.
new-feature list shows each managed feature and its current Git/worktree state. new-feature doctor reports stale manifest entries, dirty worktrees, unmerged branches, and configuration drift. doctor --repair removes only manifest entries whose worktree and branch are both already gone.
new-feature merge-feature my-feature runs pre-merge checks in the feature worktree, starts a no-commit merge into the target branch, runs post-merge checks on the merged target checkout, commits the merge only if those checks pass, and pushes only when push = true.
new-feature teardown my-feature runs the configured teardown commands before removing the worktree, deleting the branch, and removing the manifest entry. If the worktree has uncommitted changes or the branch has commits that are not in the target branch, pass --force to abandon them deliberately.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file new_feature-0.3.0.tar.gz.
File metadata
- Download URL: new_feature-0.3.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce8f3cb784985cf9e67a651a0aff39331b14e8d3ebd43d2ce480d0c18a533a92
|
|
| MD5 |
526847053835a2b019882ac59c2e4b5c
|
|
| BLAKE2b-256 |
bd7e0894716dd21c79aa8c74749de28ae3a3697276f2be13c4e8010785290c15
|
Provenance
The following attestation bundles were made for new_feature-0.3.0.tar.gz:
Publisher:
publish.yml on crypdick/new-feature
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
new_feature-0.3.0.tar.gz -
Subject digest:
ce8f3cb784985cf9e67a651a0aff39331b14e8d3ebd43d2ce480d0c18a533a92 - Sigstore transparency entry: 2157689085
- Sigstore integration time:
-
Permalink:
crypdick/new-feature@3590d74cdf70f8f3bae05161c31a622377e4033f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/crypdick
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3590d74cdf70f8f3bae05161c31a622377e4033f -
Trigger Event:
release
-
Statement type:
File details
Details for the file new_feature-0.3.0-py3-none-any.whl.
File metadata
- Download URL: new_feature-0.3.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
053446ab6e2556e3bcb45bb2e313e9596103fb1ff32491b0664e958d29210f2d
|
|
| MD5 |
fcfc2457e05e4c0d26be05fa8af45112
|
|
| BLAKE2b-256 |
28bea241d0380d881d46cf975427d0a1de021c5d190a4984bf1dbe4afd068ac3
|
Provenance
The following attestation bundles were made for new_feature-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on crypdick/new-feature
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
new_feature-0.3.0-py3-none-any.whl -
Subject digest:
053446ab6e2556e3bcb45bb2e313e9596103fb1ff32491b0664e958d29210f2d - Sigstore transparency entry: 2157689269
- Sigstore integration time:
-
Permalink:
crypdick/new-feature@3590d74cdf70f8f3bae05161c31a622377e4033f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/crypdick
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3590d74cdf70f8f3bae05161c31a622377e4033f -
Trigger Event:
release
-
Statement type: