# charmbracelet/wish

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/charmbracelet-wish).**

4,919 stars · 96 forks · Go · mit

## Links

- GitHub: https://github.com/charmbracelet/wish
- awesome-repositories: https://awesome-repositories.com/repository/charmbracelet-wish.md

## Topics

`hacktoberfest` `ssh`

## Description

Wish is a Go library for building SSH servers, providing a middleware-based framework that handles core SSH functionality including public-key and certificate authentication, session management, and secure file transfers via SCP and SFTP. It is designed to serve as the foundation for custom SSH applications, with built-in support for hosting Git repositories over SSH and serving interactive terminal applications.

What distinguishes Wish from a basic SSH server library is its composable middleware pattern, which allows developers to layer authentication, logging, and custom session handling. It supports environment-based and session-type access controls, reverse port forwarding for tunneling, and SSH certificate authorization. The library also includes configuration for host keys, server banners, version strings, and graceful shutdown, along with automatic host key generation for quick prototyping.

Beyond its core server features, Wish provides session-level error handling, client environment variable access, and output writing. For terminal applications, it offers pseudo-terminal allocation, input handling for key presses, mouse events, and paste actions, as well as remote clipboard access via the OSC52 protocol.

Wish is available as a Go package with documentation covering server setup, middleware usage, and integration with Git and terminal applications.

## Tags

### Networking & Communication

