OpenrouterTools

OpenRouter's Agent SDK Lets Developers Build Custom Terminal UIs for Any Model

Written by

Drafted with AI; edited and reviewed by a human.

3 min read

OpenRouter's Agent SDK Lets Developers Build Custom Terminal UIs for Any Model

TL;DR

  • OpenRouter's new create-agent-tui skill enables developers to generate custom terminal UI (TUI) projects for AI agents.
  • It supports a wide range of models, including Claude Code and Codex, and any skill-compatible agent on OpenRouter.
  • Users can extensively customize visual styles, integrate local/server tools, and add harness features via an interactive checklist.
  • The generated projects leverage the Agent SDK's callModel to handle the entire agentic loop, simplifying complex agent development.

OpenRouter has launched a powerful new create-agent-tui skill, built with its recently introduced Agent SDK, empowering developers to generate fully customized agent harnesses and terminal user interfaces (TUIs). This innovative tool produces a complete, runnable TypeScript project that can be pointed at models like Claude Code, Codex, Cursor, or any other skill-compatible agent available on OpenRouter. It's designed for developers who need fine-grained control over their agent's appearance and functionality, aim to ship minimal harnesses as part of a product, or wish to deepen their understanding of how agents work by building their own. You can explore more details on building your own harness with the Agent SDK here.

The create-agent-tui skill offers extensive customization options, allowing users to tailor their TUI to specific needs and preferences. Developers can choose from four distinct visual styles, three tool display styles (such as emoji markers, grouped action labels, or minimal one-liners), three input styles (including full-width block or plain readline), and three different loader animations. Custom ASCII banners can also be integrated for a personalized touch. An interactive checklist guides users through selecting features like server tools (e.g., web search, datetime, image generation), local tools (file read/write/edit, grep, glob, shell), crucial harness modules (session persistence, context compaction, tool approval gates), and convenient slash commands (/model, /new, /export). For those interested in the underlying implementation, the skill's repository is available on GitHub: create-agent-tui skill repository.

At its core, the generated project features a robust two-layered architecture. The inner layer is driven entirely by the Agent SDK's callModel function, which meticulously manages the entire agentic loop. This includes handling model calls, executing tools, managing multi-turn conversations, applying stop conditions, facilitating streaming, and tracking costs—all within a single, powerful function. This abstraction significantly reduces the boilerplate code developers would otherwise need to write. The outer layer, generated by the skill, encapsulates everything else: configuration, tool definitions, the TUI itself, and session management, providing a clear separation of concerns. A detailed overview of the callModel functionality can be found in the SDK documentation: Agent SDK callModel overview.

Tools within the generated projects are defined using the SDK's tool() function, which leverages Zod schemas for input validation, ensuring robust and type-safe interactions. Server tools, such as openrouter:web_search or openrouter:datetime, are particularly straightforward to invoke with a simple serverTool() call, with OpenRouter handling their execution server-side. Configuration is flexible, flowing through hardcoded defaults, an optional agent.config.json file, and environment variables like AGENT_MODEL, allowing for easy overrides. Furthermore, the harness supports session persistence by writing every message to a JSONL file, enabling conversations to be reloaded and continued seamlessly across sessions. This design philosophy draws inspiration from leading production agent systems such as pi-mono's coding agent, Claude Code, and Codex CLI, ensuring a battle-tested foundation.

To get started, developers simply need an OpenRouter API key (OpenRouter API Keys), install the create-agent-tui skill in their coding agent, describe their desired coding assistant, and then run the generated TypeScript project.

Summary

  • OpenRouter's create-agent-tui skill offers a unique way to build highly customized terminal user interfaces (TUIs) for AI agents, compatible with a wide array of models.
  • It provides extensive visual and functional customization, including different display styles, local and server tools, session persistence, and slash commands.
  • The Agent SDK's callModel function forms the robust inner loop, abstracting complex agentic processes like tool execution, streaming, and cost tracking.
  • The generated projects are designed with a clear two-layered architecture, flexible configuration, and draw upon best practices from established agent systems.

Source: Build Your Own Harness with the Agent SDK | OpenRouter

Cursor AI Boosts Dev Workflow with Parallel Tasks, Worktrees, and Cross-Repo Changes

Cursor AI Boosts Dev Workflow with Parallel Tasks, Worktrees, and Cross-Repo Changes

Cursor's latest update introduces `/multitask` for parallel agent execution, enhanced worktrees, and multi-root workspaces to streamline cross-repository development.

Continue reading

Get notified when our newsletter launches

We're testing demand before launching a weekly AI digest. Drop your email and you'll be the first to know when it ships — one launch announcement, no spam.

We only use your email to announce the newsletter launch — never for spam. See our Privacy