@sven1103/opencode-worktree-workflow 0.1.0 → 0.3.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 +66 -5
- package/package.json +1 -1
- package/src/index.js +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
## Install in an OpenCode project
|
|
6
6
|
|
|
7
|
-
Add the
|
|
7
|
+
Add the package as a project dependency, following the official docs style:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@sven1103/opencode-worktree-workflow": "^0.2.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then reference the installed package from your OpenCode config:
|
|
8
18
|
|
|
9
19
|
```json
|
|
10
20
|
{
|
|
@@ -13,7 +23,56 @@ Add the plugin package to your project config:
|
|
|
13
23
|
}
|
|
14
24
|
```
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
Keeping the npm dependency in `package.json` makes the installation more durable even if shared `opencode.json` bundles overwrite plugin entries.
|
|
27
|
+
|
|
28
|
+
If you do not already install dependencies in your project, you can add the package directly with npm:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install @sven1103/opencode-worktree-workflow
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Install slash commands
|
|
35
|
+
|
|
36
|
+
OpenCode loads custom commands from either `.opencode/commands/` (project) or `~/.config/opencode/commands/` (global).
|
|
37
|
+
|
|
38
|
+
This repo publishes `wt-new.md` and `wt-clean.md` as GitHub Release assets so you can install them without browsing the repository.
|
|
39
|
+
|
|
40
|
+
Project install (latest release):
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
mkdir -p .opencode/commands
|
|
44
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md" -o ".opencode/commands/wt-new.md"
|
|
45
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md" -o ".opencode/commands/wt-clean.md"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
mkdir -p .opencode/commands
|
|
50
|
+
wget -qO ".opencode/commands/wt-new.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md"
|
|
51
|
+
wget -qO ".opencode/commands/wt-clean.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Global install (latest release):
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
mkdir -p ~/.config/opencode/commands
|
|
58
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md" -o "$HOME/.config/opencode/commands/wt-new.md"
|
|
59
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md" -o "$HOME/.config/opencode/commands/wt-clean.md"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
mkdir -p ~/.config/opencode/commands
|
|
64
|
+
wget -qO "$HOME/.config/opencode/commands/wt-new.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md"
|
|
65
|
+
wget -qO "$HOME/.config/opencode/commands/wt-clean.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Pinned to a specific release tag:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
VERSION=v0.1.0
|
|
72
|
+
mkdir -p .opencode/commands
|
|
73
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/download/${VERSION}/wt-new.md" -o ".opencode/commands/wt-new.md"
|
|
74
|
+
curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/download/${VERSION}/wt-clean.md" -o ".opencode/commands/wt-clean.md"
|
|
75
|
+
```
|
|
17
76
|
|
|
18
77
|
## What the plugin provides
|
|
19
78
|
|
|
@@ -31,7 +90,7 @@ You can override the defaults in `opencode.json`, `opencode.jsonc`, or `.opencod
|
|
|
31
90
|
"worktreeWorkflow": {
|
|
32
91
|
"branchPrefix": "wt/",
|
|
33
92
|
"remote": "origin",
|
|
34
|
-
"worktreeRoot": "
|
|
93
|
+
"worktreeRoot": ".worktrees/$REPO",
|
|
35
94
|
"cleanupMode": "preview",
|
|
36
95
|
"protectedBranches": ["release"]
|
|
37
96
|
}
|
|
@@ -54,9 +113,11 @@ Typical release flow:
|
|
|
54
113
|
|
|
55
114
|
1. Publish the package once manually to create it on npm.
|
|
56
115
|
2. Configure the package's trusted publisher on npm for `.github/workflows/publish.yml`.
|
|
57
|
-
3.
|
|
116
|
+
3. Run the `Prepare Release` workflow from `main` with a version like `0.2.0`.
|
|
117
|
+
|
|
118
|
+
The release workflow creates a `release/v<version>` branch from `main`, updates `package.json` and `package-lock.json`, commits the version bump there, creates a matching `v<version>` tag, and pushes the branch and tag.
|
|
58
119
|
|
|
59
|
-
The
|
|
120
|
+
The release workflow then explicitly starts the publish workflow for that tag, which verifies the tag matches `package.json` before running `npm publish` using OIDC, without storing an `NPM_TOKEN` secret. Merge the release branch back to `main` afterward if you want the version bump recorded on the default branch.
|
|
60
121
|
|
|
61
122
|
## Local development
|
|
62
123
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED