santree 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Santiago Toscanini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,25 @@
1
- # Santree
1
+ <p align="center">
2
+ <img src="assets/icon.png" alt="Santree" width="200" />
3
+ </p>
2
4
 
3
- A beautiful CLI for managing Git worktrees with Linear and GitHub integration.
5
+ <h1 align="center">Santree</h1>
4
6
 
5
- Built with [React](https://react.dev/), [Ink](https://github.com/vadimdemedes/ink), and [Pastel](https://github.com/vadimdemedes/pastel).
7
+ <p align="center">
8
+ <strong>A beautiful CLI for managing Git worktrees</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/santree"><img src="https://img.shields.io/npm/v/santree.svg" alt="npm version"></a>
13
+ <a href="https://www.npmjs.com/package/santree"><img src="https://img.shields.io/npm/dm/santree.svg" alt="npm downloads"></a>
14
+ <a href="https://github.com/stoscanini/santree/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/santree.svg" alt="license"></a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ Create, switch, and manage Git worktrees with ease.<br/>
19
+ Integrates with GitHub PRs and Linear tickets via Claude AI.
20
+ </p>
21
+
22
+ ---
6
23
 
7
24
  ## Installation
8
25
 
@@ -10,106 +27,83 @@ Built with [React](https://react.dev/), [Ink](https://github.com/vadimdemedes/in
10
27
  npm install -g santree
11
28
  ```
12
29
 
13
- ## Requirements
14
-
15
- ### Required
30
+ ### Shell Setup (Required)
16
31
 
17
- | Tool | Version | Purpose | Installation |
18
- |------|---------|---------|--------------|
19
- | **Node.js** | >= 20 | Runtime | [nodejs.org](https://nodejs.org/) or `brew install node` |
20
- | **Git** | Any recent | Worktree operations | [git-scm.com](https://git-scm.com/) or `brew install git` |
21
- | **GitHub CLI** | Any recent | PR creation, status, cleanup | `brew install gh` then `gh auth login` |
22
- | **tmux** | Any recent | Create worktrees in new windows | `brew install tmux` |
23
- | **Claude Code** | Any recent | AI coding assistant | `npm install -g @anthropic-ai/claude-code` |
24
- | **Happy** | - | Claude CLI wrapper | Your custom wrapper around Claude Code |
25
- | **Linear MCP** | - | Linear ticket context | See below |
26
-
27
- ### Setup
28
-
29
- #### GitHub CLI
30
-
31
- After installing, authenticate with GitHub:
32
+ Add to your `.zshrc` or `.bashrc`:
32
33
 
33
34
  ```bash
34
- brew install gh
35
- gh auth login
35
+ eval "$(santree shell-init zsh)" # for zsh
36
+ eval "$(santree shell-init bash)" # for bash
36
37
  ```
37
38
 
38
- #### Happy (Claude Integration)
39
-
40
- The `santree work` command uses Happy to launch Claude with ticket context. Happy should be configured with the Linear MCP server to fetch ticket details.
39
+ This enables automatic directory switching after `create` and `switch` commands.
41
40
 
42
- #### Linear MCP Server
41
+ ---
43
42
 
44
- Add the Linear MCP server to your Claude configuration for ticket integration:
43
+ ## Quick Start
45
44
 
46
45
  ```bash
47
- claude mcp add --transport http linear https://mcp.linear.app/mcp
48
- ```
46
+ # Create a new worktree and switch to it
47
+ santree create feature/my-new-feature
49
48
 
50
- This enables Claude to fetch Linear ticket details and comments when using `santree work`.
49
+ # List all worktrees with PR status
50
+ santree list
51
51
 
52
- ## Features
52
+ # Switch to another worktree
53
+ santree switch main
54
+
55
+ # Clean up worktrees with merged PRs
56
+ santree clean
57
+ ```
53
58
 
54
- - **Worktree Management**: Create, switch, list, and remove Git worktrees
55
- - **Linear Integration**: Extract ticket IDs from branch names for Claude AI workflows
56
- - **GitHub Integration**: View PR status, create PRs, and clean up merged branches
57
- - **Claude AI Integration**: Launch Claude with context about your current ticket
58
- - **Beautiful UI**: Animated spinners, colored output, and box-styled layouts
59
+ ---
59
60
 
60
61
  ## Commands
61
62
 
62
63
  | Command | Description |
63
64
  |---------|-------------|
64
- | `santree list` | List all worktrees with status, PR info, and commits ahead |
65
+ | `santree list` | List all worktrees with PR status and commits ahead |
65
66
  | `santree create <branch>` | Create a new worktree from base branch |
66
67
  | `santree switch <branch>` | Switch to another worktree |
67
68
  | `santree remove <branch>` | Remove a worktree and its branch |
68
- | `santree sync` | Sync current worktree with base branch (merge by default) |
69
+ | `santree sync` | Sync current worktree with base branch |
69
70
  | `santree setup` | Run the init script (`.santree/init.sh`) |
70
- | `santree work` | Launch Claude to work on the current ticket |
71
+ | `santree work` | Launch Claude AI to work on the current ticket |
71
72
  | `santree clean` | Remove worktrees with merged/closed PRs |
72
73
 
73
- ## Options
74
+ ---
74
75
 
75
- ### create
76
- - `--base <branch>` - Base branch to create from (default: main/master)
77
- - `--work` - Launch Claude after creating
78
- - `--plan` - With --work, only create implementation plan
79
- - `--no-pull` - Skip pulling latest changes
76
+ ## Features
80
77
 
81
- ### sync
82
- - `--rebase` - Use rebase instead of merge
78
+ ### Worktree Management
79
+ Create isolated worktrees for each feature branch. No more stashing or committing WIP code just to switch tasks.
83
80
 
84
- ### work
85
- - `--plan` - Only create implementation plan
81
+ ### GitHub Integration
82
+ See PR status directly in your worktree list. Clean up worktrees automatically when PRs are merged or closed.
83
+
84
+ ### Claude AI Integration
85
+ Launch Claude with full context about your current ticket using `santree work`. Supports different modes:
86
+ - `--plan` - Create an implementation plan only
86
87
  - `--review` - Review changes against ticket requirements
87
- - `--fix-pr` - Fetch PR comments and fix them
88
+ - `--fix-pr` - Address PR review comments
88
89
 
89
- ### remove
90
- - `--force` - Force removal even with uncommitted changes
90
+ ### Init Scripts
91
+ Run custom setup scripts when creating worktrees. Perfect for copying `.env` files, installing dependencies, or any project-specific setup.
91
92
 
92
- ### clean
93
- - `--dry-run` - Show what would be removed without removing
94
- - `--force` - Skip confirmation prompt
93
+ ---
95
94
 
96
- ## Setup
95
+ ## Configuration
97
96
 
98
97
  ### Init Script
99
98
 
100
- Create `.santree/init.sh` in your repository root to run custom setup when creating worktrees:
99
+ Create `.santree/init.sh` in your repository root:
101
100
 
102
101
  ```bash
103
102
  #!/bin/bash
104
- # Example: Copy .env, install dependencies, etc.
105
103
  cp "$SANTREE_REPO_ROOT/.env" "$SANTREE_WORKTREE_PATH/.env"
106
104
  npm install
107
105
  ```
108
106
 
109
- Environment variables available:
110
- - `SANTREE_WORKTREE_PATH` - Path to the new worktree
111
- - `SANTREE_REPO_ROOT` - Path to the main repository
112
-
113
107
  ### Branch Naming
114
108
 
115
109
  For Linear integration, use branch names with ticket IDs:
@@ -119,48 +113,55 @@ user/TEAM-123-feature-description
119
113
  feature/PROJ-456-add-auth
120
114
  ```
121
115
 
122
- ## Development
116
+ ### Linear MCP (for Claude integration)
123
117
 
124
118
  ```bash
125
- # Install dependencies
126
- npm install
127
-
128
- # Build
129
- npm run build
130
-
131
- # Lint
132
- npm run lint
133
-
134
- # Run locally
135
- node dist/cli.js <command>
119
+ claude mcp add --transport http linear https://mcp.linear.app/mcp
136
120
  ```
137
121
 
138
- ## CI/CD
122
+ ---
139
123
 
140
- This project uses GitHub Actions for continuous integration and deployment.
124
+ ## Command Options
141
125
 
142
- ### Workflows
143
-
144
- - **CI** (`ci.yml`): Runs on every push and PR to `main`. Builds the project and runs linting.
145
- - **Release** (`release.yml`): Publishes to npm when a GitHub release is created.
146
-
147
- ### Setting Up npm Publishing
126
+ ### create
127
+ | Option | Description |
128
+ |--------|-------------|
129
+ | `--base <branch>` | Base branch to create from (default: main/master) |
130
+ | `--work` | Launch Claude after creating |
131
+ | `--plan` | With --work, only create implementation plan |
132
+ | `--no-pull` | Skip pulling latest changes |
133
+ | `--tmux` | Open worktree in new tmux window |
148
134
 
149
- 1. Generate an npm access token:
150
- - Go to [npmjs.com](https://www.npmjs.com/) → Account → Access Tokens
151
- - Create a new **Granular Access Token** with publish permissions
135
+ ### sync
136
+ | Option | Description |
137
+ |--------|-------------|
138
+ | `--rebase` | Use rebase instead of merge |
152
139
 
153
- 2. Add the token to GitHub:
154
- - Go to your repo → Settings → Secrets and variables → Actions
155
- - Create a new secret named `NPM_TOKEN` with your token
140
+ ### remove
141
+ | Option | Description |
142
+ |--------|-------------|
143
+ | `--force` | Force removal even with uncommitted changes |
156
144
 
157
- ### Creating a Release
145
+ ### clean
146
+ | Option | Description |
147
+ |--------|-------------|
148
+ | `--dry-run` | Show what would be removed |
149
+ | `--force` | Skip confirmation prompt |
158
150
 
159
- 1. Update the version in `package.json`
160
- 2. Commit and push to `main`
151
+ ### work
152
+ | Option | Description |
153
+ |--------|-------------|
154
+ | `--plan` | Only create implementation plan |
155
+ | `--review` | Review changes against requirements |
156
+ | `--fix-pr` | Fetch and fix PR comments |
161
157
 
162
- The workflow automatically detects version changes, publishes to npm, creates a git tag, and generates a GitHub release.
158
+ ---
163
159
 
164
- ## Shell Integration
160
+ ## Requirements
165
161
 
166
- The shell wrapper in `alias.zsh` handles directory switching for `create` and `switch` commands, since child processes cannot change the parent shell's directory.
162
+ | Tool | Purpose |
163
+ |------|---------|
164
+ | Node.js >= 20 | Runtime |
165
+ | Git | Worktree operations |
166
+ | GitHub CLI (`gh`) | PR integration |
167
+ | tmux | Optional: new window support |
package/dist/cli.js CHANGED
@@ -1,9 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import Pastel from "pastel";
3
+ import { createRequire } from "module";
4
+ const require = createRequire(import.meta.url);
5
+ const { version } = require("../package.json");
3
6
  const app = new Pastel({
4
7
  importMeta: import.meta,
5
8
  name: "santree",
6
- version: "1.0.0",
9
+ version,
7
10
  description: "Beautiful CLI for managing Git worktrees",
8
11
  });
9
12
  await app.run();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "santree",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Git worktree manager with Linear integration",
5
5
  "license": "MIT",
6
6
  "author": "Santiago Toscanini",