5 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article outlines how to create a coding agent using GPT-5.1 and the Agents SDK. It demonstrates setting up the agent to scaffold a new app based on user prompts and refine it using web searches and shell commands. The guide includes code examples for establishing a workspace and executing shell commands safely.
If you do, here's more
GPT-5.1 enhances coding capabilities with new tools in the Responses API, making it easier to create coding agents that can handle full codebases. This guide walks through building a coding agent using the Agents SDK, which can generate a new app based on user prompts and refine it with feedback. Key tools include `apply_patch` for file editing, `shell` for executing commands, `web_search` for retrieving current information, and Context7 MCP for accessing updated documentation.
Setting up the agent involves defining its instructions and listing the tools it will use. The focus starts with `web_search` and `shell` to create a project, followed by integrating `apply_patch` for code iteration. The agent runs in a dedicated workspace to ensure it only affects its own files, minimizing risk during command execution. A `ShellExecutor` class handles shell commands, asking for user approval before execution and managing outputs.
The agent is tasked with creating a NextJS app that displays a specific dashboard. Users provide prompts, and the agent processes them, running the necessary commands to scaffold the app and install dependencies. The guide includes code snippets for installation and setup, along with details on how to manage command execution safely. The overall approach emphasizes automation and user interaction while maintaining control over the coding environment.
Questions about this article
No questions yet.