gnhf 0.1.5 → 0.1.7

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 (3) hide show
  1. package/README.md +27 -9
  2. package/dist/cli.mjs +1135 -55
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -42,15 +42,22 @@
42
42
  gnhf is a [ralph](https://ghuntley.com/ralph/), [autoresearch](https://github.com/karpathy/autoresearch)-style orchestrator that keeps your agents running while you sleep — each iteration makes one small, committed, documented change towards an objective.
43
43
  You wake up to a branch full of clean work and a log of everything that happened.
44
44
 
45
- - **Dead simple** — one command starts an autonomous loop that runs until you Ctrl+C
45
+ - **Dead simple** — one command starts an autonomous loop that runs until you Ctrl+C or a configured runtime cap is reached
46
46
  - **Long running** — each iteration is committed on success, rolled back on failure, with sensible retries and exponential backoff
47
- - **Agent-agnostic** — works with Claude Code or Codex out of the box
47
+ - **Agent-agnostic** — works with Claude Code, Codex, Rovo Dev, or OpenCode out of the box
48
48
 
49
49
  ## Quick Start
50
50
 
51
51
  ```sh
52
52
  $ gnhf "reduce complexity of the codebase without changing functionality"
53
- # go to sleep
53
+ # have a good sleep
54
+ ```
55
+
56
+ ```sh
57
+ $ gnhf "reduce complexity of the codebase without changing functionality" \
58
+ --max-iterations 10 \
59
+ --max-tokens 5000000
60
+ # have a good nap
54
61
  ```
55
62
 
56
63
  Run `gnhf` from inside a Git repository with a clean working tree. If you are starting from a plain directory, run `git init` first.
@@ -73,6 +80,10 @@ npm run build
73
80
  npm link
74
81
  ```
75
82
 
83
+ If you want to run `gnhf --agent rovodev`, install Atlassian's `acli` and authenticate it with Rovo Dev first.
84
+
85
+ If you want to run `gnhf --agent opencode`, install `opencode` and authenticate at least one provider first.
86
+
76
87
  ## How It Works
77
88
 
78
89
  ```
@@ -118,6 +129,7 @@ npm link
118
129
  ```
119
130
 
120
131
  - **Incremental commits** — each successful iteration is a separate git commit, so you can cherry-pick or revert individual changes
132
+ - **Runtime caps** — `--max-iterations` stops before the next iteration begins, while `--max-tokens` can abort mid-iteration once reported usage reaches the cap; uncommitted work is rolled back in either case
121
133
  - **Shared memory** — the agent reads `notes.md` (built up from prior iterations) to communicate across iterations
122
134
  - **Local run metadata** — gnhf stores prompt, notes, and resume metadata under `.gnhf/runs/` and ignores it locally, so your branch only contains intentional work
123
135
  - **Resume support** — run `gnhf` while on an existing `gnhf/` branch to pick up where a previous run left off
@@ -133,17 +145,19 @@ npm link
133
145
 
134
146
  ### Flags
135
147
 
136
- | Flag | Description | Default |
137
- | ----------------- | ---------------------------------- | ---------------------- |
138
- | `--agent <agent>` | Agent to use (`claude` or `codex`) | config file (`claude`) |
139
- | `--version` | Show version | |
148
+ | Flag | Description | Default |
149
+ | ---------------------- | ---------------------------------------------------------- | ---------------------- |
150
+ | `--agent <agent>` | Agent to use (`claude`, `codex`, `rovodev`, or `opencode`) | config file (`claude`) |
151
+ | `--max-iterations <n>` | Abort after `n` total iterations | unlimited |
152
+ | `--max-tokens <n>` | Abort after `n` total input+output tokens | unlimited |
153
+ | `--version` | Show version | |
140
154
 
141
155
  ## Configuration
142
156
 
143
157
  Config lives at `~/.gnhf/config.yml`:
144
158
 
145
159
  ```yaml
146
- # Agent to use by default
160
+ # Agent to use by default (claude, codex, rovodev, or opencode)
147
161
  agent: claude
148
162
 
149
163
  # Abort after this many consecutive failures
@@ -152,7 +166,11 @@ maxConsecutiveFailures: 3
152
166
 
153
167
  If the file does not exist yet, `gnhf` creates it on first run using the resolved defaults.
154
168
 
155
- CLI flags override config file values.
169
+ CLI flags override config file values. The iteration and token caps are runtime-only flags and are not persisted in `config.yml`.
170
+
171
+ When using `agent: rovodev`, `gnhf` starts a local `acli rovodev serve --disable-session-token <port>` process automatically in the repo workspace. That requires `acli` to be installed and already authenticated for Rovo Dev.
172
+
173
+ When using `agent: opencode`, `gnhf` starts a local `opencode serve --hostname 127.0.0.1 --port <port> --print-logs` process automatically, creates a per-run session for the target workspace, and applies a blanket `{"permission":"*","pattern":"*","action":"allow"}` rule so tool calls do not block on prompts. That requires the `opencode` CLI to be installed and already configured with a usable model provider.
156
174
 
157
175
  ## Development
158
176