Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions ui/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 17 additions & 15 deletions ui/text/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,35 @@ https://github.com/aaif-goose/goose/discussions/7309

## Running

The TUI automatically launches the goose ACP server using the `goose acp` command.
The TUI launches the goose ACP server by spawning `goose acp`. Which binary it spawns is resolved by `@aaif/goose-sdk`:

### Development (from source)

When running from source, `npm start` automatically builds the Rust binary from the workspace root if needed:
1. the `GOOSE_BINARY` environment variable, if set, otherwise
2. the platform's prebuilt `@aaif/goose-binary-*` package (an optional dependency of the pinned `@aaif/goose-sdk`).

```bash
cd ui/text
npm i
npm run start
pnpm install # pulls the pinned @aaif/goose-sdk and its matching @aaif/goose-binary-* package
pnpm start # tsx src/tui.tsx — runs against the released binary, no Rust build
```

The `dev:binary` script checks if the Rust binary needs rebuilding by comparing timestamps of:
- `target/release/goose` binary
- `Cargo.toml` and `Cargo.lock`
- `crates/goose-cli/Cargo.toml`
The TUI pins a specific `@aaif/goose-sdk` version, so `pnpm start` always runs against a goose binary that matches the SDK.

### Building goose from local source

To test local Rust changes, run the dev launcher directly. It builds a debug binary (`cargo build -p goose-cli` → `target/debug/goose`) from the workspace root and points the TUI at it via `GOOSE_BINARY`:

If any source files are newer, it runs `cargo build --release -p goose-cli` automatically.
```bash
node scripts/dev-start.mjs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Invoke the dev launcher through pnpm

In a normal checkout where tsx is only installed as this package's devDependency, running this exact node scripts/dev-start.mjs command does not add node_modules/.bin to PATH; the launcher later calls execFileSync("tsx", ...) in ui/text/scripts/dev-start.mjs, so the documented local-source flow builds the Rust binary and then fails with ENOENT unless the user happens to have a global tsx. Please document a pnpm/npm script or pnpm exec invocation, or make the launcher resolve the local tsx binary itself.

Useful? React with 👍 / 👎.

```

### Production (with prebuilt binaries)
If your changes touch the ACP schema, also point the TUI at the in-repo SDK so the two stay matched: set `@aaif/goose-sdk` to `workspace:*` in `package.json` and re-run `pnpm install`. Otherwise the locally built binary may not match the pinned published SDK's schema. Revert that change before committing — the TUI is meant to stay frozen on its pinned SDK version.

In production, the TUI uses prebuilt binaries from the `@aaif/goose-binary-*` packages installed via `postinstall`.
To run any other prebuilt binary, set `GOOSE_BINARY=/path/to/goose` and use `pnpm start`.

### Custom server URL

To use a custom server URL instead of the built-in binary:
To connect to an already-running server instead of spawning a binary:

```bash
npm run start -- --server http://localhost:8080
pnpm start -- --server http://localhost:8080
```
4 changes: 2 additions & 2 deletions ui/text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
],
"scripts": {
"build": "tsc",
"start": "node scripts/dev-start.mjs",
"start": "tsx src/tui.tsx",
"lint": "tsc --noEmit"
},
"dependencies": {
"@aaif/goose-sdk": "workspace:*",
"@aaif/goose-sdk": "0.20.2",
"@agentclientprotocol/sdk": "^0.19.0",
"@inkjs/ui": "^2.0.0",
"ink": "^6.8.0",
Expand Down
Loading