workon 3.3.0 → 3.4.0
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/README.md +85 -13
- package/dist/cli.js +1329 -683
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,17 +54,23 @@ workon --help
|
|
|
54
54
|
|
|
55
55
|
## Quick Start
|
|
56
56
|
|
|
57
|
-
1. **
|
|
57
|
+
1. **Add your first project:**
|
|
58
58
|
```bash
|
|
59
|
-
|
|
59
|
+
cd ~/code/myproject
|
|
60
|
+
workon add . # Register current directory as a project
|
|
60
61
|
```
|
|
61
62
|
|
|
62
|
-
2. **
|
|
63
|
+
2. **Or use interactive mode:**
|
|
64
|
+
```bash
|
|
65
|
+
workon # Start interactive setup wizard
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3. **Switch to a project:**
|
|
63
69
|
```bash
|
|
64
70
|
workon myproject # Automatically cd + open IDE
|
|
65
71
|
```
|
|
66
72
|
|
|
67
|
-
|
|
73
|
+
4. **List available projects:**
|
|
68
74
|
```bash
|
|
69
75
|
workon config list
|
|
70
76
|
```
|
|
@@ -116,6 +122,23 @@ workon config set projects.myapp.events.ide true
|
|
|
116
122
|
|
|
117
123
|
## Usage Examples
|
|
118
124
|
|
|
125
|
+
### Adding Projects
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Add current directory as a project
|
|
129
|
+
cd ~/code/myproject
|
|
130
|
+
workon add .
|
|
131
|
+
|
|
132
|
+
# Add with a custom name
|
|
133
|
+
workon add . --name my-awesome-project
|
|
134
|
+
|
|
135
|
+
# Add with specific IDE
|
|
136
|
+
workon add . --ide idea
|
|
137
|
+
|
|
138
|
+
# Add a project from any path
|
|
139
|
+
workon add ~/code/another-project
|
|
140
|
+
```
|
|
141
|
+
|
|
119
142
|
### Basic Project Switching
|
|
120
143
|
```bash
|
|
121
144
|
# Switch to project (changes directory + opens IDE)
|
|
@@ -127,6 +150,21 @@ workon myproject --shell
|
|
|
127
150
|
# code "/path/to/myproject" &
|
|
128
151
|
```
|
|
129
152
|
|
|
153
|
+
### Colon Syntax (Run Specific Events)
|
|
154
|
+
|
|
155
|
+
Use the colon syntax to run only specific events for a project:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Run only the cwd event (just change directory)
|
|
159
|
+
workon myproject:cwd
|
|
160
|
+
|
|
161
|
+
# Run multiple specific events
|
|
162
|
+
workon myproject:cwd,ide
|
|
163
|
+
|
|
164
|
+
# Show available events for a project
|
|
165
|
+
workon myproject:help
|
|
166
|
+
```
|
|
167
|
+
|
|
130
168
|
### Branch-Specific Configuration
|
|
131
169
|
```bash
|
|
132
170
|
# Configure different settings for a git branch
|
|
@@ -135,29 +173,63 @@ workon myproject#feature-branch
|
|
|
135
173
|
|
|
136
174
|
### Git Worktrees
|
|
137
175
|
|
|
138
|
-
Manage git worktrees with full tmux integration:
|
|
176
|
+
Manage git worktrees with full tmux integration. There are two commands:
|
|
177
|
+
|
|
178
|
+
- `workon worktrees` - Manage worktrees (run from the **main repository**)
|
|
179
|
+
- `workon worktree` - Operate on the **current worktree** you're inside
|
|
180
|
+
|
|
181
|
+
#### Managing Worktrees (from main repo)
|
|
139
182
|
|
|
140
183
|
```bash
|
|
141
|
-
|
|
142
|
-
|
|
184
|
+
cd ~/code/myproject
|
|
185
|
+
|
|
186
|
+
# Show interactive worktree menu
|
|
187
|
+
workon worktrees
|
|
188
|
+
|
|
189
|
+
# List worktrees
|
|
190
|
+
workon worktrees list
|
|
143
191
|
|
|
144
192
|
# Create a new worktree
|
|
145
|
-
workon worktrees add
|
|
193
|
+
workon worktrees add feature-branch
|
|
146
194
|
|
|
147
195
|
# Open workon session in a worktree (creates tmux session)
|
|
148
|
-
workon worktrees open
|
|
196
|
+
workon worktrees open feature-branch
|
|
149
197
|
|
|
150
198
|
# Remove a worktree
|
|
151
|
-
workon worktrees remove
|
|
199
|
+
workon worktrees remove feature-branch
|
|
152
200
|
|
|
153
201
|
# Merge worktree branch and remove
|
|
154
|
-
workon worktrees merge
|
|
202
|
+
workon worktrees merge feature-branch
|
|
155
203
|
|
|
156
204
|
# Create branch from detached HEAD (for PR workflow)
|
|
157
|
-
workon worktrees branch
|
|
205
|
+
workon worktrees branch my-worktree new-branch-name --push
|
|
158
206
|
```
|
|
159
207
|
|
|
160
|
-
|
|
208
|
+
#### Operating on Current Worktree (from inside a worktree)
|
|
209
|
+
|
|
210
|
+
When you're inside a worktree, use `workon worktree` (singular):
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cd ~/code/myproject/.worktrees/feature-branch
|
|
214
|
+
|
|
215
|
+
# Show status of current worktree
|
|
216
|
+
workon worktree
|
|
217
|
+
workon worktree status
|
|
218
|
+
|
|
219
|
+
# Merge this worktree's branch into main/master
|
|
220
|
+
workon worktree merge
|
|
221
|
+
|
|
222
|
+
# Remove this worktree (shows instructions to exit first)
|
|
223
|
+
workon worktree remove
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
If you run `workon worktrees` from inside a worktree, you'll get a helpful error directing you to use `workon worktree` instead.
|
|
227
|
+
|
|
228
|
+
#### Notes
|
|
229
|
+
|
|
230
|
+
- If you run worktree commands from an unregistered git repository, workon will prompt you to register it first
|
|
231
|
+
- Worktrees created by workon are stored in `.worktrees/` inside the project
|
|
232
|
+
- External worktrees (created elsewhere) show as "(external)" in the list
|
|
161
233
|
|
|
162
234
|
#### Post-Setup Hook
|
|
163
235
|
|