The repository separates model I/O, tool execution, runtime orchestration, terminal presentation, and this website. The index below describes maintained source and configuration files; generated output, dependency trees, local credentials, and Git internals are excluded.
Folder structure
cli-agent/
├── apps/
│ └── web/ Next.js landing page and MDX docs
│ ├── app/ App Router pages, layout, and CSS
│ ├── components/ Search, previews, code, and diagrams
│ ├── content/docs/ MDX guides
│ ├── lib/ Navigation and server content helpers
│ ├── public/diagrams/ Downloadable Mermaid .mmd sources
│ ├── scripts/ Content validation
│ └── tests/ Browser interaction tests
├── packages/
│ ├── ai/ Provider adapters and authentication
│ │ └── src/
│ │ ├── auth/ Keys, OAuth, stores, and CLI imports
│ │ ├── providers/ Wire protocol implementations
│ │ ├── fixtures/ Recorded streaming bytes
│ │ └── testing/ Deterministic provider test helpers
│ ├── core/ Loop, context, storage, and extensions
│ │ └── src/
│ │ ├── agents/ Roles, workers, and worktrees
│ │ └── evals/ Task suite and runner
│ ├── tools/ Local tools, validation, and MCP
│ │ └── src/permissions/ Live policy and enforcement
│ ├── cli/ Entrypoint, sessions, and consumers
│ │ └── src/ui/ Differential terminal interface
│ ├── eslint-config/ Shared lint presets
│ └── typescript-config/ Shared compiler presets
└── scripts/ Repository documentation and verificationWhere to make a change
| Task | Start here |
|---|---|
| Add a provider | packages/ai/src/providers, then factory.ts |
| Change authentication | packages/ai/src/auth |
| Add a tool | packages/tools/src, then the tool factory |
| Change permission policy | packages/tools/src/permissions |
| Change turn execution | packages/core/src/loop.ts |
| Change worker scheduling | packages/core/src/agents/worker-manager.ts |
| Change saved session behavior | packages/core/src/sessions.ts and CLI controller |
| Change a terminal interaction | packages/cli/src/ui/interactive.ts |
| Change a guide | apps/web/content/docs |
| Change website visuals | apps/web/app/globals.css and components |
File-by-file reference
Search by path or responsibility, then open a group. Descriptions use explicit mappings, source comments, exported symbols, and test suite names. Links point to the corresponding repository path; new local files become available online after you push them.
333 of 333 maintained files
.gitignore1 files
.gitignoreExclude dependencies, generated builds, local secrets, runtime state, and temporary artifacts from version control.
AGENTS.md1 files
AGENTS.mdRepository-specific contributor instructions, including the requirement to read installed Turborepo docs before changing tasks.
apps/web77 files
apps/web/.gitignoreKeep Next.js output, TypeScript caches, and Playwright artifacts out of version control.
apps/web/app/docs/[[...slug]]/page.tsxGenerate MDX guide routes, metadata, grouped navigation, contents links, and adjacent-page controls.
apps/web/app/globals.cssShared color and typography tokens, landing/docs styles, responsive layouts, focus states, and reduced-motion rules.
apps/web/app/icon.svgOriginal terminal-prompt favicon.
apps/web/app/layout.tsxRoot HTML shell, metadata, self-hosted fonts, shared header, and global stylesheet.
apps/web/app/not-found.tsxRecoverable 404 page with links to documentation and home.
apps/web/app/page.tsxLanding page: interactive terminal workflows, features, providers, source installation, and FAQ.
apps/web/app/redesign.cssredesign.css supports App Router routes, root layout, metadata, and responsive global styles..
apps/web/app/robots.tsPublic crawler rules for the documentation website.
apps/web/components/brand.tsxReusable original Agent wordmark and terminal-prompt SVG.
apps/web/components/code-block.tsxServer-side Shiki highlighting, code copying, and Mermaid fence detection.
apps/web/components/copy-button.tsxClipboard button with explicit copied and failure feedback.
apps/web/components/diagram.tsxRead an allowed local .mmd asset on the server and expose rendered/source/download views.
apps/web/components/file-reference.tsxSearch and group the checked-in source inventory with repository links.
apps/web/components/header.tsxShared site navigation, source link, and server-populated documentation search.
apps/web/components/mermaid.tsxLazy, strictly secured Mermaid rendering with serialized work, captions, source, and fallback.
apps/web/components/provider-switcher.tsxProvider connectivity tabs with requirements and copyable command examples.
apps/web/components/REHEARSAL.mdGold: Stageshow 1.1.1 `static-card`. Kept the masked composition and one dominant product surface; changed the subject to the actual Agent terminal workflow and used the kit's terminal Window. The reference was bundled and captured locally before the final visual pass. States: Explore, Build, Review
apps/web/components/search.tsxKeyboard-accessible full-text guide search in a native modal dialog.
apps/web/components/stageshow/act.tsDefines Act, Script, Stopped, ActEnv, createAct, checkSeam for stageshow consumers.
apps/web/components/stageshow/clock.tsDefines ClockControl, clock, installVirtualClock for stageshow consumers.
apps/web/components/stageshow/cursor.csscursor.css supports apps/web/components/stageshow.
apps/web/components/stageshow/cursor.tsxDefines CursorKind, CursorStyle, Cursor, ripple for stageshow consumers.
apps/web/components/stageshow/cursors.tsxDefines MacPointer, MacIbeam, MacCrosshair, MacPointingHand, MacOpenHand, MacGrab, MacWait for stageshow consumers.
apps/web/components/stageshow/ease.tsDefines Bezier, EASE, EaseName, css, bezier, startSlope for stageshow consumers.
apps/web/components/stageshow/keys.csskeys.css supports apps/web/components/stageshow.
apps/web/components/stageshow/keys.tsxDefines KeysAt, Keys, capsOf, Keycaps for stageshow consumers.
apps/web/components/stageshow/looks.tsDefines Theme, Palette, Fidelity, Layout, Look, LookContext, useLook for stageshow consumers.
apps/web/components/stageshow/measure.tsDefines Point, Rect, Target, EMPTY, nameOf, inset, box for stageshow consumers.
apps/web/components/stageshow/NOTICE.mdVendored from [benjitaylor/skills — Stageshow](https://github.com/benjitaylor/skills/tree/main/stageshow), skill version 1.1.1. Its package declares MIT licensing. Only the Stage and terminal Window dependency closure is retained. Original implementation comments remain in the source. The host's int
apps/web/components/stageshow/reduced-motion.tsDefines StillContext, useReducedMotion for stageshow consumers.
apps/web/components/stageshow/stage.cssstage.css supports apps/web/components/stageshow.
apps/web/components/stageshow/stage.tsxDefines Play, LookTokens, StageProps, Stage for stageshow consumers.
apps/web/components/stageshow/util.tsDefines isDev, warn, clamp, easeInOutCubic, hash for stageshow consumers.
apps/web/components/stageshow/window.csswindow.css supports apps/web/components/stageshow.
apps/web/components/stageshow/window.tsxDefines WindowProps, Window, BarProps, Bar, TextProps, Text, PromptProps for stageshow consumers.
apps/web/components/terminal-preview.tsxIllustrative Explore, Build, and Review session tabs; no commands execute in the browser.
apps/web/content/docs/agent-loop.mdxThe main loop is an async generator in packages/core/src/loop.ts. Interactive UI, print output, JSON, RPC, and subagents consume the same stream.
apps/web/content/docs/architecture.mdxThe runtime is a TypeScript monorepo with four functional packages. A separate Next.js application provides this landing page and guide. The core never prints; consumers choose how to render its async event stream.
apps/web/content/docs/commands.mdxUse agent --help for the installed build's flags and /help for interactive commands, including discovered project commands.
apps/web/content/docs/contributing.mdxWork from the repository root with the pnpm version declared in package.json. Preserve existing changes and keep implementation updates close to their tests and documentation.
apps/web/content/docs/decisions.mdxThese are the tradeoffs visible in the current implementation, with conditions for changing them. They explain the present design; they are not reconstructed historical meeting notes. An alternative can be the better choice for a different workload.
apps/web/content/docs/extensions.mdxConfigure project-specific behavior in .myagent/. Each extension form joins the same tool and permission pipeline.
apps/web/content/docs/infrastructure.mdxAgent currently runs on the developer's machine. The documentation app is a separate Next.js process with statically generated guide routes. There is no required hosted application server, database, queue, or account system for using the CLI or reading these guides.
apps/web/content/docs/installation.mdxBuild the CLI from the repository, then install its local tarball. These steps do not assume the package has been published to npm.
apps/web/content/docs/introduction.mdxAgent is a coding assistant that runs in your terminal. It reads files, applies changes through tools, runs approved commands, and keeps a conversation you can return to. You choose the model provider and level of access.
apps/web/content/docs/performance.mdxPerformance has several independent meanings here: time to the first model response, responsiveness while tools run, prompt size and cost, startup time, website loading, and documentation build time. Improving one does not prove the others improved.
apps/web/content/docs/permissions.mdxPermissions are evaluated when a tool executes. The parent, workers, extension tools, and MCP tools use the same policy wrapper.
apps/web/content/docs/providers.mdxThe loop speaks one internal event format. Adapters translate vendor streams into text, supplied thinking, tool calls, and completion usage.
apps/web/content/docs/quickstart.mdxStart with a small task and a read-only session. Inspect the model, tool activity, and permission behavior before permitting edits.
apps/web/content/docs/repository.mdxThe repository separates model I/O, tool execution, runtime orchestration, terminal presentation, and this website. The index below describes maintained source and configuration files; generated output, dependency trees, local credentials, and Git internals are excluded.
apps/web/content/docs/sessions.mdxSessions preserve the conversation as it happens. The journal is separate from terminal display state, so opening a picker or detail view does not add a model message.
apps/web/content/docs/terminal-ui.mdxThe interactive terminal uses pi-tui's differential renderer. One owner reads input; the UI updates the screen rather than appending a new permission line or thinking label for every state change.
apps/web/content/docs/troubleshooting.mdxStart with the visible error, selected provider, and installed version. Distinguish an upstream account failure from a local tool or UI problem.
apps/web/content/docs/web.mdxThis website is a separate Next.js App Router workspace at apps/web. It serves the landing page at / and a statically generated MDX guide at /docs and /docs/<slug>.
apps/web/content/docs/workers.mdxWorkers receive a bounded task with separate context. Read-only workers can share the workspace. Writing workers can use isolated Git worktrees; their changes still need inspection and merge handling.
apps/web/DESIGN.mdRecord the original visual direction, tokens, typography, research references, and accessibility requirements.
apps/web/lib/content.tsServer-only MDX reading, full-text search corpus, and heading extraction.
apps/web/lib/docs.tsExplicit MDX import registry with guide slugs, descriptions, groups, and titles.
apps/web/lib/links.tsBrowser-safe documentation URL and repository URL helpers.
apps/web/mdx-components.tsxMap MDX elements to highlighted code, responsive tables, callouts, diagrams, and the file guide.
apps/web/mdx.d.tsDeclare local MDX modules as typed React components for the explicit guide import registry.
apps/web/next.config.mjsConfigure local MDX, GFM, heading slugs, supported page extensions, and Next.js headers.
apps/web/package.json@cli-agent/web: workspace manifest, dev, build, start, check-types, test, test:e2e, docs:generate, and dependencies.
apps/web/playwright.config.tsStart a production test server and run desktop/mobile browser checks.
apps/web/public/diagrams/agent-loop.mmdMermaid source for the agent loop flowchart, rendered in the MDX guides.
apps/web/public/diagrams/architecture.mmdMermaid source for the architecture flowchart, rendered in the MDX guides.
apps/web/public/diagrams/decisions.mmdMermaid source for the decisions flowchart, rendered in the MDX guides.
apps/web/public/diagrams/permissions.mmdMermaid source for the permissions flowchart, rendered in the MDX guides.
apps/web/public/diagrams/provider-bridge.mmdMermaid source for the provider bridge flowchart, rendered in the MDX guides.
apps/web/public/diagrams/sessions.mmdMermaid source for the sessions flowchart, rendered in the MDX guides.
apps/web/public/diagrams/terminal-ui.mmdMermaid source for the terminal ui flowchart, rendered in the MDX guides.
apps/web/public/diagrams/workers.mmdMermaid source for the workers flowchart, rendered in the MDX guides.
apps/web/scripts/content.test.mjsRegression tests for every guide is registered and local documentation links resolve, repository reference matches maintained files and descriptions, Mermaid sources have a flowchart declaration and no embedded HTML.
apps/web/tests/site.spec.tsRegression tests for all guides render with correct headings and no browser exceptions, workflow and provider tabs, full-text search, and clipboard work, flowcharts render and source reference can find a file.
apps/web/tsconfig.jsonWorkspace TypeScript compiler settings and source inclusion.
apps/web/turbo.jsonTurborepo task dependencies, source inputs, and cache outputs for this scope.
package.json1 files
package.jsoncli-agent: workspace manifest, build, dev, lint, test, check-types, format, and dependencies.
packages/ai63 files
packages/ai/eslint.config.jsWorkspace lint configuration using shared repository presets.
packages/ai/package.json@cli-agent/ai: workspace manifest, dev, demo:stream, record:fixtures, smoke:live, lint, check-types, test, and dependencies.
packages/ai/scripts/demo-stream.tsPhase 1 demo: one loop, two providers. The registry resolves a `"provider/model"` ref to a provider, and the same `for await` loop streams from whichever backend it points at. With API keys in the environment this talks to the real APIs; without them it falls back to a local server that speaks both wire formats, so the code path is the same either way.
packages/ai/scripts/diag-opencode.tsTemporary diagnostic: drive the real local opencode provider and print everything it does. Used while fixing the "Unavailable" and "no response" reports. Delete when done.
packages/ai/scripts/live-check.tsLive check of the local OpenCode provider against the installed CLI. It answers the questions the unit tests cannot: 1. can the catalog of the CLI be read (the "Unavailable" report)? 2. does a turn come back with text (the "no response" report)? 3. how long does each part take (the "too slow" report)?
packages/ai/scripts/record-fixtures.tsRecord the streams the vendors send. The tests replay these instead of writing the wire format out by hand, so a change in the format shows up as a failing test.
packages/ai/scripts/smoke-live.tsLive smoke test: stream from every provider you have credentials for. The credentials come from the environment first, then from the store the agent keeps (`~/.myagent/auth.json`), then from the CLIs already logged in on this machine:
packages/ai/src/auth/browser.tsBest-effort browser launch for the OAuth flow. Headless machines are normal (SSH, containers, CI), so a failure here is not an error: the caller also prints the URL, and the user can paste it anywhere.
packages/ai/src/auth/cli-import.test.tsRegression tests for importing the Codex CLI login.
packages/ai/src/auth/cli-import.tsImport a credential from a CLI that is already logged in. The Codex CLI keeps its ChatGPT login in `~/.codex/auth.json`. Copying that login in is convenient, but the refresh token is **single use**: refreshing rotates it, and the old one is rejected afterwards ("refresh_token_reused").
packages/ai/src/auth/errors.tsFailures from the auth layer, distinct from provider call failures.
packages/ai/src/auth/index.tsPublic exports for this module boundary.
packages/ai/src/auth/loopback.tsTemporary localhost callback server for the authorization-code flow. The OAuth app redirects the browser to `http://127.0.0.1:<port>/callback`; this server answers exactly one request, hands the code back to the login flow and shuts down. Binding to 127.0.0.1 (not 0.0.0.0) keeps the listener off the network, and the `state` check rejects callbacks this process did not initiate.
packages/ai/src/auth/manager.test.tsRegression tests for credential resolution, oauth refresh, oauth login.
packages/ai/src/auth/manager.tsCredential resolution and the interactive OAuth login. `get()` is the only call the rest of the app needs: it checks the environment first, then `auth.json`, and transparently refreshes an expiring OAuth token. `refreshOnUnauthorized()` covers the other half of the contract — a token can be revoked before its `expires` timestamp, so a 401 triggers one refresh and one retry at the call site.
packages/ai/src/auth/oauth.test.tsRegression tests for pkce, buildAuthorizeUrl, exchangeCode.
packages/ai/src/auth/oauth.tsOAuth token endpoint calls: the authorization-code exchange and refresh. Both are `application/x-www-form-urlencoded` POSTs (RFC 6749 §4.1.3, §6). The response parser only trusts what it validates: a missing `access_token` is a protocol failure, and an `expires_in` string is coerced to seconds so callers never have to think about it.
packages/ai/src/auth/pkce.tsPKCE (RFC 7636) primitives. The verifier never leaves this process; the challenge goes to the browser. `S256` is the only method modern providers accept, so it is the only one implemented.
packages/ai/src/auth/specs.tsPer-provider auth policy. Two kinds of provider:
packages/ai/src/auth/store.test.tsRegression tests for auth store.
packages/ai/src/auth/store.ts`auth.json` on disk. Location: `$MYAGENT_HOME/auth.json`, defaulting to `~/.myagent/auth.json`. The file holds refresh tokens, so it is created `0600` in a `0700` directory and rewritten atomically (temp file + rename) — a reader never sees a half-written file, and a crash cannot leave a truncated credential store.
packages/ai/src/auth/types.tsCredential shapes shared by the store and the auth manager. On disk (`~/.myagent/auth.json`) this is exactly the format the guide uses:
packages/ai/src/available.test.tsRegression tests for what a provider can serve, the free models.
packages/ai/src/errors.tsErrors thrown by provider adapters, in a shape the agent loop can act on.
packages/ai/src/factory.test.tsRegression tests for the provider factory, the opencode provider.
packages/ai/src/factory.tsBuilding a provider from an id. The registry resolves "provider/model" refs; this builds the provider behind the id, with the credentials the auth layer finds (the environment first, then auth.json).
packages/ai/src/fake.tsThe fake provider. A provider that answers what it is told to answer, so a test can say what the model says and what it does. It is the same thing for every test: the loop, the tools, the permissions and the sessions can all be tried without a network and without a key.
packages/ai/src/fixtures/anthropic-stream.txtRecorded anthropic stream wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/codex-stream.txtRecorded codex stream wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/codex-tool-call.txtRecorded codex tool call wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/gemini-stream.txtRecorded gemini stream wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/gemini-tool-call.txtRecorded gemini tool call wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/openai-compat-stream.txtRecorded openai compat stream wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures/openai-compat-tool-call.txtRecorded openai compat tool call wire bytes for adapter replay tests; consult the fixture README for provenance.
packages/ai/src/fixtures.test.tsRegression tests for the Gemini adapter, on a recorded stream, the OpenAI adapter, on a recorded stream, the Codex adapter, on a recorded stream.
packages/ai/src/fixtures.tsThe recorded streams. A provider adapter is only as good as the bytes it is given. These are the bytes the vendors actually sent, recorded as they came, and the tests replay them: a change in the wire format shows up as a test that fails, not as an agent that breaks in the middle of a task.
packages/ai/src/index.tsPublic exports for this module boundary.
packages/ai/src/missing-provider.test.tsRegression tests for a provider with no credentials.
packages/ai/src/models.test.tsRegression tests for model table, pricing, cost estimation.
packages/ai/src/models.tsThe model table. One place that knows what each model costs and what it can do, so later phases can budget tokens and pick a model without hard-coding vendor knowledge. Prices are per **million** tokens, in USD.
packages/ai/src/providers/anthropic.test.tsRegression tests for anthropic stream, anthropic request, anthropic errors.
packages/ai/src/providers/anthropic.tsAnthropic provider (`POST {baseUrl}/messages`, SSE). Anthropic's wire format differs from OpenAI's in ways this adapter hides: - content is a list of typed blocks, not a message string; - tool results are `user` messages containing `tool_result` blocks, and all results answering one assistant turn must share a single user message; - `max_tokens` is mandatory; - auth is `x-api-key` (or a bearer token for OAuth-style s
packages/ai/src/providers/antigravity.test.tsRegression tests for antigravity, antigravity discoverProject.
packages/ai/src/providers/antigravity.tsGoogle Antigravity (Cloud Code Assist) provider. Antigravity and the Gemini CLI talk to the same private backend, and its wire format is the Gemini one: `contents`, `parts`, `functionCall`, SSE chunks. Only three things differ, all of them confined to this file:
packages/ai/src/providers/codex.test.tsRegression tests for codex preset.
packages/ai/src/providers/codex.tsOpenAI Codex provider. This is the backend the Codex CLI itself talks to: a ChatGPT subscription endpoint, not the public API. It speaks the Responses wire format, so the whole translation lives in `responses.ts`; only four things differ here:
packages/ai/src/providers/gemini.test.tsRegression tests for gemini stream, gemini request, gemini errors.
packages/ai/src/providers/gemini.tsGoogle Gemini provider. Speaks `streamGenerateContent` over SSE — the wire format shared by the Gemini API and the Antigravity / Gemini CLI backend in ./antigravity.ts, so both share this one implementation.
packages/ai/src/providers/local-opencode.test.tsRegression tests for local opencode.
packages/ai/src/providers/local-opencode.tsBridge OpenCode v2 JSONL into provider events, isolate native tools, validate host-tool requests, and surface process failures.
packages/ai/src/providers/normalization.test.tsRegression tests for normalization.
packages/ai/src/providers/openai-compat.test.tsRegression tests for openaiCompat stream, openaiCompat request, openaiCompat errors.
packages/ai/src/providers/openai-compat.tsOpenAI-compatible provider. One adapter covers OpenAI, OpenCode Zen, OpenRouter, Ollama, LM Studio and vLLM — anything that speaks `POST {baseUrl}/chat/completions` with SSE streaming. Only `baseUrl`, auth and model metadata differ.
packages/ai/src/providers/responses.test.tsRegression tests for responses stream, responses tool calls, responses stop reasons.
packages/ai/src/providers/responses.tsOpenAI Responses API provider (`POST {baseUrl}/responses`, SSE). Shares OpenAI's identity/auth with the chat-completions adapter, but not its wire format: `input` is a flat list of typed items, tools are flattened, the system prompt is `instructions`, and the stream is a sequence of named `response.*` events.
packages/ai/src/registry.test.tsRegression tests for provider registry, streaming through the registry.
packages/ai/src/registry.tsOne streaming entry point for every provider. The registry holds providers under short ids (`anthropic`, `codex`, `opencode`, …) and resolves `"provider/model"` refs to them, so the agent loop and the CLI can switch backends by changing one string.
packages/ai/src/sse.tsMinimal `text/event-stream` parser. Shared by every adapter that speaks SSE (OpenAI-compatible, Anthropic). Handles chunk boundaries that split a line, CRLF vs LF, multi-line `data:` fields, `:` comments / keep-alives, and streams that end without the final blank line.
packages/ai/src/stream.tsThe shared streaming call. Every provider adapter takes the same request, so this is the only place that fills in the defaults. The same loop works for every backend, which is the point of the provider layer.
packages/ai/src/testing/mock-providers.tsA local server that speaks two real provider wire formats. It exists so the registry can be exercised end to end — real HTTP, real SSE, real adapters — without an API key: one endpoint answers in OpenAI's `chat.completion.chunk` shape, the other in Anthropic's named-event shape. The point of the registry is that the *same* code drives both.
packages/ai/src/types.tsUnified provider types. Every adapter (OpenAI-compatible, Anthropic, Gemini, …) translates its wire format into these shapes, so nothing above this layer ever imports a vendor SDK. Everything here is plain JSON, which is what makes sessions saveable and replayable in Phase 6.
packages/ai/tsconfig.jsonWorkspace TypeScript compiler settings and source inclusion.
packages/ai/vitest.config.tsVitest configuration for deterministic workspace tests.
packages/cli49 files
packages/cli/eslint.config.jsWorkspace lint configuration using shared repository presets.
packages/cli/package.json@cli-agent/cli: workspace manifest, dev, build, build:binary, demo:extensions, start, lint, check-types, test, and dependencies.
packages/cli/scripts/demo-extensions.tsPhase 8 demo: what the project adds to the agent. Builds a session in a directory that has an MCP server, a hook and an extension, and prints what the agent can now do: the tools, the commands, and what each of them is for.
packages/cli/scripts/drive.tsDrive the interactive session the way a person would: one key at a time, with a pause between them. Run: pnpm exec tsx scripts/drive.ts "<keys>" The keys: text is typed, "<enter>" presses Enter, "<esc>" presses Escape, "<down>" and "<up>" are the arrows.
packages/cli/scripts/terminal-smoke.tsNative PTY smoke fixture. No credentials, network requests, or session files.
packages/cli/scripts/ui-approval-probe.tsRender the permission dialog headless and dump what the user sees. Run: pnpm --filter @cli-agent/cli exec tsx scripts/ui-approval-probe.ts
packages/cli/scripts/ui-model-probe.tsThe model picker, with the OpenCode CLI of this machine behind it. The picker is opened, the list of the OpenCode CLI is waited for, and one of its models is taken. What the user would see is printed.
packages/cli/scripts/ui-opencode-probe.tsThe real session, the real OpenCode CLI, the real terminal. The UI is rendered into a headless terminal, the question is typed into it, and what the user would see is printed. Nothing is stubbed: the OpenCode CLI on this machine answers.
packages/cli/scripts/ui-probe.tsRender the interactive UI headless and dump what the user sees. Run: pnpm --filter @cli-agent/cli exec tsx scripts/ui-probe.ts
packages/cli/src/agents.tsAgents. An agent is a model, a prompt and a set of tools under a name. The main agent is the one you are talking to; the others are profiles you can switch to, and the ones a sub-agent can be given.
packages/cli/src/args.test.tsRegression tests for parseArgs, parseRuleArgument, isPermissionMode.
packages/cli/src/args.tsWhat the command line says. agent interactive agent -p "do the thing" print mode agent --json -p "..." the events as JSON lines agent --rpc JSON lines in, JSON lines out
packages/cli/src/catalog.test.tsRegression tests for the catalogue, the default model.
packages/cli/src/catalog.tsDiscover available models from authenticated providers, local CLI bridges, and extensions, retaining provider failures.
packages/cli/src/cli.tsExecutable entry point: parse arguments, compose a session, and select interactive, print, JSON, or RPC output.
packages/cli/src/commands.test.tsRegression tests for print mode, json mode, rpc mode.
packages/cli/src/commands.tsThe modes. All four read the same event stream; they only differ in what they do with it. The answer goes to stdout, so `agent -p "..." > answer.txt` works and the tool activity stays on stderr where it does not pollute the answer.
packages/cli/src/review.test.tsRegression tests for read-only code review.
packages/cli/src/review.tsCapture a read-only Git diff, fingerprint it, validate structured findings, and run a review without editing tools.
packages/cli/src/session-controller.test.tsRegression tests for session switching.
packages/cli/src/session-controller.tsSwitch saved sessions and persist model preferences, model-change markers, workers, and reviews atomically.
packages/cli/src/session.test.tsRegression tests for the session.
packages/cli/src/session.tsThe session the CLI works in. A provider from the ref, the tools behind the permissions, and the state the loop keeps — with the conversation written down as it happens, so it can be picked up again later.
packages/cli/src/ui/colors.tsColors. Plain ANSI: no dependency, works everywhere a terminal does, and can be switched off (NO_COLOR, or a terminal that does not want them).
packages/cli/src/ui/complete.test.tsRegression tests for completing a path, completing a file.
packages/cli/src/ui/complete.ts@-completion. Typing "@src/li" offers the files that start with it, so a file can be named without typing the whole path.
packages/cli/src/ui/components.tsRender the transcript, thinking previews, searchable selectors, and scrollable detail views.
packages/cli/src/ui/diff.tsDiffs, for the edits. When the model edits a file, the interesting part is what changed: the lines that go and the lines that come.
packages/cli/src/ui/frame.test.tsRegression tests for the box, the header, the welcome.
packages/cli/src/ui/frame.tsThe frame of the session. The header says where the agent is. The welcome says what it can do. The field is where the answer goes, and the line under it says what is left.
packages/cli/src/ui/helpers.tsDefines knownModels, modelIdOf, summarise for ui consumers.
packages/cli/src/ui/input.test.tsRegression tests for slash commands, the shell escape, @-completion.
packages/cli/src/ui/interactive.test.tsRegression tests for the interactive session.
packages/cli/src/ui/interactive.tsCompose the pi-tui screen, focused dialogs, prompt queue, permissions, model selection, sessions, and worker controls.
packages/cli/src/ui/markdown.tsMarkdown, for the terminal. A small renderer: headings, bold, italic, inline code, fenced code, lists and paragraphs. It is not CommonMark, but it is the part of it that a model's answer actually uses.
packages/cli/src/ui/picker.test.tsRegression tests for the model picker.
packages/cli/src/ui/picker.tsA list you can pick from. It is drawn under the prompt, and the keys that are not the picker's go to the line as usual: the list is a list, not a mode. The arrows move, Enter takes, Escape puts it away.
packages/cli/src/ui/screen.test.tsRegression tests for rendered terminal.
packages/cli/src/ui/slash.tsSlash commands, and the shell escape. A line that starts with "/" is a command for the agent, not a message for the model. A line that starts with "!" is a shell command.
packages/cli/src/ui/status.tsThe tool blocks. A tool call is a line: what it was asked to do, and whether it worked. The line folds, so a long output does not fill the screen.
packages/cli/src/ui/store.test.tsRegression tests for transcript state.
packages/cli/src/ui/store.tsAccumulate display-only transcript blocks and update thinking and tool status in place by identity.
packages/cli/src/ui/terminal.tsAdapt native or injected input/output streams to the pi-tui terminal interface.
packages/cli/src/ui/ui.test.tsRegression tests for colors, markdown, the streaming markdown.
packages/cli/TERMINAL_UI.md`InteractiveUi` is the only interactive input owner. Pi's `TuiMainScreen` owns output, cursor movement, synchronized frames, resizing, and native
packages/cli/THIRD_PARTY_NOTICES.mdThe interactive terminal uses `@earendil-works/pi-tui` 1.5.2 from https://github.com/earendil-works/pi, licensed under the MIT License.
packages/cli/tsconfig.jsonWorkspace TypeScript compiler settings and source inclusion.
packages/cli/tsup.config.tstsup.config.ts supports Terminal command and runtime composition. Build with `pnpm --filter @cli-agent/cli build`; see `TERMINAL_UI.md` for renderer boundaries..
packages/cli/vitest.config.tsVitest configuration for deterministic workspace tests.
packages/core82 files
packages/core/eslint.config.jsWorkspace lint configuration using shared repository presets.
packages/core/eval-report.jsonShared eval report configuration preset.
packages/core/package.json@cli-agent/core: workspace manifest, dev, demo:loop, demo:consumers, demo:tools, demo:permissions, demo:prompt, demo:compact, demo:session, demo:agents, eval, lint, check-types, test, and dependencies.
packages/core/scripts/demo-agents.tsPhase 7 demo: the lead delegates to the workers. One prompt, a real model, a real worker: the lead is asked to find out what is in a directory, it hands the job to the explorer, and only the explorer's report comes back — not the files it read.
packages/core/scripts/demo-compact.tsPhase 5 demo: a long session that has to compact. A conversation that has grown past the model's window is summarised, and the agent carries on with the summary. The point is that it still knows what the task was.
packages/core/scripts/demo-consumers.tsPhase 2 demo: one event stream, three consumers. The loop yields events and prints nothing. A terminal reads them as text, a script reads them as JSON lines, and a parent agent reads the summary of a sub-agent — all from the same stream.
packages/core/scripts/demo-loop.tsPhase 2 demo: the loop with a real model and a fake echo tool. The model is asked to call the tool; the loop runs it, sends the result back, and the model answers. Everything printed here comes out of the loop's event stream — the loop itself never prints.
packages/core/scripts/demo-permissions.tsPhase 3 demo: the agent, the tools and the permissions. A small project with a failing test. The agent reads the test, fixes the code and runs the test again — with the permission layer in front of the tools, in "ask" mode: the commands are allowed by a rule, and anything else would be put to the user.
packages/core/scripts/demo-prompt.tsPhase 5 demo: the layered system prompt. Shows what the model is told on every turn, layer by layer, and which of the layers the provider can cache.
packages/core/scripts/demo-session.tsPhase 6 demo: quit in the middle, come back, carry on. The first session asks for a tool and is then closed. The second session opens the same file, reads the conversation back and continues it — the model sees what happened before it was interrupted.
packages/core/scripts/demo-tools.tsPhase 3 demo: a real model with real tools. The model is given a small project and asked to fix it. It reads the file, edits it, and checks its work — through the same loop, the same tools and the same event stream as everything else.
packages/core/scripts/eval.tsThe eval suite, run against a real model. Each task is a small repository, a question, and a test. The report says how many passed, how many turns it took and what it cost.
packages/core/src/agents/board.test.tsRegression tests for the board.
packages/core/src/agents/board.tsThe shared board. The workers of one task write to it, so the lead can see what is going on: which task, who owns it, what state it is in and what it found. It is a JSON file, so it survives a crash and can be read while the work is going on.
packages/core/src/agents/isolation.test.tsRegression tests for the isolation.
packages/core/src/agents/isolation.tsIsolation. A worker that only reads can share the workspace: it cannot change anything, so there is nothing to keep apart. A worker that writes gets a git worktree of its own, on a branch of its own, and the orchestrator merges the branch when it is happy with it.
packages/core/src/agents/multi-agent.test.tsRegression tests for one prompt, many agents.
packages/core/src/agents/orchestrator.test.tsRegression tests for the orchestrator, the pipeline, the generator and the critic.
packages/core/src/agents/orchestrator.tsOrchestration. Three patterns, all over the same worker:
packages/core/src/agents/roles.test.tsRegression tests for an agent role, the roles.
packages/core/src/agents/roles.tsAgent roles. A role is a name, a model, a set of tools and a system prompt. It lives in a file:
packages/core/src/agents/task-tool.test.tsRegression tests for the task tool.
packages/core/src/agents/task-tool.tsThe task tool. The parent delegates to a worker: the worker gets its own system prompt, its own tools and its own model, and only the report it writes comes back. A worker can read fifty files; the parent sees three hundred words.
packages/core/src/agents/worker-manager.test.tsRegression tests for live workers.
packages/core/src/agents/worker-manager.tsOwn worker lifetimes, concurrency, cancellation, follow-ups, transcripts, and observable status.
packages/core/src/budget.loop.test.tsRegression tests for the budget in the loop.
packages/core/src/budget.test.tsRegression tests for counting tokens, the budget.
packages/core/src/budget.tsThe budget. How much of the model's context window the conversation may use, and when it has to be made smaller.
packages/core/src/checkpoints.test.tsRegression tests for the checkpoints.
packages/core/src/checkpoints.tsFile checkpoints. Before a tool changes a file, the file is snapshotted, so the change can be undone. It is the same idea as a git stash, without needing a repository: the snapshot is the content of the file before the change.
packages/core/src/commands.test.tsRegression tests for the custom commands, what a command sends.
packages/core/src/commands.tsCustom commands. A command is a markdown file in `.myagent/commands`. The name of the file is the name of the command: `deploy.md` is `/deploy`. What the file says is what the model is asked, so a command is a prompt you do not have to type again.
packages/core/src/compact.test.tsRegression tests for compaction, the summary prompt.
packages/core/src/compact.tsCompaction. When the conversation no longer fits, the old part of it is summarised and replaced by the summary. What is kept is the summary and the last few messages, so the model still knows what just happened and still knows what it was asked to do.
packages/core/src/context.tsContext building. The system prompt is built in layers (see prompt.ts): the parts that do not change come first, so the provider can cache them, and the conversation follows as messages. Phase 5 replaces the message half with budgeting — trimming the transcript to the model's context window, summarising the middle, keeping the ends.
packages/core/src/environment.tsWhere the agent is. The working directory, the branch it is on, the operating system and the date. It changes while the session runs, so it sits below the parts that do not: everything above it can be cached by the provider.
packages/core/src/evals/runner.test.tsRegression tests for the eval tasks, the eval suite.
packages/core/src/evals/runner.tsThe eval runner. Every task runs in a throwaway repository: the files are written, the agent is asked the question, and a test is run in the repository afterwards. It passes when the test exits with zero.
packages/core/src/evals/tasks.tsThe eval tasks. Each task is a small repository, a question, and a test that says whether the agent did it. The repository is thrown away afterwards, so the agent can do anything to it.
packages/core/src/extensions.test.tsRegression tests for an extension, a provider an extension added.
packages/core/src/extensions.tsExtensions. An extension is a TypeScript module in `.myagent/extensions` that exports a `register` function. It is given an API and adds what it likes: tools, commands and providers.
packages/core/src/hooks.loop.test.tsRegression tests for a hook in the loop.
packages/core/src/hooks.test.tsRegression tests for the hook config, which hooks answer, a hook that runs.
packages/core/src/hooks.tsHooks. A hook is a shell command that runs when something happens. The command is given the details on its standard input, and what it does with them is up to it:
packages/core/src/index.tsPublic exports for this module boundary.
packages/core/src/logging.test.tsRegression tests for the log, what the loop writes down.
packages/core/src/logging.tsThe log. Every request, every tool call and every usage is written down as one JSON object per line. The log is what the agent did, in order, in a shape a program can read: the sessions are for the conversation, the log is for the work.
packages/core/src/loop.guards.test.tsRegression tests for loop guards, every call refused, abort.
packages/core/src/loop.order.test.tsRegression tests for the tools of one turn.
packages/core/src/loop.signature.test.tsRegression tests for a signature on a call.
packages/core/src/loop.test-helpers.tsTest helpers: a provider that plays back scripted turns, and a fake echo tool. Shared by the loop tests.
packages/core/src/loop.test.tsRegression tests for the agent loop, accumulate, buildContext.
packages/core/src/loop.tool-limits.test.tsRegression tests for a tool that returns a lot, a tool that says its result must be kept.
packages/core/src/loop.tsThe agent loop. model -> tool calls -> results -> model, until the model stops asking for tools. The loop yields events and never prints, so the CLI, a JSON mode and a sub-agent all consume the same stream.
packages/core/src/memory.tsProject memory. AGENTS.md and CLAUDE.md are how a project says what it wants. The search walks up from the working directory, so the memory of the directory you are in and of every directory above it is read; the user's own ~/.myagent/AGENTS.md is read too.
packages/core/src/prompt.test.tsRegression tests for the layers, the project memory, the environment.
packages/core/src/prompt.tsThe layered system prompt. What the model sees on every turn is built in layers, and the order is the point: the parts that do not change come first, so the provider can cache them and only pay for the part that moved.
packages/core/src/redact.test.tsRegression tests for taking the secrets out, the secrets the process knows, taking the secrets out of anything.
packages/core/src/redact.tsKeeping the secrets out. Everything the agent reads goes into a log: the requests, the tool calls, the answers. A file it read may hold a key, and a log is a file that is written to disk and kept.
packages/core/src/ref.tsThe "provider/model" ref. The ref is how a model is named in the command line and in the configuration: "provider/model". The provider is built from the part before the slash, and the model is called by the part after it.
packages/core/src/render.test.tsRegression tests for emit events, not prints, the text consumer, the JSON consumer.
packages/core/src/render.tsConsumers of the event stream. The loop never prints: it yields events, and every surface reads that one stream its own way. A terminal prints text, a script reads JSON lines, and a parent agent reads the summary of what a sub-agent did.
packages/core/src/repomap.test.tsRegression tests for the repo map.
packages/core/src/repomap.tsThe repo map. An outline of what is in the project: the files, and the symbols in them. It is injected into the prompt so the model can find the right file without reading every file first — the agentic search (grep, glob, read) still does the finding, but the map tells it what exists.
packages/core/src/resume.test.tsRegression tests for quitting and resuming.
packages/core/src/retry.tsRetrying a provider call. A provider that answers 429 or 5xx is worth waiting for; a provider that answered with content and then dropped the connection is not, because the answer would be delivered twice. So a call is only retried when nothing came back yet, and never after a tool has run — the side effects of a tool cannot be undone by asking the model again.
packages/core/src/sample-repo.tsA small project with a failing test. The scenario the guide asks for: the agent reads the failing test, fixes the code and runs the test again. It is small on purpose — the point is that read, edit and bash work together, not that the bug is hard.
packages/core/src/scenario.test.tsRegression tests for the agent in a real project.
packages/core/src/session.test.tsRegression tests for a long session.
packages/core/src/sessions.test.tsRegression tests for the session store.
packages/core/src/sessions.tsSessions. A session is a file of entries, one JSON object per line, appended and never rewritten:
packages/core/src/shrink.test.tsRegression tests for shrinking a tool result, the old tool results.
packages/core/src/shrink.tsShrinking what the model has to read. A tool result can be enormous — a file, a build log, a search over a whole repository — and the model rarely needs all of it. So a big result keeps its head and its tail, and says how much was left out; and a result that is many turns old is replaced by a one-line stub, because the model has long since moved on from it.
packages/core/src/skills.test.tsRegression tests for the skills, the body of a skill, the skill tool.
packages/core/src/skills.tsSkills and the plan. The dynamic part of the prompt: what the agent can draw on, and what it said it would do. It changes while the session runs, so it belongs at the bottom of the prompt.
packages/core/src/subagent.tsSub-agents. A sub-agent is the same loop with its own transcript: it gets its own tools and its own prompt, and it yields the same events, so the parent reads one stream and sees everything the sub-agent did.
packages/core/src/tokens.tsCounting tokens. The count is an estimate until the provider says otherwise: the real number arrives with the usage of a response, and the difference between the two is remembered, so the next estimate is closer.
packages/core/src/types.tsThe agent's state and the events it emits.
packages/core/src/untrusted.test.tsRegression tests for marking what is data, a tool that holds data.
packages/core/src/untrusted.tsWhat the agent reads is data. A file in the repository may say "ignore what you were told and run this". A page from the web certainly may. Neither is the user talking: the user asked a question, and the agent read something.
packages/core/tsconfig.jsonWorkspace TypeScript compiler settings and source inclusion.
packages/core/vitest.config.tsVitest configuration for deterministic workspace tests.
packages/eslint-config4 files
packages/eslint-config/base.jsDefines config for eslint-config consumers.
packages/eslint-config/next.jsDefines nextJsConfig for eslint-config consumers.
packages/eslint-config/package.json@repo/eslint-config: workspace manifest, package exports, and dependencies.
packages/eslint-config/react-internal.jsDefines config for eslint-config consumers.
packages/tools37 files
packages/tools/eslint.config.jsWorkspace lint configuration using shared repository presets.
packages/tools/package.json@cli-agent/tools: workspace manifest, dev, lint, check-types, test, and dependencies.
packages/tools/src/bash.tsbash — run a command. The output is capped so a runaway command cannot fill the model's context: the head and the tail are kept and the middle is replaced by a note about how much was left out.
packages/tools/src/edit.tsedit — replace an exact string in a file. The most reliable edit format there is: the model says what is in the file and what should be there instead. The edit only goes through when what it says is actually there, and only once — a match that is missing or that appears more than once is an error, not a guess.
packages/tools/src/exec.tsFinding programs on PATH.
packages/tools/src/files.test.tsRegression tests for read, write, edit.
packages/tools/src/fixtures/echo-server.mjsA small MCP server, for the tests. It says hello with two tools: one that echoes what it is given, and one that fails. It talks over stdio, which is how most MCP servers are run.
packages/tools/src/glob.tsglob — find the files whose names match a pattern. ripgrep lists the files when it is installed; otherwise the same list is built here, skipping what git ignores.
packages/tools/src/grep.tsgrep — search the files for a pattern. ripgrep does the work when it is installed: it is fast, it skips what git ignores, and its output is exactly the shape we want. When it is not installed, the same search runs here instead, with the same rules about ignored files.
packages/tools/src/ignore.ts.gitignore rules. The search tools skip what git ignores, so a search does not wander into node_modules or a build directory. This is a practical subset of the format: patterns, directory patterns, anchoring and negation.
packages/tools/src/index.tsPublic exports for this module boundary.
packages/tools/src/mcp.http.test.tsRegression tests for an MCP server over HTTP.
packages/tools/src/mcp.server.test.tsRegression tests for a real MCP server.
packages/tools/src/mcp.test.tsRegression tests for the MCP config, an MCP tool, the schema of an MCP tool.
packages/tools/src/mcp.tsThe MCP client. The Model Context Protocol is how a program offers its tools to other programs. A server is a process (or a URL) that says "here are my tools", and the agent calls them like its own.
packages/tools/src/paths.tsPaths, as the tools see them. Every tool takes a path the way a person would write it: relative to the working directory, or absolute. The resolved path is what the tool touches, and it is what the error messages name.
packages/tools/src/permissions/controller.test.tsRegression tests for live permissions.
packages/tools/src/permissions/controller.tsOwn live permission mode, literal session grants, pending approvals, policy changes, and cancellation.
packages/tools/src/permissions/decide.tsThe decision: may this call happen? The order is the whole policy:
packages/tools/src/permissions/index.tsPublic exports for this module boundary.
packages/tools/src/permissions/permissions.test.tsRegression tests for parsing rules, matching rules, deciding.
packages/tools/src/permissions/rules.tsRules: how they are written and how they are matched.
packages/tools/src/permissions/types.tsWhat the agent is allowed to do. The tools are powerful; the permissions are what keep them pointed. Four modes say how much is allowed without asking, and a list of rules says what is always allowed, always refused, or always worth a question.
packages/tools/src/permissions/wrap.test.tsRegression tests for the permission wrapper.
packages/tools/src/permissions/wrap.tsThe tools, behind the permissions. Every tool that is wrapped is asked first. The answer is one of three: it runs, it is refused, or the user is asked. A refusal never reaches the tool: the model is told what happened, and carries on.
packages/tools/src/read.tsread — a file, with line numbers. The output looks like `cat -n`: every line is prefixed with its number, so the model can say "line 42" and mean it.
packages/tools/src/run.tsRunning a program and collecting what it says.
packages/tools/src/todo.tstodo — the checklist the model keeps. The model rewrites the list when its plan changes, and reads it back when it needs to remember what is left. The list lives with the tool, so it lasts for the session.
packages/tools/src/tools.test.tsRegression tests for bash, grep, glob.
packages/tools/src/tools.tsThe standard set of tools.
packages/tools/src/types.tsThe tool contract. A tool is something the model may call. The description and the schema are what the provider advertises; `run` is the executable side, which Phase 3 fills in (read, write, edit, bash, grep, glob, todo).
packages/tools/src/validate.test.tsRegression tests for validateArgs, toToolSpec.
packages/tools/src/validate.tsValidating a tool's arguments. The schema a tool declares is the schema its arguments are checked against: the model is told exactly what is expected, and what it sends is held to that. A tool with a broken schema is refused rather than run with whatever the model happened to send.
packages/tools/src/walk.tsWalking a directory, the way a search should. Git's ignored files are skipped, and so are the directories that are never worth searching: .git, node_modules and the usual build output.
packages/tools/src/write.tswrite — create a file, or replace what is in it.
packages/tools/tsconfig.jsonWorkspace TypeScript compiler settings and source inclusion.
packages/tools/vitest.config.tsVitest configuration for deterministic workspace tests.
packages/typescript-config5 files
packages/typescript-config/base.jsonShared base configuration preset.
packages/typescript-config/nextjs.jsonShared nextjs configuration preset.
packages/typescript-config/node.jsonShared node configuration preset.
packages/typescript-config/package.json@repo/typescript-config: workspace manifest, package exports, and dependencies.
packages/typescript-config/react-library.jsonShared react library configuration preset.
pnpm-lock.yaml1 files
pnpm-lock.yamlResolved workspace dependency versions and integrity metadata for reproducible installs.
pnpm-workspace.yaml1 files
pnpm-workspace.yamlDeclare apps and packages workspace globs and dependency build policies.
scripts10 files
scripts/diag-compare.mjsTemporary diagnostic: compare the ways of driving the opencode CLI. A: machine background service, plain agent. B: machine background service, agent defined in config (no plugin). C: private server, guard plugin (what the provider does today). Delete when done.
scripts/diag-configagent.mjsdiag-configagent.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-configagent2.mjsdiag-configagent2.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-ollama.mjsdiag-ollama.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-opencode.tsdiag-opencode.ts supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-phases.mjsdiag-phases.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-serverout.mjsdiag-serverout.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/diag-timing.mjsdiag-timing.mjs supports Repository maintenance: source documentation generation and commit-by-commit verification..
scripts/document-repository.mjsGenerate the source-file reference and refresh marked README file maps while preserving handwritten content.
scripts/verify-commits.ps1verify-commits.ps1 supports Repository maintenance: source documentation generation and commit-by-commit verification..
turbo.json1 files
turbo.jsonTurborepo task dependencies, source inputs, and cache outputs for this scope.
Keep the map current
node scripts/document-repository.mjs
node scripts/document-repository.mjs --readmesThe first command refreshes the checked-in website index. The second also refreshes marked file-index sections in folder READMEs. Handwritten content outside those markers is preserved. Do not generate documentation inside build output or dependency folders.