- [SSH Server Frameworks](https://awesome-repositories.com/f/networking-communication/ssh-server-frameworks.md) — Ships a Go library for building and hosting secure shell server daemons with middleware and PTY support.
- [SSH Data Transfers](https://awesome-repositories.com/f/networking-communication/ssh-data-transfers.md) — Handling SCP and SFTP file uploads and downloads over SSH connections.
- [Git SSH Servers](https://awesome-repositories.com/f/networking-communication/ssh-server-frameworks/git-ssh-servers.md) — Handles Git upload-pack and receive-pack requests by interpreting the git-upload-pack and git-receive-pack subsystems over SSH.
- [Automatic Repository Creators](https://awesome-repositories.com/f/networking-communication/ssh-server-frameworks/git-ssh-servers/automatic-repository-creators.md) — The SSH server library serves Git repositories over SSH, handling upload-pack and receive-pack requests with automatic repository creation. ([source](https://github.com/charmbracelet/wish/blob/main/examples))
- [OSC52 Clipboard Protocol Implementations](https://awesome-repositories.com/f/networking-communication/osc52-clipboard-protocol-implementations.md) — Provides remote clipboard read and write via the OSC52 protocol during SSH sessions. ([source](https://github.com/charmbracelet/wish/blob/main/UPGRADE_GUIDE_V2.md))
- [Reverse Tunnels](https://awesome-repositories.com/f/networking-communication/reverse-tunnels.md) — Creates reverse tunnels where the SSH server connects back to the client’s network, exposing remote services through the session. ([source](https://github.com/charmbracelet/wish/tree/main/examples))
- [SSH File Transfer Servers](https://awesome-repositories.com/f/networking-communication/ssh-server-frameworks/ssh-file-transfer-servers.md) — An SSH server implementation that supports SCP and SFTP protocols for secure file uploads and downloads.

### Part of an Awesome List

- [Terminal Application Servers](https://awesome-repositories.com/f/awesome-lists/devtools/ssh-libraries/terminal-application-servers.md) — Serves full-screen terminal applications over SSH with pseudo-terminal allocation and resize handling.

### Development Tools & Productivity

- [SCP and SFTP Subsystem Handlers](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems/scp-and-sftp-subsystem-handlers.md) — The SSH server library manages SCP, SFTP, and Git protocol operations for file transfer and repository access. ([source](https://github.com/charmbracelet/wish/tree/main/examples))
- [Bracketed Paste Event Detectors](https://awesome-repositories.com/f/development-tools-productivity/code-editors-ides/extension-ecosystems-management/editor-extensions/editor-utilities/text-pasting-utilities/bracketed-paste-event-detectors.md) — Treats paste actions as distinct bracketed-paste events for custom processing of pasted content. ([source](https://github.com/charmbracelet/wish/blob/main/UPGRADE_GUIDE_V2.md))
- [SFTP Subsystems](https://awesome-repositories.com/f/development-tools-productivity/remote-file-transfers/sftp-subsystems.md) — Manages secure file upload and download by implementing the SCP and SFTP subsystem protocols over the SSH connection.
- [Pseudo-Terminal Commands](https://awesome-repositories.com/f/development-tools-productivity/shell-command-execution/pseudo-terminal-commands.md) — Executes shell commands with pseudo-terminal allocation, forwarding standard I/O and detecting terminal type. ([source](https://github.com/charmbracelet/wish/blob/main/cmd_windows.go))

### Security & Cryptography

- [SSH Environment Access Controls](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/access-control-models/attribute-based-access-controls/ssh-environment-access-controls.md) — The SSH server library limits incoming connections to those with an active terminal and/or matching a predefined set of commands. ([source](https://github.com/charmbracelet/wish/blob/main/README.md))
- [Public Key Authentication](https://awesome-repositories.com/f/security-cryptography/public-key-authentication.md) — Verifies connecting clients using public-key or certificate-based authentication against authorised keys or a trusted CA.
- [SSH Authorized Keys Validators](https://awesome-repositories.com/f/security-cryptography/public-key-authentication/public-key-access-control/ssh-authorized-keys-validators.md) — The SSH server library validates connecting clients against an authorized_keys file, allowing only listed public keys. ([source](https://github.com/charmbracelet/wish/blob/main/options.go))
- [SSH Command Restriction Controls](https://awesome-repositories.com/f/security-cryptography/server-access-controls/ssh-command-restriction-controls.md) — The SSH server library blocks connections without an active terminal or allows only specified commands. ([source](https://github.com/charmbracelet/wish#readme))
- [Pluggable Authentication Methods](https://awesome-repositories.com/f/security-cryptography/ssh-authentication/pluggable-authentication-methods.md) — The SSH server library authenticates users using public-key, password, or other methods before granting access. ([source](https://github.com/charmbracelet/wish/blob/main/examples))
- [Session Authorization](https://awesome-repositories.com/f/security-cryptography/ssh-authentication/session-authorization.md) — Verifying users via public keys, passwords, or signed certificates, and restricting access by session type or authorized keys.
- [SSH Certificate Authentication](https://awesome-repositories.com/f/security-cryptography/ssh-certificate-authentication.md) — The SSH server library accepts client certificates signed by a trusted Certificate Authority, checking validity and authority. ([source](https://github.com/charmbracelet/wish/blob/main/options.go))

### User Interface & Experience

- [Terminal Mouse Event Capturers](https://awesome-repositories.com/f/user-interface-experience/mouse-event-handlers/terminal-mouse-event-capturers.md) — Captures mouse clicks, scrolls, and movements from terminals supporting mouse tracking protocol. ([source](https://github.com/charmbracelet/wish/blob/main/UPGRADE_GUIDE_V2.md))
- [SSH-Terminal UI Bridges](https://awesome-repositories.com/f/user-interface-experience/terminal-ui-components/ssh-terminal-ui-bridges.md) — Runs interactive terminal UI applications inside SSH sessions with pseudo-terminal allocation. ([source](https://github.com/charmbracelet/wish/tree/main/examples))
- [Press vs Release Differentiators](https://awesome-repositories.com/f/user-interface-experience/form-and-input-management/input-handling/secondary-modifier-keys/keyboard-input-listeners/single-press-listeners/press-vs-release-differentiators.md) — Distinguishes key press from release events for separate handling in SSH sessions. ([source](https://github.com/charmbracelet/wish/blob/main/UPGRADE_GUIDE_V2.md))

### Web Development

- [SSH Handler Middlewares](https://awesome-repositories.com/f/web-development/middleware-composition-layers/ssh-handler-middlewares.md) — Chains middleware functions to wrap SSH session handlers with authentication, logging, and custom logic. ([source](https://github.com/charmbracelet/wish/blob/main/options.go))
- [SSH Servers for TUIs](https://awesome-repositories.com/f/web-development/terminal-application-frameworks/ssh-servers-for-tuis.md) — Serves full-screen terminal applications over SSH so remote users can interact with them through pseudo-terminals. ([source](https://github.com/charmbracelet/wish/blob/main/examples))

### Operating Systems & Systems Programming

- [Pseudo-Terminal Interfaces](https://awesome-repositories.com/f/operating-systems-systems-programming/terminal-command-line-environments/terminal-infrastructure/pseudo-terminal-interfaces.md) — Allocates pseudo-terminals to remote commands so interactive programs behave as if in a local shell. ([source](https://github.com/charmbracelet/wish/blob/main/examples))
