gnhf 0.1.8 → 0.1.10

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 -10
  2. package/dist/cli.mjs +837 -114
  3. package/package.json +5 -4
package/README.md CHANGED
@@ -18,10 +18,10 @@
18
18
  src="https://img.shields.io/github/actions/workflow/status/kunchenguid/gnhf/release-please.yml?style=flat-square&label=release"
19
19
  /></a>
20
20
  <a
21
- href="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue?style=flat-square"
21
+ href="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square"
22
22
  ><img
23
23
  alt="Platform"
24
- src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux-blue?style=flat-square"
24
+ src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-blue?style=flat-square"
25
25
  /></a>
26
26
  <a href="https://x.com/kunchenguid"
27
27
  ><img
@@ -47,6 +47,7 @@ You wake up to a branch full of clean work and a log of everything that happened
47
47
  - **Dead simple** — one command starts an autonomous loop that runs until you Ctrl+C or a configured runtime cap is reached
48
48
  - **Long running** — each iteration is committed on success, rolled back on failure, with sensible retries and exponential backoff
49
49
  - **Agent-agnostic** — works with Claude Code, Codex, Rovo Dev, or OpenCode out of the box
50
+ - **Terminal-safe rendering** — the live UI keeps wide Unicode text such as emoji and CJK glyphs aligned instead of clipping or shifting the frame
50
51
 
51
52
  ## Quick Start
52
53
 
@@ -63,6 +64,7 @@ $ gnhf "reduce complexity of the codebase without changing functionality" \
63
64
  ```
64
65
 
65
66
  Run `gnhf` from inside a Git repository with a clean working tree. If you are starting from a plain directory, run `git init` first.
67
+ `gnhf` supports macOS, Linux, and Windows.
66
68
 
67
69
  ## Install
68
70
 
@@ -143,12 +145,13 @@ npm link
143
145
 
144
146
  ### Flags
145
147
 
146
- | Flag | Description | Default |
147
- | ---------------------- | ---------------------------------------------------------- | ---------------------- |
148
- | `--agent <agent>` | Agent to use (`claude`, `codex`, `rovodev`, or `opencode`) | config file (`claude`) |
149
- | `--max-iterations <n>` | Abort after `n` total iterations | unlimited |
150
- | `--max-tokens <n>` | Abort after `n` total input+output tokens | unlimited |
151
- | `--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
+ | `--prevent-sleep <mode>` | Prevent system sleep during the run (`on`/`off` or `true`/`false`) | config file (`on`) |
154
+ | `--version` | Show version | |
152
155
 
153
156
  ## Configuration
154
157
 
@@ -160,11 +163,24 @@ agent: claude
160
163
 
161
164
  # Abort after this many consecutive failures
162
165
  maxConsecutiveFailures: 3
166
+
167
+ # Prevent the machine from sleeping during a run
168
+ preventSleep: true
163
169
  ```
164
170
 
165
171
  If the file does not exist yet, `gnhf` creates it on first run using the resolved defaults.
166
172
 
167
- CLI flags override config file values. The iteration and token caps are runtime-only flags and are not persisted in `config.yml`.
173
+ CLI flags override config file values. `--prevent-sleep` accepts `on`/`off` as well as `true`/`false`; the config file always uses a boolean.
174
+ The iteration and token caps are runtime-only flags and are not persisted in `config.yml`.
175
+ When sleep prevention is enabled, `gnhf` uses the native mechanism for your OS: `caffeinate` on macOS, `systemd-inhibit` on Linux, and a small PowerShell helper backed by `SetThreadExecutionState` on Windows.
176
+
177
+ ## Debug Logs
178
+
179
+ Set `GNHF_DEBUG_LOG_PATH` to capture lifecycle events as JSONL while debugging a run:
180
+
181
+ ```sh
182
+ GNHF_DEBUG_LOG_PATH=/tmp/gnhf-debug.jsonl gnhf "ship it"
183
+ ```
168
184
 
169
185
  ## Agents
170
186
 
@@ -182,7 +198,8 @@ CLI flags override config file values. The iteration and token caps are runtime-
182
198
  ```sh
183
199
  npm run build # Build with tsdown
184
200
  npm run dev # Watch mode
185
- npm test # Run tests (vitest)
201
+ npm test # Build, then run unit tests (vitest)
202
+ npm run test:e2e # Build, then run end-to-end tests against the mock opencode executable
186
203
  npm run lint # ESLint
187
204
  npm run format # Prettier
188
205
  ```