xxh-xxh
The mission of xxh is to bring your favorite shell wherever you go through ssh without root acces.... Install via x-cmd for instant access and enhanced productivity.
| Language | Python |
| Homepage | https://github.com/xxh/xxh |
x install xxh-xxh
| x env | sh
|
| /pip3 | sh
|
| /pipx | sh
|
| /xpip | sh
|
| darwin/brew | sh
|
| darwin/port | sh
|
| linux/wget | sh
|
xxh: Bring Your Personalized Shell to Any Server via SSH Without Root Access
You spend hours configuring your perfect zsh setup with oh-my-zsh, custom aliases, and plugins—only to log into a remote server and find yourself back in a barebones bash environment. Without root access, you can't even install a new shell. This frustration compounds when managing multiple servers: each machine has a different environment, and your familiar toolchain stays locked on your local machine.
xxh's core value is straightforward: bring your complete personal shell environment to any Linux server via SSH without requiring root privileges or system installations. Whether it's xonsh, fish, zsh, or osquery, a single command lets you run your preferred shell on remote hosts, complete with plugins, configurations, and tools.
Core Design: Portable, Hermetic, Reversible
xxh takes a unique "package-upload-run" approach rather than acting as a traditional remote shell tool:
| Feature | Description |
|---|---|
| Portable | Shell and plugin preparation happens locally; xxh uploads the packaged environment to the target host. No installation or root access required on the remote side. |
| Hermetic | By default, xxh uses ~/.xxh as the home directory on remote hosts, completely isolated from the original environment. Delete this directory to clean up without leaving traces. |
| Careful | Doesn't blindly copy local config files to remote hosts. The recommended approach is to fork xxh plugin templates and package your configs into reusable plugins, following repeatability best practices. |
This design minimizes intrusion on target systems: you can use your custom shell on corporate servers, customer environments, or any restricted host without worrying about breaking existing configurations or leaving behind clutter.
Supported Shells and Plugin Ecosystem
xxh currently supports the following shells (target host must be Linux x86_64; ARM support is community-maintained):
| xxh-shell | Status | Available Plugins | Seamless Mode |
|---|---|---|---|
| xonsh | Stable | autojump, etc. | xxh.xsh |
| zsh | Stable | ohmyzsh, p10k, etc. | xxh.zsh |
| fish | Stable | ohmyfish, fisher, etc. | todo |
| bash | Stable | ohmybash, etc. | xxh.bash |
| osquery | Beta | - | - |
Prerun plugins are a key part of the xxh ecosystem, allowing you to preload any portable tools, dotfiles, or aliases before starting your shell:
- core: Includes xxh-sudo, xxh-screen, xxh-tmux
- dotfiles: Auto-deploy your dotfiles
- python: Portable Python environment
- zoxide: Smart directory jumping
- starship: Cross-shell prompt
All xxh repositories follow the fork-ready principle: you can fork any shell or plugin repository, customize it, and use it directly without waiting for official releases or third-party package managers.
Basic Usage: As Simple as SSH
xxh's command-line interface is designed to be compatible with ssh—just replace ssh with xxh:
# Basic connection
xxh <host>
# Using SSH arguments (port, key)
xxh -i id_rsa -p 2222 user@host
# Specify shell and auto-install (no confirmation)
xxh anyhost +s zsh +i
# Use xonsh and set home directory to /home/user
xxh anyhost +s xonsh +hhh "~"
# Pre-install plugin before connecting
xxh anyhost +s bash +I xxh-plugin-bash-vimWhy does xxh use plus (+) for arguments?
xxh uses + as the parameter prefix to reserve - for native SSH arguments. This allows you to change ssh to xxh in any command while keeping all other arguments exactly the same.
Seamless Mode
If you want xxh to completely replace your ssh interaction experience, you can use seamless mode. By sourcing the appropriate script, you can automatically load the xxh environment while maintaining your existing ssh habits:
# zsh seamless mode + ohmyzsh plugin
source xxh.zsh anyhost +I xxh-plugin-zsh-ohmyzshThis approach is particularly suitable for users who already have extensive host configurations in ~/.ssh/config.
Practical Use Cases
Scenario 1: Get a Python environment on any host
Method 1 - Using xonsh (built-in Python):
xxh anyhost +s xonsh
anyhost> python --version
Python 3.8.2Method 2 - Using prerun plugin (any shell):
xxh +RI xxh-plugin-prerun-python
xxh anyhost +s zsh
anyhost> pip install pandasScenario 2: Use Docker on hosts without root access
xxh +RI xxh-plugin-prerun-docker
xxh anyhost +if
anyhost> xxh-docker-run
anyhost> docker run --rm hello-worldScenario 3: Query host information using osquery
xxh anyhost +s osquery
osquery> SELECT * FROM users WHERE username='news';Scenario 4: Local mode (no SSH required)
If you're already on a host (e.g., inside a Docker container), you can use xxh local to build an isolated xxh environment in place:
xxh local +s xonshAdvanced Features
Custom Package Sources
xxh supports installing shells and plugins from various sources:
# Install from GitHub (shorthand)
xxh +I xxh-shell-example
# Specify branch
xxh +I https://github.com/xxh/xxh-shell-example/tree/mybranch
# Install from Git repository (full URL)
xxh +I xxh-shell-example+git+https://github.com/user/repo.git
# Install from local path (development/debugging)
xxh +I xxh-shell-example+path+/home/user/dev/xxh-shell-exampleConfiguration File
Create a configuration file for frequently used parameters:
# ~/.xxh/config.xxhc
hosts:
"*.prod.company.com":
+s: zsh
+I:
- xxh-plugin-zsh-ohmyzsh
+hh: "~"Connecting Through Jump Hosts
xxh supports connecting to internal hosts via jump servers:
xxh -J user@jump-server user@internal-serverTechnical Implementation
xxh's workflow can be summarized as:
- Local Build: Download or build the appropriate version of the shell and plugins for the target host architecture
- Package Compression: Package the environment into an archive containing necessary binaries and configurations
- Upload and Execute: Upload the package to
~/.xxhon the target host via SSH, extract it, and launch the entry script - Session Isolation: Run in an isolated home directory by default, completely separate from the original user environment
All operations are performed in user space without writing to system directories or modifying global configurations.
Summary
xxh addresses a long-neglected problem: how to get a consistent, personalized shell experience on restricted remote hosts. It's not meant to replace OpenSSH but adds a layer of portable environment management on top of ssh. For DevOps engineers who frequently work on multiple servers, developers who need to troubleshoot in customer environments, or anyone tired of repeating shell configurations on every new machine, xxh offers an elegant solution.
Key advantages to emphasize:
- Zero permission requirements: No sudo or root needed
- Zero residue: Delete
~/.xxhfor complete removal - Highly customizable: Fork and customize without waiting for official release cycles
- Multi-shell support: Freely switch between xonsh, zsh, fish, bash, and osquery
Related Resources
Source:
Related Link
Help us make these docs great!
All X-CMD docs are generated from command help and multiple data sources. See something that's wrong or unclear? Feel free to let us know through any of these ways~