Skip to main content

ghostcrt

Modern terminal UI for managing multiple SSH sessions with an encrypted password vault. Inspired by SecureCRT®.

Licensed under GNU GPLv3 (GPL-3.0-only).

SecureCRT is a registered trademark of VanDyke Software, Inc. ghostcrt is not affiliated with or endorsed by VanDyke Software.

Compact terminal UI

One-row controls and session tabs, arrow-key dropdown menus, clear selection markers, and a contextual footer keep the interface compact. A grey rule, like the host sidebar's edge, separates the session tabs from the terminal; when the tabs have focus, the active tab is outlined in the cursor colour. Narrow terminals use a host drawer that closes when the SSH terminal gains focus. The host editor keeps advanced settings collapsed until needed. Colors follow the existing Textual theme picker (Ctrl+P).

Use Ctrl+T to return from a session to Hosts, F10 to focus the menu bar, and Ctrl+H for help. Run ghostcrt after installing it below.

Features (v1)

  • Inventory from ~/.ssh/config and ~/.config/ghostcrt/includes/, grouped as a tree (sidebar + fuzzy filter)
  • Live interactive SSH sessions in tabs (real ssh binary in a PTY)
  • Ghostty terminal emulation, scrollback, and input handling via ghostty-textual
  • Encrypted local vault for SSH passwords (Argon2id + AES-256-GCM)
  • Password delivery via sshpass -d (never in argv / env / disk)
  • In-app host config and vault management
  • Password profiles: store a password once under a profile id and pick it per host from a dropdown
  • Textual built-in themes (Ctrl+P), applied to both the UI and terminal palette

System dependencies

  • OpenSSH client (ssh)
  • sshpass (required only when connecting with a vault password)

macOS: brew install hudochenkov/sshpass/sshpass (or your preferred tap)

Install

Requires Python 3.12+ on macOS 13+ or glibc Linux 2.27+, on x86_64 or ARM64. The native terminal library is installed automatically from PyPI; no compilation is needed.

Install as an isolated command-line tool with uv:

uv tool install ghostcrt
ghostcrt

Or install with pip in a virtual environment:

python3 -m venv .venv
source .venv/bin/activate
python -m pip install ghostcrt
ghostcrt

To upgrade, run uv tool upgrade ghostcrt or, in the activated environment, python -m pip install --upgrade ghostcrt.

Develop

The dependency is pinned to ghostty-textual 0.1.0 on PyPI, which pins pyghostty==0.1.4. uv sync installs the packages and bundled native library automatically.

git clone https://github.com/ayder/ghostcrt.git
cd ghostcrt
uv sync --all-extras
uv run pytest
uv run ghostcrt

CLI

ghostcrt [--config PATH] [--vault PATH] [--theme NAME] [--debug] [-h] [--version]
Flag Meaning
--config SSH config file (default ~/.ssh/config)
--vault Vault file path (default ~/.config/ghostcrt/vault.enc)
--theme Textual theme id (persisted if valid)
--debug Debug logging to stderr (never logs secrets)

Keys

Key Action
Ctrl+P Command palette (themes, etc.)
Ctrl+H Show keyboard help
Ctrl+O Toggle mouse capture / native terminal selection
Ctrl+T From the terminal, show and focus the host list; from Hosts, hide it for a full-width terminal
Ctrl+N, then 1–5 In the terminal: type that snippet. Elsewhere Ctrl+N focuses the host list
/ Focus host filter (outside the terminal)
F10 Focus menu bar (outside the terminal)
Esc (Hosts) Return to active terminal and close the narrow host drawer
↑↓ / ←→ (menus) Choose action / switch menu
Ctrl+W Close active session
Ctrl+Q / Esc (unlock) Quit
Shift+PageUp/Down Scroll local terminal history
Mouse wheel Scroll local terminal history
Right-hand scrollbar Drag to scroll history; click the track to page
Mouse drag Select text to copy

Click a tab's × to close that session. Exited sessions close immediately; running or connecting sessions ask for confirmation. Ctrl+W and Session → Close use the same confirmation. Ctrl+Q asks before disconnecting any live sessions.

