@sven1103/opencode-worktree-workflow 0.1.0 → 0.2.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.
Files changed (2) hide show
  1. package/README.md +47 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -15,6 +15,49 @@ Add the plugin package to your project config:
15
15
 
16
16
  OpenCode installs npm plugins with Bun when it starts.
17
17
 
18
+ ## Install slash commands
19
+
20
+ OpenCode loads custom commands from either `.opencode/commands/` (project) or `~/.config/opencode/commands/` (global).
21
+
22
+ This repo publishes `wt-new.md` and `wt-clean.md` as GitHub Release assets so you can install them without browsing the repository.
23
+
24
+ Project install (latest release):
25
+
26
+ ```sh
27
+ mkdir -p .opencode/commands
28
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md" -o ".opencode/commands/wt-new.md"
29
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md" -o ".opencode/commands/wt-clean.md"
30
+ ```
31
+
32
+ ```sh
33
+ mkdir -p .opencode/commands
34
+ wget -qO ".opencode/commands/wt-new.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md"
35
+ wget -qO ".opencode/commands/wt-clean.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md"
36
+ ```
37
+
38
+ Global install (latest release):
39
+
40
+ ```sh
41
+ mkdir -p ~/.config/opencode/commands
42
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md" -o "$HOME/.config/opencode/commands/wt-new.md"
43
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md" -o "$HOME/.config/opencode/commands/wt-clean.md"
44
+ ```
45
+
46
+ ```sh
47
+ mkdir -p ~/.config/opencode/commands
48
+ wget -qO "$HOME/.config/opencode/commands/wt-new.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-new.md"
49
+ wget -qO "$HOME/.config/opencode/commands/wt-clean.md" "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/latest/download/wt-clean.md"
50
+ ```
51
+
52
+ Pinned to a specific release tag:
53
+
54
+ ```sh
55
+ VERSION=v0.1.0
56
+ mkdir -p .opencode/commands
57
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/download/${VERSION}/wt-new.md" -o ".opencode/commands/wt-new.md"
58
+ curl -fsSL "https://github.com/sven1103-agent/opencode-worktree-plugin/releases/download/${VERSION}/wt-clean.md" -o ".opencode/commands/wt-clean.md"
59
+ ```
60
+
18
61
  ## What the plugin provides
19
62
 
20
63
  - `worktree_prepare`: create a worktree and matching branch from the latest default-branch commit
@@ -54,9 +97,11 @@ Typical release flow:
54
97
 
55
98
  1. Publish the package once manually to create it on npm.
56
99
  2. Configure the package's trusted publisher on npm for `.github/workflows/publish.yml`.
57
- 3. Tag a release like `v0.1.0` and push the tag.
100
+ 3. Run the `Prepare Release` workflow from `main` with a version like `0.2.0`.
101
+
102
+ 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
103
 
59
- The GitHub Actions workflow then runs `npm publish` using OIDC, without storing an `NPM_TOKEN` secret.
104
+ 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
105
 
61
106
  ## Local development
62
107
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sven1103/opencode-worktree-workflow",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "OpenCode plugin for creating and cleaning up git worktrees.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",