docs: update README/AGENTS for current codebase state

- README: added --host flag, toolchain check commands, docker output fix
- AGENTS: documented --host bind address behavior, macOS bcopy fix,
  check-toolchain scripts, updated architecture tree
This commit is contained in:
2026-06-21 22:00:08 -07:00
parent e671320bbb
commit ca0cd10436
2 changed files with 35 additions and 9 deletions
+12 -2
View File
@@ -16,6 +16,7 @@ mise run electron-deps # installs electron + electron-builder
mise run electron-dev # runs electron in dev mode
mise run docker-up # docker compose up --build
mise run lint # go vet ./...
mise run check-all # verify gcc, brew, mise, go, node, docker, colima
```
## Build & Run (manual)
@@ -26,9 +27,10 @@ go build -buildvcs=false -o fetch . # → ./fetch
# Build and run web server
./fetch serve # → starts on free port, opens browser
./fetch serve --host 0.0.0.0 -p 8080 # → Docker / network-accessible mode
# Docker
docker compose up --build # serves on :8080
docker compose up --build # serves on :8080, binds 0.0.0.0
# Electron dev
(cd electron && npm install)
@@ -44,11 +46,14 @@ GOOS=darwin GOARCH=amd64 go build -o fetch-darwin-amd64 .
Single binary (`fetch`) with subcommands. No external Go dependencies — pure stdlib.
```
main.go CLI entry, commands (search/list/download/extract/pipeline)
main.go CLI entry, commands (search/list/download/extract/pipeline/serve)
serve.go HTTP server + REST API + embedded web UI (embed.FS)
web/ui/ Static frontend (index.html, style.css, app.js)
electron/ Electron wrapper shell
scripts/ Bash helpers called via exec
├── extract_wavs.sh batch WAV extraction via akaiutil
├── check-toolchain.sh verify gcc, brew, mise, go, node
└── check-docker-toolchain.sh verify docker, compose, colima
third_party/ Vendored akaiutil C binary (GPLv2)
```
@@ -61,6 +66,7 @@ third_party/ Vendored akaiutil C binary (GPLv2)
- **Script discovery**: `serve.go:findScript()` — tries multiple candidate paths, fallback chain
- **Zero-deps web UI**: vanilla JS, no bundler, no framework. API calls use `fetch()` + `EventSource`
- **Embed directive**: `//go:embed web/ui/*` in `serve.go` — frontend baked into the binary
- **Bind address handling**: `serve.go:37``--host` flag defaults to `127.0.0.1` for local dev; set `--host 0.0.0.0` for Docker. When binding to `0.0.0.0`, prints both `localhost` and `<host-ip>` URLs for clarity.
### akaiutil integration
@@ -72,6 +78,10 @@ third_party/ Vendored akaiutil C binary (GPLv2)
All akaiutil calls use `-r` (read-only) flag. Write operations (S900 compress, partitioning, tagging) require removing `-r`.
### macOS compatibility
- `third_party/akaiutil/commoninclude.h` has `bcopy`/`bzero` declarations guarded with `#ifdef _VISUALCPC` to avoid conflicts with macOS system headers that define these in `<strings.h>`.
### Electron integration
`electron/main.js` spawns the Go binary in `serve` mode: