gitclaw 0.3.0 → 0.3.1
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 +48 -26
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,49 +37,57 @@ Most agent frameworks treat configuration as code scattered across your applicat
|
|
|
37
37
|
|
|
38
38
|
Fork an agent. Branch a personality. `git log` your agent's memory. Diff its rules. This is **agents as repos**.
|
|
39
39
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
### CLI
|
|
40
|
+
## Install
|
|
43
41
|
|
|
44
42
|
```bash
|
|
45
43
|
npm install -g gitclaw
|
|
44
|
+
```
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
**Run your first agent in one line:**
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
```bash
|
|
51
|
+
export OPENAI_API_KEY="sk-..."
|
|
52
|
+
gitclaw --dir ~/my-project "Explain this project and suggest improvements"
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
That's it. Gitclaw auto-scaffolds everything on first run
|
|
56
|
-
- `git init` if not already a repo
|
|
57
|
-
- Creates `agent.yaml`, `SOUL.md`, `memory/MEMORY.md`
|
|
58
|
-
- Commits the scaffold
|
|
59
|
-
- Drops you into the REPL
|
|
55
|
+
That's it. Gitclaw auto-scaffolds everything on first run — `agent.yaml`, `SOUL.md`, `memory/` — and drops you into the agent.
|
|
60
56
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Tools: cli, read, write, memory
|
|
68
|
-
→ List all files and explain the project
|
|
57
|
+
### Local Repo Mode
|
|
58
|
+
|
|
59
|
+
Clone a GitHub repo, run an agent on it, auto-commit and push to a session branch:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
gitclaw --repo https://github.com/org/repo --pat ghp_xxx "Fix the login bug"
|
|
69
63
|
```
|
|
70
64
|
|
|
71
|
-
|
|
65
|
+
Resume an existing session:
|
|
72
66
|
|
|
73
67
|
```bash
|
|
74
|
-
gitclaw
|
|
68
|
+
gitclaw --repo https://github.com/org/repo --pat ghp_xxx --session gitclaw/session-a1b2c3d4 "Continue"
|
|
75
69
|
```
|
|
76
70
|
|
|
77
|
-
|
|
71
|
+
Token can come from env instead of `--pat`:
|
|
78
72
|
|
|
79
73
|
```bash
|
|
80
|
-
|
|
74
|
+
export GITHUB_TOKEN=ghp_xxx
|
|
75
|
+
gitclaw --repo https://github.com/org/repo "Add unit tests"
|
|
81
76
|
```
|
|
82
77
|
|
|
78
|
+
### CLI Options
|
|
79
|
+
|
|
80
|
+
| Flag | Short | Description |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| `--dir <path>` | `-d` | Agent directory (default: cwd) |
|
|
83
|
+
| `--repo <url>` | `-r` | GitHub repo URL to clone and work on |
|
|
84
|
+
| `--pat <token>` | | GitHub PAT (or set `GITHUB_TOKEN` / `GIT_TOKEN`) |
|
|
85
|
+
| `--session <branch>` | | Resume an existing session branch |
|
|
86
|
+
| `--model <provider:model>` | `-m` | Override model (e.g. `anthropic:claude-sonnet-4-5-20250929`) |
|
|
87
|
+
| `--sandbox` | `-s` | Run in sandbox VM |
|
|
88
|
+
| `--prompt <text>` | `-p` | Single-shot prompt (skip REPL) |
|
|
89
|
+
| `--env <name>` | `-e` | Environment config |
|
|
90
|
+
|
|
83
91
|
### SDK
|
|
84
92
|
|
|
85
93
|
```bash
|
|
@@ -87,7 +95,7 @@ npm install gitclaw
|
|
|
87
95
|
```
|
|
88
96
|
|
|
89
97
|
```typescript
|
|
90
|
-
import { query
|
|
98
|
+
import { query } from "gitclaw";
|
|
91
99
|
|
|
92
100
|
// Simple query
|
|
93
101
|
for await (const msg of query({
|
|
@@ -98,6 +106,18 @@ for await (const msg of query({
|
|
|
98
106
|
if (msg.type === "delta") process.stdout.write(msg.content);
|
|
99
107
|
if (msg.type === "assistant") console.log("\n\nDone.");
|
|
100
108
|
}
|
|
109
|
+
|
|
110
|
+
// Local repo mode via SDK
|
|
111
|
+
for await (const msg of query({
|
|
112
|
+
prompt: "Fix the login bug",
|
|
113
|
+
model: "openai:gpt-4o-mini",
|
|
114
|
+
repo: {
|
|
115
|
+
url: "https://github.com/org/repo",
|
|
116
|
+
token: process.env.GITHUB_TOKEN!,
|
|
117
|
+
},
|
|
118
|
+
})) {
|
|
119
|
+
if (msg.type === "delta") process.stdout.write(msg.content);
|
|
120
|
+
}
|
|
101
121
|
```
|
|
102
122
|
|
|
103
123
|
## SDK
|
|
@@ -209,6 +229,8 @@ for await (const msg of query({
|
|
|
209
229
|
| `replaceBuiltinTools` | `boolean` | Skip cli/read/write/memory |
|
|
210
230
|
| `allowedTools` | `string[]` | Tool name allowlist |
|
|
211
231
|
| `disallowedTools` | `string[]` | Tool name denylist |
|
|
232
|
+
| `repo` | `LocalRepoOptions` | Clone a GitHub repo and work on a session branch |
|
|
233
|
+
| `sandbox` | `SandboxOptions \| boolean` | Run in sandbox VM (mutually exclusive with `repo`) |
|
|
212
234
|
| `hooks` | `GCHooks` | Programmatic lifecycle hooks |
|
|
213
235
|
| `maxTurns` | `number` | Max agent turns |
|
|
214
236
|
| `abortController` | `AbortController` | Cancellation signal |
|