Multiline paste is supported. When the remote application enables bracketed paste, the text is sent as a single paste block. Otherwise, line breaks are sent as Enter presses, so pasted shell commands may execute immediately.

Mouse reporting is never forwarded to the remote host. Full-screen programs (Vim, htop, tmux) may still request it — set mouse=a and friends are simply ignored — so the wheel and text selection always belong to the pane. Use Shift+PageUp/Down, the wheel, or the pane's right-hand scrollbar for scrollback. On macOS, use Ctrl+O to release mouse capture to the host terminal for native selection, and press it again to restore ghostcrt mouse handling.

Groups

A group is a file in ~/.config/ghostcrt/includes/. The filename is the group name, so production.conf becomes the group production.

~/.config/ghostcrt/includes/
  production.conf     Host srv1 srv2 srv3
                          User jorn
  staging.conf        Host srv4 srv5 srv6
                          User jornv

ghostcrt never writes ~/.ssh/config. It needs one line at the top:

Include ~/.config/ghostcrt/includes/*.conf

On first run it offers to add that line for you, backing the file up to ~/.ssh/config.bak first. The line must be at the top — ssh takes the first value it finds for each keyword, so an Include below a Host * block would be shadowed.

Hosts defined in ~/.ssh/config stay visible and connectable but are read-only, marked [RO]. Use Hosts → Copy to group… to adopt one into a group, where it becomes editable. Because the include is read first, the copy wins; the original is marked ⊘ <group> to show it has been shadowed.

Clone and delete hosts

Hosts → Clone selected… opens an Add host form with the selected host's settings and vault profile copied. It suggests an unused -copy alias; edit it as needed, save, and choose the destination group. Read-only hosts can also be cloned.

Deleting through Hosts → Delete selected… or the editor's Delete button shows the host details and asks for OK / Cancel confirmation before removing the whole host block, including its aliases.

Advanced host settings

The host editor includes optional fields for ProxyCommand, IdentitiesOnly, UserKnownHostsFile, ControlMaster, ControlPath, and ControlPersist. These support configurations such as GCP IAP tunnels without requiring a manual config-file edit.

The Forwarding area accepts one LocalForward, RemoteForward, or DynamicForward directive per line, including multiple directives of the same type. Any other host-level SSH option can be entered in Additional directives, one Directive value entry per line.

Vault profiles

A profile is a named password, created with Vault → Create / update profile…. Assign one from the host editor's dropdown or Vault → Assign profile to selected host…; (none) removes the assignment.

Snippets

Vault → Snippets… stores up to five snippets, each with a short name and a text. In the terminal, press Ctrl+N and then 1–5, or click a snippet's button in the footer, to type it into the session. \n (or a real line break) is typed as Enter, and \\ types a single backslash. Snippets are typed as keystrokes, not pasted, so a trailing \n submits the line. They are encrypted in the vault, so they can hold passwords. The text is shown in clear only while the snippet is open in its editor.

Security notes

  • Master password is never stored. Lost key ⇒ Reset vault… and re-enter secrets.
  • Vault file mode 0600; config dir 0700.
  • No recovery mechanism by design.
  • Host-key prompts are handled by real ssh inside the terminal widget. Vault password connections first make a password-free verification connection, so you can accept or reject a new host key before sshpass starts the login.
  • Vault files are format 3 from 0.4.0, which adds snippets; ghostcrt 0.3.2 and earlier cannot open them. Older vaults (format 1 or format 2) open normally and are rewritten as format 3 on their first change.

Limitations (v1)

  • Reads the top-level ~/.ssh/config and our own includes directory; other Include directives are not followed.
  • Pattern hosts (*, ?, !) are shown as non-connectable settings entries.
  • Multi-alias vault entries are per selected alias (no cross-alias fallback).
  • Linux + macOS only.

Tests

uv run pytest
uv run --no-project python scripts/checks.py         # every CI check, this OS, every Python
uv run --no-project python scripts/checks.py --all   # plus the Ubuntu jobs in Docker

CI and the local gate run the same list of checks, kept in pyproject.toml under [tool.ghostcrt.checks]: locked sync, Ruff (uncached), tests, a dependency audit on Ubuntu/Python 3.12, wheel and source builds, twine check, and clean wheel/source installation smoke tests. The runner uses the uv version pinned there, and tests/test_ci_drift.py fails if the workflows stop matching it. --all runs the committed tree (HEAD) in an ubuntu:24.04 container as a non-root user, so Docker must be running.

The gate prints each test name and the 15 slowest test durations. A 60-second watchdog covers each test and its teardown, dumping thread stacks and stopping pytest if it hangs instead of waiting for the CI job limit.

Host-key integration tests use an optional local Docker SSH server and isolated temporary known_hosts files. With sshpass installed:

docker build -t ghostcrt-ssh-test tests/ssh/fixtures
docker run -d --rm --name ghostcrt-ssh-test -p 127.0.0.1:22222:22 ghostcrt-ssh-test
GHOSTCRT_TEST_SSH_PORT=22222 uv run pytest tests/ssh/test_host_key_integration.py
docker stop ghostcrt-ssh-test

Design decisions

ghostcrt owns SSH processes, PTYs, host configuration, and the encrypted vault. ghostty-textual owns terminal emulation, rendering, input encoding, and scrollback. Mouse events stay local so remote applications cannot take over pane selection.

--config PATH applies to both the inventory and every SSH connection/reconnect. It uses OpenSSH's -F option, which also bypasses the system-wide SSH config. The setup check requires a leading, unconditional Include covering all group files. Existing partial or conditional includes do not satisfy this check.

GitHub CI runs the checks above on Ubuntu 24.04 and macOS 15 with Python 3.12 and 3.14.

Releases

Update the version in pyproject.toml, regenerate uv.lock, and record the changes in CHANGELOG.md. Merge the release PR, tag that commit (for this release, v0.5.0), and publish its GitHub Release.

The Release workflow checks that the tag matches the package version and runs the same checks as CI on Linux and macOS with Python 3.12 and 3.14. After all jobs pass, it builds and smoke-tests the wheel and source distribution, validates PyPI metadata, and attaches the distributions to the GitHub Release. An isolated job publishes those same files to PyPI through Trusted Publishing with attestations. PR and branch builds only validate packages.

Before the first PyPI release:

  1. Create a GitHub Actions environment named pypi in ayder/ghostcrt.
  2. Add a pending Trusted Publisher in the owner's PyPI publishing settings with project name ghostcrt, owner ayder, repository ghostcrt, workflow release.yml, and environment pypi. For an existing project, add the publisher in that project's publishing settings. No PyPI API token is needed.
  3. Merge this PR before publishing the v0.5.0 GitHub Release.

Retry failed jobs from Actions after fixing any publisher configuration. The workflow also supports Actions → Release → Run workflow on main with an existing published release tag containing this workflow (0.5.0 or later). It compares existing GitHub assets before reusing them, and skips files already on PyPI. Published versions cannot be replaced; use a new version for subsequent releases.

Metadata

Release files for ghostcrt 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghostcrt 0.5.0
File Size Uploaded Provenance Actions
ghostcrt-0.5.0.tar.gz 157.0 kB With provenance Details for ghostcrt-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ghostcrt 0.5.0
File Interpreter ABI Platform Actions
ghostcrt-0.5.0-py3-none-any.whl Python 3 none any Details for ghostcrt-0.5.0-py3-none-any.whl

Total release size: 239.4 kB

Release files / ghostcrt-0.5.0.tar.gz

Download URL ghostcrt-0.5.0.tar.gz
Size 157.0 kB
Tags Source
SHA-256 checksum
How to use checksums
471fa9456aaefadace5b996e300976337f85a67339b62509c01fde7fea63d9c5
BLAKE2b-256 checksum
How to use checksums
35d1d2bf2653dd05650c1306b2d61fc74a30491fb432e5383f69a84920596fa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / ghostcrt-0.5.0-py3-none-any.whl

Download URL ghostcrt-0.5.0-py3-none-any.whl
Size 82.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab79050848611fb4c38577ff6722d10dce8a3109d15981d1450ced4a44df5981
BLAKE2b-256 checksum
How to use checksums
d762e46a2fb47870cb702edc9bb5a190188567c245118533c1bba217bf1cc25e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for ghostcrt 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ghostcrt-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page