agents-0-27-0-2-b
Claude Code's read-only tools, web search on, ludion sync off
Question
What does npx agents tui do?
Answer key
- A correct answer says
- `npx agents tui <url>` opens a terminal client for an agent conversation's Web Channel.
- The stale answer
- The agents package has no terminal client command.
Answer
`npx agents tui` opens a chat interface in your terminal for an AI agent built with Cloudflare's Agents SDK (the npm package `agents`). The usage is `agents tui <url> [--as <participant>] [--header <name=value>]...`. It connects to a running agent's web channel over a WebSocket at that URL, and you can then follow and join the conversation from the terminal.
- **`--as`** sets which participant you appear as.
- **`--header`** adds a header to the connection request, and you can repeat it.
- **Slash commands:** inside the session, the agent may support commands like `/new`, `/fork`, `/reset`, `/conversations` and `/switch <id>` for managing conversations.
- **Cloudflare Access:** if the URL is behind Access, it gets a login token through `cloudflared`, which opens your browser the first time. You can instead set `CF_ACCESS_CLIENT_ID` and `CF_ACCESS_CLIENT_SECRET` to use a service token.
I got this from the help text in the package's CLI code (version 0.28.0, the latest on npm) via a web-page fetch tool that read only the first third of the file. I didn't run the command, and other details may be in the part it didn't read.Grade
correct
The judge's reason: It says `npx agents tui <url>` opens a terminal chat client connected to an agent's web channel, which matches the key, and it does not claim the command is missing.
Session log
Tool call: PowerShell
{ "command": "npm view agents name description version bin repository.url homepage 2>&1 | Select-Object -First 30", "description": "Look up the agents package on npm" }Tool output (error)
Command contains malformed syntax that cannot be parsed: pwsh exited with code 1: �R�}���h ���C�����������܂��BTool call: Bash
{ "command": "npm view agents name description version bin repository.url homepage readme 2>&1 | head -80", "description": "Look up the agents package on npm" }Tool output
name = 'agents' description = 'A home for your AI agents' version = '0.28.0' bin = { agents: './dist/cli.js' } repository.url = 'git+https://github.com/cloudflare/agents.git' readme = '# agents\n' + '\n' + '\n' + '\n' + '**Build software that thinks and does.**\n' + '\n' + "Persistent AI agents on Cloudflare's global network. They remember context, reason through problems, schedule their own work, and take action—all without you managing servers.\n" + '\n' + '```sh\n' + 'npm create cloudflare@latest -- --template cloudflare/agents-starter\n' + '```\n' + '\n' + 'Or add to an existing project:\n' + '\n' + '```sh\n' + 'npm install agents\n' + '```\n' + '\n' + 'The examples below use `@callable()` decorators. Vite projects must extend\n' + '`agents/tsconfig` and add the `agents/vite` plugin; other bundlers must support\n' + 'TC39 decorators (`2023-11`). See\n' + '[Adding Agents to an Existing Project](../../docs/agents/adding-to-existing-project.md#4-configure-typescript-and-vite).\n' + '\n' + '---\n' + '\n' + '## Why Agents, Why Now\n' + '\n' + 'LLMs can reason, plan, and use tools—but they need infrastructure that matches their capabilities. Traditional serverless is stateless and ephemeral. Agents are persistent and purposeful.\n' + '\n' + '```\n' + 'From request handlers → to autonomous entities\n' + 'From stateless functions → to persistent intelligence\n' + '\n' + 'Traditional serverless: Request → Response → Gone\n' + 'Agents: Thinking, remembering, acting — continuously\n' + '```\n' + '\n' + '**Pay only when active.** Agents hibernate between requests. You can have millions of agents—one per user, per session, per game room—each costs nothing when idle.\n' + '\n' + 'Built on Cloudflare Durable Objects, agents run globally, close to your users, with persistent state that survives restarts.\n' + '\n' + '---\n' + '\n' + '## Quick Example\n' + '\n' + 'A counter agent with real-time state sync and callable methods:\n' + '\n' + '```typescript\n' + '// server.ts\n' + 'import { Agent, callable } from "agents";\n' + '\n' + 'export type State = { count: number };\n' + '\n' + 'export class CounterAgent extends Agent<Env, State> {\n' + ' initialState: State = { count: 0 };\n' + '\n' + ' @callable()\n' + ' increment() {\n' + ' this.setState({ count: this.state.count + 1 });\n' + ' return this.state.count;\n' + ' }\n' + '\n' + ' @callable()\n' + ' decrement() {\n' + ' this.setState({ count: this.state.count - 1 });\n' + ' return this.state.count;\n' + ' }\n' + '}\n' + '```\n' + '\n' + '```tsx\n' + '// client.tsx\n' + 'import { useAgent } from "agents/react";\n' + 'import { useState } from "react";\n' + 'import type { CounterAgent, State } from "./server";\n' +Agent
Need to inspect the CLI for a tui command.Tool call: Bash
{ "command": "d=$(mktemp -d) && cd \"$d\" && npm pack agents@0.28.0 --silent >/dev/null 2>&1 && tar xzf agents-*.tgz && grep -o '.\\{300\\}tui.\\{300\\}' package/dist/cli.js | head -20; ls package/dist | head -50", "description": "Download package and search CLI for tui command" }Tool output (error)
Quoted text in this command can't be checked before it runsTool call: Bash
{ "command": "d=$(mktemp -d); cd $d; npm pack agents@0.28.0 --silent; tar xzf agents-0.28.0.tgz; echo $d; ls package/dist | head -60", "description": "Download and unpack the agents package" }Tool output (error)
A variable in this command can't be checked before it runsTool call: Bash
{ "command": "mkdir -p /tmp/agentspkg && cd /tmp/agentspkg && npm pack agents@0.28.0 --silent && tar xzf agents-0.28.0.tgz && ls package/dist | head -60", "description": "Download and unpack the agents package" }Tool output (error)
This Bash command contains multiple operations. The following part requires approval: mkdir -p /tmp/agentspkg && cd /tmp/agentspkg && npm pack agents@0.28.0 --silent && tar xzf agents-0.28.0.tgz && ls package/distTool call: ToolSearch
{ "query": "select:WebFetch", "max_results": 1 }Tool output
{"type":"tool_reference","tool_name":"WebFetch"}Tool call: WebFetch
{ "url": "https://unpkg.com/agents@0.28.0/dist/cli.js", "prompt": "What subcommands does this CLI define? Specifically, what does the \"tui\" command do? Quote relevant code." }Tool output
The visible portion defines one subcommand, **`tui`**. The page is truncated, so other subcommands may exist in the omitted code. **What `tui` does:** It opens a terminal interface that follows a conversation on an agent's Web Channel. The usage text reads: > "Usage: agents tui <url> [--as <participant>] [--header <name=value>]..." It accepts `--as`, which sets the `as` query parameter, and a repeatable `--header` flag for the WebSocket upgrade. The parser handles `--as` in this way: ```js if(o===`--as`)r=c(); ``` Inside the interface, the help text lists slash commands the agent may support: `/new`, `/fork`, `/reset [note]`, `/conversations`, and `/switch <id>`. These are in-session commands, not CLI subcommands. **Cloudflare Access:** If the URL sits behind Cloudflare Access, the tool fetches a token through `cloudflared`. The help text says, "A URL behind Access gets a token from cloudflared, which logs in through" the browser on first use. Alternatively, `CF_ACCESS_CLIENT_ID` and `CF_ACCESS_CLIENT_SECRET` can supply a service token. [WebFetch note: this page's text is 286318 characters long and the answer above covers only characters 0 to 100000; the final 186318 were not read — to read on, call WebFetch again with the same url and offset: 100000.]Agent
`npx agents tui` opens a chat interface in your terminal for an AI agent built with Cloudflare's Agents SDK (the npm package `agents`). The usage is `agents tui <url> [--as <participant>] [--header <name=value>]...`. It connects to a running agent's web channel over a WebSocket at that URL, and you can then follow and join the conversation from the terminal. - **`--as`** sets which participant you appear as. - **`--header`** adds a header to the connection request, and you can repeat it. - **Slash commands:** inside the session, the agent may support commands like `/new`, `/fork`, `/reset`, `/conversations` and `/switch <id>` for managing conversations. - **Cloudflare Access:** if the URL is behind Access, it gets a login token through `cloudflared`, which opens your browser the first time. You can instead set `CF_ACCESS_CLIENT_ID` and `CF_ACCESS_CLIENT_SECRET` to use a service token. I got this from the help text in the package's CLI code (version 0.28.0, the latest on npm) via a web-page fetch tool that read only the first third of the file. I didn't run the command, and other details may be in the part it didn't read.