### Install Project with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Execute 'make install' to install the project's binary to your system's PATH. It installs to $GOPATH/bin or /usr/local/bin. ```sh make install # Install to $GOPATH/bin or /usr/local/bin ``` -------------------------------- ### Install Treehouse from Source Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Clone the repository and build the installable binary. ```sh git clone https://github.com/kunchenguid/treehouse.git cd treehouse make install ``` -------------------------------- ### Install Treehouse with Go Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Install the Treehouse CLI using Go. ```sh go install github.com/kunchenguid/treehouse@latest ``` -------------------------------- ### Quick Start with Treehouse Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Enter an isolated worktree for development and exit when done. ```sh cd myproject # start in your repo as usual treehouse # get a worktree and drop into a subshell 🌳 Entered worktree at ~/.treehouse/myproject-a1b2c3/1/myproject. Type 'exit' to return. # You're now in an isolated worktree. # Run your AI agent, make changes, do whatever you need. exit # exit the subshell when you're done 🌳 Terminated lingering processes: opencode (pid 12345) 🌳 Worktree returned to pool. ``` -------------------------------- ### Install Treehouse on macOS/Linux Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Install Treehouse using a curl script. ```sh curl -fsSL https://kunchenguid.github.io/treehouse/install.sh | sh ``` -------------------------------- ### Install Treehouse on Windows (PowerShell) Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Install Treehouse using PowerShell. ```powershell irm https://kunchenguid.github.io/treehouse/install.ps1 | iex ``` -------------------------------- ### TOML Configuration Example Source: https://github.com/kunchenguid/treehouse/blob/main/CLAUDE.md This TOML snippet shows how to configure project settings like 'max_trees' and define 'hooks' for post-creation and pre-destruction actions. User-level configuration can include an optional worktree root. ```toml max_trees = 16 # Optional worktree root. # Relative roots need a repo context; use an absolute user-level root for global prune. # root = "$HOME/worktrees" # User-level config only: [hooks] post_create = ["./scripts/setup-venv.sh"] pre_destroy = ["./scripts/teardown.sh"] ``` -------------------------------- ### Clone Repository and Build Project Source: https://github.com/kunchenguid/treehouse/blob/main/CONTRIBUTING.md Clone the Treehouse repository, navigate to the project directory, and build the project. This is the initial setup step for contributors. ```sh git clone https://github.com/kunchenguid/treehouse.git cd treehouse make build make test ``` -------------------------------- ### Install Treehouse with Nix Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Install Treehouse directly using Nix or add it to your Nix flake inputs. ```nix nix run github:kunchenguid/treehouse ``` ```nix treehouse = { url = "github:kunchenguid/treehouse"; inputs.nixpkgs.follows = "nixpkgs"; }; ``` -------------------------------- ### Acquire a leased worktree and capture its path Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Use `treehouse get --lease` to acquire a worktree that is durably leased. The absolute path of the leased worktree is printed to stdout, while other messages go to stderr. This is useful when you need a worktree to persist without an active subshell. ```bash path=$(treehouse get --lease) # $path is the leased worktree's absolute path; all banners went to stderr. ``` -------------------------------- ### Build Binary with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Use 'make build' to compile the project's binary. This command is essential for creating an executable version of the project. ```sh make build # Build the binary ``` -------------------------------- ### Cross-Compile for All Platforms with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Use 'make dist' for cross-compiling the project for all supported platforms. This is useful for creating distributable binaries. ```sh make dist # Cross-compile for all platforms ``` -------------------------------- ### Build Treehouse CLI Source: https://github.com/kunchenguid/treehouse/blob/main/CLAUDE.md Build the Treehouse CLI tool using the Go build command or the provided Makefile. ```sh go build -o treehouse . ``` ```sh make build ``` -------------------------------- ### Run Tests with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Execute 'make test' to run all defined tests for the project. This ensures code quality and functionality. ```sh make test # Run tests ``` -------------------------------- ### Lint Code with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Run 'make lint' to apply code formatting (gofmt) and static analysis (govet). This command helps maintain code consistency and identify potential issues. ```sh make lint # Run gofmt + govet ``` -------------------------------- ### Test Treehouse Source: https://github.com/kunchenguid/treehouse/blob/main/CLAUDE.md Run tests for the Treehouse project using Go's testing framework or the Makefile. ```sh go test ./... ``` ```sh make test ``` -------------------------------- ### Clean Build Artifacts with Make Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Run 'make clean' to remove all build artifacts. This command is useful for ensuring a clean build environment. ```sh make clean # Remove build artifacts ``` -------------------------------- ### Build Treehouse CLI Source: https://github.com/kunchenguid/treehouse/blob/main/AGENTS.md Builds the Treehouse CLI executable. Use this command to compile the tool for local use. ```sh go build -o treehouse . # or make build ``` -------------------------------- ### Configure Worktree Hooks Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Define commands to run automatically at worktree lifecycle points. Hooks are configured in the user-level `~/.config/treehouse/config.toml` file under the `[hooks]` section. Repo-level hooks are ignored. ```toml [hooks] post_create = ["./scripts/setup-venv.sh"] pre_destroy = ["./scripts/teardown.sh"] ``` -------------------------------- ### Destroying a specific worktree with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes exactly one worktree. Pass --yes to execute the destruction after reviewing the preview. ```bash treehouse destroy --yes ``` -------------------------------- ### Destroying all worktrees in a specific pool with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes all worktrees in a specified pool. Pass --yes to execute the destruction after reviewing the preview. ```bash treehouse destroy --all --yes ``` -------------------------------- ### Test Treehouse Project Source: https://github.com/kunchenguid/treehouse/blob/main/AGENTS.md Runs all tests within the Treehouse project. This command is useful for verifying the integrity of the codebase. ```sh go test ./... # or make test ``` -------------------------------- ### Pruning stale worktrees globally (dry run) Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Inspects every managed pool under the user-level treehouse root from any directory. This is a dry run. ```bash treehouse prune --all ``` -------------------------------- ### Destroying a specific worktree (dry run) Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Targets exactly one worktree for destruction. This is a dry run and shows a risk-revealing preview. ```bash treehouse destroy ``` -------------------------------- ### Configure Maximum Worktrees Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Set the maximum number of worktrees allowed in the pool. This configuration is typically placed in `treehouse.toml` or `~/.config/treehouse/config.toml`. ```toml # Maximum number of worktrees in the pool max_trees = 16 # Optional worktree root directory. # Empty uses $HOME/.treehouse. # Relative paths are resolved from the repo root for repo-scoped commands. # Use an absolute user-level root for treehouse prune --all. # root = "$HOME/worktrees" ``` -------------------------------- ### Replacing old --force flag for single worktree destruction Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Replaces the deprecated `treehouse destroy --force` command. Use specific --include flags as needed. ```bash treehouse destroy --yes ``` ```bash treehouse destroy --yes --include-unlanded ``` ```bash treehouse destroy --yes --include-in-use ``` ```bash treehouse destroy --yes --include-leased ``` -------------------------------- ### Replacing old --force flag for bulk worktree destruction Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Replaces the deprecated `treehouse destroy --all --force` command. Use specific --include flags as needed for bulk operations within a pool. ```bash treehouse destroy --all --yes ``` ```bash treehouse destroy --all --yes --include-unlanded ``` ```bash treehouse destroy --all --yes --include-in-use ``` -------------------------------- ### Destroying all worktrees in a specific pool (dry run) Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Targets all worktrees in a specified pool for destruction. The pool path can be the pool directory, a worktree inside it, or the repository. This is a dry run. ```bash treehouse destroy --all ``` -------------------------------- ### Destroying worktrees including leased worktrees with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Removes a leased worktree. This option is only applicable when naming the exact worktree path and never with --all. ```bash treehouse destroy --yes --include-leased ``` -------------------------------- ### Dry run of pruning stale worktrees Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Lists stale idle managed worktrees that would be deleted and shows the reclaimable disk space. Run this command inside a git repository. ```bash treehouse prune ``` -------------------------------- ### Destroying all worktrees including in-use worktrees with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Removes all worktrees in a pool, including those with a running process or owner reservation. Their processes are terminated cleanly first. ```bash treehouse destroy --all --yes --include-in-use ``` -------------------------------- ### Destroying worktrees including in-use worktrees with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Removes worktrees with a running process or owner reservation. Their processes are terminated cleanly first. ```bash treehouse destroy --yes --include-in-use ``` -------------------------------- ### Pruning stale worktrees globally and pruning orphans with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes stale idle managed worktrees and true backing-repository-missing orphans. This command inspects every managed pool under the user-level treehouse root from any directory. ```bash treehouse prune --all --prune-orphans --yes ``` -------------------------------- ### Pruning stale worktrees globally and pruning orphans (dry run) Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes stale idle managed worktrees and true backing-repository-missing orphans. This command inspects every managed pool under the user-level treehouse root from any directory. ```bash treehouse prune --all --prune-orphans ``` -------------------------------- ### Destroying all worktrees including unlanded work with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Removes all worktrees in a pool, including those with uncommitted changes, a HEAD not merged into the default branch, or contents treehouse cannot verify. This is an irreversible action. ```bash treehouse destroy --all --yes --include-unlanded ``` -------------------------------- ### Pruning stale worktrees with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes stale idle managed worktrees. This command should be run inside a git repository. ```bash treehouse prune --yes ``` -------------------------------- ### Destroying worktrees including unlanded work with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Removes worktrees with uncommitted changes, a HEAD not merged into the default branch, or contents treehouse cannot verify. This is an irreversible action. ```bash treehouse destroy --yes --include-unlanded ``` -------------------------------- ### Pruning stale worktrees globally with confirmation Source: https://github.com/kunchenguid/treehouse/blob/main/README.md Deletes stale idle managed worktrees across all pools. This command inspects every managed pool under the user-level treehouse root from any directory. ```bash treehouse prune --all --yes ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.