{"_id":"@aspireone/wtm","_rev":"3-59d4ea520475260e595d8ca5c5b62871","name":"@aspireone/wtm","dist-tags":{"latest":"0.1.13"},"versions":{"0.1.10":{"name":"@aspireone/wtm","version":"0.1.10","keywords":["git","worktree","codex","cli"],"license":"UNLICENSED","_id":"@aspireone/wtm@0.1.10","maintainers":[{"name":"aspireone","email":"matejpesl1@gmail.com"}],"bin":{"wtm":"bin/wtm.js"},"dist":{"shasum":"2b55a18bf9c5ac3d5d284246e421a0611acc66a3","tarball":"https://registry.npmjs.org/@aspireone/wtm/-/wtm-0.1.10.tgz","fileCount":16,"integrity":"sha512-+m4v8L0GKLv2kM0ygIa93D9VyTOe+tP62ZS8QkTCiBcbvazPnGhXgCIw8txL7PSkrE5nkGlJVKhOGmbzYBXedw==","signatures":[{"sig":"MEUCIQCWuPFQc2ECgGRqrcKm8Bvzo2nt1E1RUmIJCUIM+x89WwIgFfnm+QYriTmMdfJp5FSkJRsnWUAh5C+rSHdqA9+jVMw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62082},"type":"module","_from":"file:aspireone-wtm-0.1.10.tgz","engines":{"node":">=18"},"scripts":{"wtm":"node ./bin/wtm.js","start":"node ./bin/wtm.js","release":"node ./scripts/release.mjs","pack:check":"node ./scripts/pack-check.mjs","release:major":"node ./scripts/release.mjs major","release:minor":"node ./scripts/release.mjs minor","release:patch":"node ./scripts/release.mjs patch"},"_npmUser":{"name":"aspireone","email":"matejpesl1@gmail.com"},"_resolved":"C:\\Users\\matej\\AppData\\Local\\Temp\\8b2aa1403ba38d8e1be98e808d234e3b\\aspireone-wtm-0.1.10.tgz","_integrity":"sha512-+m4v8L0GKLv2kM0ygIa93D9VyTOe+tP62ZS8QkTCiBcbvazPnGhXgCIw8txL7PSkrE5nkGlJVKhOGmbzYBXedw==","_npmVersion":"11.11.1","description":"Git worktree manager - general worktree management & codex parallelism","directories":{},"_nodeVersion":"24.15.0","dependencies":{"ink":"^7.0.1","toml":"^4.1.1","chalk":"^5.6.2","execa":"^9.6.1","react":"^19.2.5","@inkjs/ui":"^2.0.0","cli-truncate":"^6.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wtm_0.1.10_1776553025261_0.4282451248571657","host":"s3://npm-registry-packages-npm-production"}},"0.1.11":{"name":"@aspireone/wtm","version":"0.1.11","keywords":["git","worktree","codex","cli"],"license":"UNLICENSED","_id":"@aspireone/wtm@0.1.11","maintainers":[{"name":"aspireone","email":"matejpesl1@gmail.com"}],"bin":{"wtm":"bin/wtm.js"},"dist":{"shasum":"44abe81afc575ab265d86cf64989cfd0bdf6efeb","tarball":"https://registry.npmjs.org/@aspireone/wtm/-/wtm-0.1.11.tgz","fileCount":16,"integrity":"sha512-41xER96Pi3dBPd6T7pNB64sLvfENT3IJqpHWXD6oXyud3I+CsUysk+fSFRWu8YnnZHT/cCC5ppha16ebk0ZBmg==","signatures":[{"sig":"MEUCIQCAhirpw7XrrwE46Q+om4xlLFZdzuR1YTKRoL10GqsWzgIgZOjj+cgwCMZDyaMz0ey8Zdjm75TybAE9ZAI7Z0RcqUM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62138},"type":"module","_from":"file:aspireone-wtm-0.1.11.tgz","engines":{"node":">=18"},"scripts":{"wtm":"node ./bin/wtm.js","start":"node ./bin/wtm.js","release":"node ./scripts/release.mjs","pack:check":"node ./scripts/pack-check.mjs","release:major":"node ./scripts/release.mjs major","release:minor":"node ./scripts/release.mjs minor","release:patch":"node ./scripts/release.mjs patch"},"_npmUser":{"name":"aspireone","email":"matejpesl1@gmail.com"},"_resolved":"C:\\Users\\matej\\AppData\\Local\\Temp\\3f371bbd0821270070de9382955ac740\\aspireone-wtm-0.1.11.tgz","_integrity":"sha512-41xER96Pi3dBPd6T7pNB64sLvfENT3IJqpHWXD6oXyud3I+CsUysk+fSFRWu8YnnZHT/cCC5ppha16ebk0ZBmg==","_npmVersion":"11.11.1","description":"Git worktree manager - general worktree management & codex parallelism","directories":{},"_nodeVersion":"24.15.0","dependencies":{"ink":"^7.0.1","toml":"^4.1.1","chalk":"^5.6.2","execa":"^9.6.1","react":"^19.2.5","@inkjs/ui":"^2.0.0","cli-truncate":"^6.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wtm_0.1.11_1776553121714_0.9369449699969945","host":"s3://npm-registry-packages-npm-production"}},"0.1.13":{"name":"@aspireone/wtm","version":"0.1.13","description":"Git worktree manager for isolated branches and parallel automation","type":"module","bin":{"wtm":"bin/wtm.js"},"publishConfig":{"access":"public"},"engines":{"node":">=18"},"keywords":["git","worktree","automation","cli"],"license":"UNLICENSED","dependencies":{"@inkjs/ui":"^2.0.0","chalk":"^5.6.2","cli-truncate":"^6.0.0","execa":"^9.6.1","ink":"^7.0.1","react":"^19.2.5","toml":"^4.1.1"},"scripts":{"start":"node ./bin/wtm.js","wtm":"node ./bin/wtm.js","pack:check":"node ./scripts/pack-check.mjs","release":"node ./scripts/release.mjs","release:patch":"node ./scripts/release.mjs patch","release:minor":"node ./scripts/release.mjs minor","release:major":"node ./scripts/release.mjs major"},"_id":"@aspireone/wtm@0.1.13","_integrity":"sha512-01Z2G4SbAXiviSZ7VBhPCQ6e3b0x/BOTiA1CnQRHxIEwY006nWN1Q7MSK6wFvPBqkchXAE3ja8EGJeIcB8ouOw==","_resolved":"C:\\Users\\matej\\AppData\\Local\\Temp\\ba4371e32507443aa5e6547dbf267086\\aspireone-wtm-0.1.13.tgz","_from":"file:aspireone-wtm-0.1.13.tgz","_nodeVersion":"24.15.0","_npmVersion":"11.11.1","dist":{"integrity":"sha512-01Z2G4SbAXiviSZ7VBhPCQ6e3b0x/BOTiA1CnQRHxIEwY006nWN1Q7MSK6wFvPBqkchXAE3ja8EGJeIcB8ouOw==","shasum":"b8e55b34dddab7896993d570d42f9939d9066f04","tarball":"https://registry.npmjs.org/@aspireone/wtm/-/wtm-0.1.13.tgz","fileCount":16,"unpackedSize":69561,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBz7BfUARrdxOQnZW2ELIZijqnHHj5jl/z78KSaLG59/AiEA70lTGC8n3oQqrmeDMYzlUnTtRZuJ3LCh1RuoTtSqGV0="}]},"_npmUser":{"name":"aspireone","email":"matejpesl1@gmail.com"},"directories":{},"maintainers":[{"name":"aspireone","email":"matejpesl1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wtm_0.1.13_1776618156996_0.4842505290190693"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T22:57:05.177Z","modified":"2026-04-19T17:02:37.262Z","0.1.10":"2026-04-18T22:57:05.408Z","0.1.11":"2026-04-18T22:58:41.850Z","0.1.13":"2026-04-19T17:02:37.140Z"},"license":"UNLICENSED","keywords":["git","worktree","automation","cli"],"description":"Git worktree manager for isolated branches and parallel automation","maintainers":[{"name":"aspireone","email":"matejpesl1@gmail.com"}],"readme":"# wtm\n\nA small, standalone Git worktree manager for creating, preparing, browsing, removing, and merging isolated worktrees.\n\n![wtm demo screenshot](https://github.com/AspireOne/worktree-manager/blob/main/demo-screenshot.png)\n\n## Why\n\nGit worktrees are useful whenever you need multiple independent checkouts of the same repository:\n\n- working on several branches at once\n- testing a fix without disturbing your current checkout\n- reviewing another branch while keeping local work in place\n- running parallel automation or coding-agent sessions in isolated directories\n\nThe raw `git worktree` commands are powerful, but the everyday workflow is repetitive: choose a branch, create a safe directory name, add the worktree, run repo-specific setup, remember where it lives, clean it up later, and merge it back when ready.\n\n`wtm` wraps that workflow in a focused CLI. It creates one worktree per branch under a predictable directory, runs optional setup steps, and provides an interactive terminal UI for managing active worktrees.\n\n## Usage\n\n```bash\nwtm feat/auth-refactor           # create a worktree, run setup, print the path\nwtm fix/login-race --base main   # branch off a specific base branch\nwtm feat/auth-refactor           # already exists? reattach idempotently\nwtm feat/auth-refactor --run codex\nwtm feat/auth-refactor --run \"pnpm dev\"\nwtm feat/auth-refactor --run codex --now\nwtm init                         # write .wtm.config.toml into the current repo\nwtm manage                       # browse, remove, inspect, and merge worktrees\n```\n\nWorktrees are placed under `.trees/` in the repo root by default:\n\n```text\nyour-repo/\n├── .trees/\n│   ├── feat-auth-refactor/    # isolated worktree, own branch\n│   └── fix-login-race/\n└── ...\n```\n\nEach worktree is a normal Git checkout. You can use any editor, terminal, automation, or agent inside it:\n\n```bash\ncd .trees/feat-auth-refactor\n```\n\nThere is also a command runner shortcut:\n\n```bash\nwtm feat/auth-refactor --run codex\nwtm feat/auth-refactor --run \"pnpm dev\"\nwtm feat/auth-refactor --run codex --now\n```\n\n`--run` executes the provided command inside the worktree after setup. Quote commands that contain spaces so your shell passes them as a single option value.\nAdd `--now` / `-n` with `--run` to start setup in the background and run the command immediately.\n\n## Install\n\nRequires Node 18+ and Git. The `wtm manage` merge action requires a Git version with `git merge-tree --write-tree` support.\n\nFor local development from this repo:\n\n```bash\npnpm install\npnpm link --global\n```\n\nTo run the local checkout without linking it globally, use either:\n\n```bash\npnpm wtm -- manage\nnode ./bin/wtm.js manage\n```\n\nTo expose the `wtm` binary globally from your checked-out repo, use `pnpm link --global`. If you later publish this package, installation becomes the usual:\n\n```bash\npnpm add -g @aspireone/wtm\n```\n\nKeep `.trees/` in your repo's `.gitignore`:\n\n```bash\necho \".trees/\" >> .gitignore\n```\n\n## Config\n\n`wtm` looks for config in two places, merged in this order. Higher entries override lower entries.\n\n| File | Scope |\n|---|---|\n| `~/.config/wtm/config.toml` | Global defaults for all repos |\n| `.wtm.config.toml` in the repo root | Per-repo config, commit this |\n\nCLI flags override both.\n\nTo bootstrap a repo-local config file in the current directory, run:\n\n```bash\nwtm init\n```\n\nThis creates `.wtm.config.toml` from the packaged example template and refuses to overwrite an existing file.\n`wtm init` keeps the file shape fixed and only auto-fills the `setup` steps when it can detect them confidently.\n\n**Minimal `.wtm.config.toml`:**\n\n```toml\nbaseBranch   = \"main\"\nworktreeRoot = \".trees\"\n\n# Add repo-specific [[setup]] steps here.\n```\n\n`wtm init` emits high-level setup steps such as `copy` and `run`, so common setup stays readable and portable.\n\n### `init` Detection\n\n`wtm init` does not switch between multiple full templates. It always writes the same config file and only varies the generated `setup` steps:\n\n- if `.env` or `.env.*` files exist anywhere in the repo, it adds `copy` steps for each one\n- if `.env` is not present but `.env.example` exists, it also adds a fallback copy from `.env.example` to `.env`\n- if `package.json` exists and the package manager can be inferred from a lockfile or `packageManager`, it adds the matching `run` install step\n- if neither signal is present, it leaves a placeholder comment for future `[[setup]]` steps\n\nGenerated env copy steps do not overwrite files that already exist in the target worktree.\n\nCurrent package-manager detection order:\n\n- `pnpm-lock.yaml` -> `run = \"pnpm install\"`\n- `package-lock.json` or `npm-shrinkwrap.json` -> `run = \"npm install\"`\n- `yarn.lock` -> `run = \"yarn install\"`\n- `bun.lock` or `bun.lockb` -> `run = \"bun install\"`\n- otherwise, `package.json#packageManager`\n\n### Setup Steps\n\nSetup steps run once after the worktree is created. Three template variables are available:\n\n| Variable | Value |\n|---|---|\n| `{target}` | Absolute path to the new worktree |\n| `{root}` | Absolute path to the repo root |\n| `{branch}` | The branch name, such as `feat/auth-refactor` |\n\nUse `[[setup]]` tables to describe setup actions:\n\n```toml\n[[setup]]\ncopy = \".env\"\n\n[[setup]]\ncopy = \"shared/.env.development\"\n\n[[setup]]\nrun = \"pnpm install\"\n```\n\n`copy` paths are resolved from the repo root and copied to the same relative path under the target worktree. Parent directories are created automatically and existing target files are not overwritten by default.\n\n```toml\n[[setup]]\ncopy = \".env.example\"\nto = \".env\"\noverwrite = true\n```\n\n`run` commands execute in `{target}` by default and use the configured `shell`. A custom working directory can be set with `cwd`.\n\n```toml\n[[setup]]\nrun = \"pnpm exec prisma generate\"\ncwd = \"{target}\"\n```\n\nIf no `setup` is configured, the CLI just creates the worktree and exits.\n\n### All Config Keys\n\n| Key | Default | Description |\n|---|---|---|\n| `baseBranch` | `\"main\"` | Branch to fork from when creating a new branch |\n| `worktreeRoot` | `\".trees\"` | Directory under repo root where worktrees are placed |\n| `shell` | system default | Shell used to run `run` setup steps, such as `\"bash\"` or `\"pwsh\"` |\n| `setup` | `[]` | Ordered list of setup steps to run after worktree creation |\n| `theme` | built-in palette | Optional `[theme]` table for `wtm manage` colors |\n\n### Manage UI Theme\n\nYou can override the interactive manage UI colors from either config file:\n\n```toml\n[theme]\naccent = \"#91a7ff\"\naccentStrong = \"#c1ccff\"\ncontext = \"#aebbd0\"\nsuccess = \"#7fd38b\"\nwarning = \"#f0b85a\"\ndanger = \"#f07f7f\"\ntextPrimary = \"#f4f7fb\"\ntextLabel = \"#cbd7e3\"\ntextMuted = \"#9aa8b7\"\ntextDim = \"#657386\"\n```\n\nThese values map directly to Ink text colors. Named colors, hex colors, `rgb(...)`, and `ansi256(...)` values are supported.\n\n## Behavior\n\n- **Branch exists?** Reused as-is.\n- **Worktree exists?** Reattached, setup skipped.\n- **Worktree registered but directory missing?** Stale entry pruned, worktree recreated.\n- **Setup configured?** Steps run once after a new worktree is created.\n- **`--run <command>` / `-r <command>`?** Runs the command inside the worktree after setup.\n- **`--run <command> --now` / `-r <command> -n`?** Starts setup in the background, then immediately runs the command inside the worktree.\n- **No `--run`?** Prints the worktree path, then exits.\n\n## Manage UI\n\nRun `wtm manage` to open an interactive worktree navigator in the terminal.\n\n- search by branch, path, or HEAD with `/`\n- inspect the selected worktree in a dedicated details pane\n- refresh the inventory with `r`\n- delete the selected worktree with `d`\n- delete the selected worktree and its local branch with `D`\n- merge the selected worktree into the current checkout with `M`\n- quit with `q`\n\nThe main checkout is visible for context but cannot be removed from this screen.\nThe details pane compares each selected worktree against the current checkout and reports commit distance, changed files, and whether Git's static merge check sees conflicts.\n\n`M` is intentionally guarded. It only merges when:\n\n- the current checkout and selected worktree are both on local branches\n- the selected branch has commits that are not already in the current checkout\n- the current checkout is clean\n- no merge, rebase, cherry-pick, revert, or bisect operation is in progress\n- the static merge check reports no conflicts\n- both branch tips are unchanged between the static check and the merge\n\nIf those checks pass, `wtm` runs `git merge --no-edit` against the checked selected commit. If the selected branch has nothing new to merge, the UI reports that and leaves the repository unchanged.\n\n## Package Layout\n\n```text\nbin/wtm.js     npm-exposed executable\nsrc/cli.mjs    CLI entry point\nsrc/           implementation\nscripts/       release automation\npackage.json   npm package metadata\n```\n\n## Release\n\nCreate a new patch release, tag it, and publish it:\n\n```bash\npnpm run release\n```\n\nFor a different bump level:\n\n```bash\npnpm run release -- minor\n```\n\nThe preflight check uses `pnpm pack` in a temporary directory, so it validates the tarball contents locally without failing just because that version already exists on npm or leaving a tarball in the repo.\n","readmeFilename":"README.md"}