Reference
ptywright exposes an early CLI, Rust library, JSON-RPC automation protocol, trusted Lua plugin runtime, and shell completion generation.
Crate metadata
- Crate:
ptywright - Binary:
ptywright - Current version:
0.3.0 - License: MIT
- Repository: https://github.com/utensils/ptywright
- Docs site: https://utensils.io/ptywright/
Current public API families
TargetandTerminalSizefor spawn configuration.Session,SessionConfig,SessionEvent,SessionExitStatus,CancellationToken, andSignalfor PTY-backed process lifecycle (including cancellable waits and cross-platform signal delivery).Terminal,ScreenSnapshot,ScreenCell,ScreenCellStyle, andCursorStatefor rendered terminal observation.ActionandKeyfor deterministic input (includingAction::MarkTranscriptfor plugin-driven transcript boundary marks).Matcher,MatchResult,MatchOutcome,MatcherContext,PluginRegistry,PredicateContext, andPredicateOutcomefor event-driven waits and plugin-definedMatcher::Luapredicates.Transcript,TranscriptConfig, andTranscriptFileConfigfor bounded output retention with optional raw file streaming.RpcServer,RpcServerState,serve_ndjson,serve_lsp,serve_ndjson_with_state, andserve_lsp_with_statefor JSON-RPC automation.Extension,LuaExtension,ExtensionHandle,ExtensionStateSnapshot,ExtensionEvent,ActionPlan,ClassifyContext,HostMark, andStateCandidatefor the generic plugin-backed automation layer that drives Claude Code and any future built-in TUI plugin.LuaPlugin,LuaPluginRegistry,PluginManifest,PluginManifestError,DefaultTarget,PluginKind,PluginRuntime,PluginPermission,PluginHostCapabilities, andbuiltin_manifestsfor trusted extension authoring and host capability discovery.RedactionPolicyfor opt-in caller-supplied redaction andRedactingMakeWriter/RedactingWriterfor redaction-awaretracingsinks.Pathsandexpand_tildefor the~/.ptywright/runtime directory layout.Config,LoggingConfig, andLogFormatfor on-disk configuration.init_for_run,init_for_serve_stdio,init_for_serve_socket,init_for_oneshot,cleanup_old_logs, andLogGuardfor the structured-logging stack with daily rotation, retention, and per-record redaction.
See the dedicated CLI, library, JSON-RPC, plugin reference, and Claude Code guide pages for details.