8000 add PTY support by agents-git-bot[bot] · Pull Request #27252 · cloudflare/cloudflare-docs · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@agents-git-bot
Copy link
Contributor
@agents-git-bot agents-git-bot bot commented Dec 19, 2025

Summary

Sync documentation for sandbox-sdk PR #310: add PTY support

This PR adds comprehensive documentation for the new PTY (pseudo-terminal) feature that enables interactive terminal sessions in Cloudflare Sandbox.

Changes

New Documentation

  • PTY API Reference (src/content/docs/sandbox/api/pty.mdx):

    • Complete API documentation for sandbox.pty namespace
    • Methods: create(), attach(), getById(), list()
    • PTY handle methods: write(), resize(), kill(), onData(), onExit(), close()
    • Properties: id, sessionId, exited
    • Async iteration support
  • Usage Examples:

    • Interactive shell with xterm.js integration
    • Running vim/nano text editors
    • Scripted terminal interactions
    • Terminal resizing for responsive web terminals

Updated Documentation

  • API Index (src/content/docs/sandbox/api/index.mdx):
    • Added PTY card to API overview

What is PTY?

PTY (pseudo-terminal) provides full terminal control for interactive applications:

  • Interactive bash/shell sessions
  • Terminal-based text editors (vim, nano)
  • Applications requiring terminal control sequences
  • ANSI escape sequence support for colors and formatting

This differs from the existing Commands API which executes non-interactive commands and captures output.

Related Resources

  • Source PR: add PTY support sandbox-sdk#310
  • Changeset: adds sandbox.pty namespace with create/attach/getById/list methods
  • PTY handles support write/resize/kill operations and data/exit event listeners

Note: This documentation follows the Diátaxis framework with reference documentation and practical examples. The PTY feature is a minor release that adds significant new capability for terminal-based workflows.

@github-actions
Copy link
Contributor

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/docs/sandbox/ @whoiskatrin, @ghostwriternr, @cloudflare/pcx-technical-writing, @cloudflare/ai-agents

@agents-git-bot
Copy link
Contributor Author

Updated with comprehensive PTY API documentation:

  • Complete API reference for all pty methods (create(), attach(), getById(), list())
  • PTY handle methods documentation (write(), resize(), kill(), onData(), onExit(), close())
  • Async iteration support examples
  • Use case examples: interactive shells, language REPLs, automated terminal sessions
  • Transport considerations (HTTP vs WebSocket)
  • Updated API index with PTY card

Ready for review.

@agents-git-bot
Copy link
Contributor Author

Updated documentation with comprehensive PTY coverage:

Added Files

  • API Reference (src/content/docs/sandbox/api/pty.mdx): Complete PTY API documentation with all methods, parameters, and examples
  • How-to Guide (src/content/docs/sandbox/guides/interactive-terminals.mdx): Practical guide for building interactive terminal applications
  • API Index Update: Added PTY card to API navigation

Documentation Highlights

  • Clear distinction between PTY and Commands API use cases
  • Complete method documentation with TypeScript examples
  • Real-world use cases (interactive shells, text editors, Python REPL)
  • Control character handling and terminal resizing
  • Session attachment patterns
  • Error handling and best practices

All content follows Cloudflare docs style guide with TypeScriptExample components and proper linking.

🤖 Generated with Claude Code

Document the new PTY functionality added in sandbox-sdk PR #310.
PTY enables interactive terminal sessions for running shells, text
editors (vim/nano), and other terminal-based applications.

New documentation includes:
- Complete API reference for sandbox.pty namespace
- All PTY handle methods (write, resize, kill, onData, onExit, close)
- Usage examples for interactive shells, vim/nano, and scripted workflows
- Integration with xterm.js for web-based terminals
- Async iteration support for scripting

Related to: cloudflare/sandbox-sdk#310
@agents-git-bot agents-git-bot bot changed the title Sync docs from cloudflare/sandbox-sdk PR #310: add PTY support add PTY support Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0