Skip to main content

Create isolated feature worktrees with allocated runtime environments.

Project description

new-feature

new-feature creates isolated git worktree environments for feature work, allocates conflict-free runtime values, and launches an interactive Codex session in the new worktree.

Usage

uvx new-feature my-feature
uvx new-feature merge-feature my-feature
uvx new-feature teardown my-feature
uvx new-feature teardown my-feature --force

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" }

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 interactive Codex in the worktree. It automatically adds .new-feature/ and .worktrees/ to .gitignore.

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 teardown commands, removes the worktree, deletes the branch, and removes the manifest entry. If the feature has not gone through merge-feature, pass --force to abandon it deliberately.

Generated State

The generated manifest is a single ignored TOML file in the main checkout:

.new-feature/manifest.toml
.new-feature/manifest.lock

The manifest stores all active feature env allocations, so ports, names, paths, and namespaces can be reserved without scanning generated worktrees.

Publishing

See docs/PUBLISHING.md for PyPI release setup and verification.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

new_feature-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

new_feature-0.1.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file new_feature-0.1.0.tar.gz.

File metadata

  • Download URL: new_feature-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for new_feature-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6e31d0d7071cb61c056815c7a3b895b8da1ba761c9b398aea3047e557b3c6640
MD5 594f814b491c58e152afb786d9601509
BLAKE2b-256 4507222a7c0e0dbf2603dfd5e592649a0b4aabaa064e9c6f471d361a48a34b8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for new_feature-0.1.0.tar.gz:

Publisher: publish.yml on crypdick/new-feature

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file new_feature-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: new_feature-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for new_feature-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9b1b548483bedf535642728e13aa055d8c818f5537f6dec44b52b1dbb11032
MD5 48f3c93f9179e35f7395e730552d1687
BLAKE2b-256 34ae231fc8549c04ca0e07637c48e1162001d2294d3328c5cf462beb41062623

See more details on using hashes here.

Provenance

The following attestation bundles were made for new_feature-0.1.0-py3-none-any.whl:

Publisher: publish.yml on crypdick/new-feature

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page