@cniska/agent-worktree 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.
- package/README.md +35 -9
- package/bin/agent-worktree +10 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -6,21 +6,39 @@
|
|
|
6
6
|
|
|
7
7
|
agent-worktree never works out what a checkout needs: `agent-worktree install` writes the setup and teardown commands and the port count the project gives it into hooks, and agent-worktree runs those.
|
|
8
8
|
|
|
9
|
-
- `agent-worktree create <name>` makes a git worktree outside the repository, on a new branch cut from `origin`'s default branch as `origin` has it now, runs the project's setup hook in it, and prints its path.
|
|
10
|
-
- `agent-worktree remove <name>` runs the project's teardown hook, removes the worktree, and once its remote's default branch has the branch, deletes it locally and
|
|
9
|
+
- `agent-worktree create <name>` makes a git worktree outside the repository, on a new branch cut from `origin`'s default branch as `origin` has it now, runs the project's setup hook in it, and prints its path in its result.
|
|
10
|
+
- `agent-worktree remove <name>` runs the project's teardown hook, removes the worktree, and once its remote's default branch has the branch, deletes it locally and on that remote: its upstream or, with none, the branch of the same name on `origin`, other than `origin`'s default branch. When the remote branch holds a commit the branch lacks, it keeps both copies.
|
|
11
11
|
- The `cniska-worktree` Claude Code plugin sends Claude Code's own worktrees through the same commands.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
agent-worktree
|
|
15
|
+
Install the `agent-worktree` command for macOS on Apple silicon or Linux on x64 through one of these channels.
|
|
16
|
+
|
|
17
|
+
With the release's installer:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -fsSL https://github.com/cniska/agent-worktree/releases/latest/download/install.sh | sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
With Homebrew:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
brew install cniska/tap/agent-worktree
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
With npm:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install -g @cniska/agent-worktree
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
With Bun:
|
|
16
36
|
|
|
17
37
|
```bash
|
|
18
|
-
|
|
19
|
-
cd agent-worktree
|
|
20
|
-
mise trust && mise install
|
|
38
|
+
bun add -g @cniska/agent-worktree
|
|
21
39
|
```
|
|
22
40
|
|
|
23
|
-
|
|
41
|
+
The curl line installs `~/.local/bin/agent-worktree` and, when that directory is not on your `PATH`, adds it to `~/.zshrc` for zsh or to an existing `~/.bashrc` or `~/.bash_profile` for bash, and otherwise asks you to add it. Each channel updates the way it installed: `brew upgrade agent-worktree`, `npm update -g @cniska/agent-worktree`, `bun update -g @cniska/agent-worktree`, or the curl line run again.
|
|
24
42
|
|
|
25
43
|
Then install the Claude Code plugin:
|
|
26
44
|
|
|
@@ -42,10 +60,10 @@ Claude Code makes worktrees of its own, for EnterWorktree and for subagents, wit
|
|
|
42
60
|
| `agent-worktree create [--from <ref>] <name>` | Create the worktree, run setup, print the path |
|
|
43
61
|
| `agent-worktree remove [--force] <name>` | Run teardown, remove the worktree and settle its branch |
|
|
44
62
|
| `agent-worktree prune` | Tear down gone worktrees and remove those whose branch landed |
|
|
45
|
-
| `agent-worktree ls` |
|
|
63
|
+
| `agent-worktree ls [--full]` | Count the worktrees in each state and list them; also what `agent-worktree` alone prints |
|
|
46
64
|
| `agent-worktree path <name>` | Print the worktree's path |
|
|
47
65
|
|
|
48
|
-
[Commands](docs/commands.md) lists every command, where `create` cuts a branch and how `remove` settles one.
|
|
66
|
+
Each command prints its result, or its error, as one [TOON](https://toonformat.dev) document. [Commands](docs/commands.md) lists every command and its output, where `create` cuts a branch and how `remove` settles one.
|
|
49
67
|
|
|
50
68
|
## Docs
|
|
51
69
|
|
|
@@ -54,3 +72,11 @@ Claude Code makes worktrees of its own, for EnterWorktree and for subagents, wit
|
|
|
54
72
|
- [Claude Code plugin](docs/plugin.md): what the plugin does and what it needs.
|
|
55
73
|
- [Development](docs/development.md): setup, checks, layout and rules, for working on this repo.
|
|
56
74
|
- [Releasing](docs/releasing.md): the release workflow, the owner's one-time setup and each release's steps.
|
|
75
|
+
|
|
76
|
+
## Related
|
|
77
|
+
|
|
78
|
+
agent-worktree works on its own in any agent workflow, and is one of the optional add-ons to [agent-skills](https://github.com/cniska/agent-skills), engineering skills for coding agents. The other add-ons:
|
|
79
|
+
|
|
80
|
+
- [agent-task](https://github.com/cniska/agent-task): task tracking for coding agents, the tasks running, in review and waiting to run
|
|
81
|
+
- [agent-record](https://github.com/cniska/agent-record): a session record for coding agents, every past session queryable and joined to its commits
|
|
82
|
+
- [agent-gates](https://github.com/cniska/agent-gates): commit gates for coding agents, git hooks and CI checks that refuse a bad commit
|
package/bin/agent-worktree
CHANGED
|
@@ -5,8 +5,13 @@ builds='darwin-arm64 linux-x64'
|
|
|
5
5
|
name=agent-worktree
|
|
6
6
|
scope=@cniska
|
|
7
7
|
|
|
8
|
+
quoted() {
|
|
9
|
+
printf '"%s"' "$(printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g')"
|
|
10
|
+
}
|
|
11
|
+
|
|
8
12
|
refuse() {
|
|
9
|
-
printf '%s: %s\n %s\n'
|
|
13
|
+
printf 'command: %s\nok: false\nerror:\n kind: refusal\n code: %s\n message: %s\n meta:\n resolve: %s\n' \
|
|
14
|
+
"$name" "$1" "$(quoted "$2")" "$(quoted "$3")" >&2
|
|
10
15
|
exit 1
|
|
11
16
|
}
|
|
12
17
|
|
|
@@ -34,9 +39,9 @@ target=$os-$cpu
|
|
|
34
39
|
|
|
35
40
|
case " $builds " in
|
|
36
41
|
*" $target "*) ;;
|
|
37
|
-
*) refuse \
|
|
42
|
+
*) refuse no_build_for_platform \
|
|
38
43
|
"$name ships no build for $target, only $(printf '%s' "$builds" | sed 's/ / and /g')" \
|
|
39
|
-
"build $name from source with Bun, as its
|
|
44
|
+
"build $name from source with Bun, as its docs/development.md says" ;;
|
|
40
45
|
esac
|
|
41
46
|
|
|
42
47
|
package=$scope/$name-$target
|
|
@@ -47,9 +52,9 @@ for dir in "$bin/../node_modules/$package" "$bin/../../$name-$target"; do
|
|
|
47
52
|
break
|
|
48
53
|
fi
|
|
49
54
|
done
|
|
50
|
-
[ -n "$binary" ] || refuse \
|
|
55
|
+
[ -n "$binary" ] || refuse platform_package_missing \
|
|
51
56
|
"$package is not installed beside $scope/$name" \
|
|
52
57
|
"reinstall $scope/$name with optional dependencies enabled"
|
|
53
|
-
[ -x "$binary" ] || refuse "$binary is not executable" "reinstall $scope/$name"
|
|
58
|
+
[ -x "$binary" ] || refuse binary_not_executable "$binary is not executable" "reinstall $scope/$name"
|
|
54
59
|
|
|
55
60
|
exec "$binary" "$@"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cniska/agent-worktree",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Task worktrees for coding agents: one checkout per task, set up and torn down by the project's own commands.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/cniska/agent-worktree",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"bin/agent-worktree"
|
|
26
26
|
],
|
|
27
27
|
"optionalDependencies": {
|
|
28
|
-
"@cniska/agent-worktree-darwin-arm64": "0.
|
|
29
|
-
"@cniska/agent-worktree-linux-x64": "0.
|
|
28
|
+
"@cniska/agent-worktree-darwin-arm64": "0.2.0",
|
|
29
|
+
"@cniska/agent-worktree-linux-x64": "0.2.0"
|
|
30
30
|
}
|
|
31
31
|
}
|