Skip to main content

You stuffed command shell with aliases, tools and colors but you lose it all when using ssh. The mission of xxh is to bring your favorite shell wherever you go through the ssh without root access and system installations.

If you like the idea of xxh click ⭐ on the repo and tweet now.

[xxh demo]

Portable. Preparing portable shells and plugins occurs locally and then xxh uploads the result to host. No installations or root access on the host required. The security and careful about environment on the host are behind it. Hermetic. If you delete ~/.xxh directory from the remote host then xxh has never been on the host. By default your home is .xxh directory and you can choose the hermetic level of your xxh session. Careful. No blindfold copying config files from local to remote host. Following the privacy and repeatability reasons the better way is to fork the xxh plugin or shell example and pack your configs to it.
Be open and fork-ready. Every xxh repo could be forked, customized and reused without waiting for package management system, xxh releases or any third party. Currently supported five shells and the count could be increased by community. Do more. The xxh packages are not only about shells. Any type of tool or code could be behind entrypoint. If you want to run browsh on the remote host just put it as entrypoint in xxh-shell. Chameleon. Switching the shells as easy as possible and not really needed to use only one shell. Choose your current shell along with task you want to solve: xxh anyhost +s xonsh for python environment, osquery for simple querying, fish for modern features or time-tested zsh and bash.

Installation methods

PyPi 3

pip3 install xxh-xxh

pipx - good alternative to brew and pip, read comparision

pipx install xxh-xxh

Conda-forge feedstock

conda config --add channels conda-forge
conda install xxh-xxh

Homebrew

brew install xxh

Linux portable binary

mkdir ~/xxh && cd ~/xxh
wget https://github.com/xxh/xxh-portable/raw/master/result/xxh-portable-musl-alpine-Linux-x86_64.tar.gz
tar -xzf xxh-portable-musl-alpine-Linux-x86_64.tar.gz
./xxh

Linux AppImage

mkdir ~/xxh && cd ~/xxh
wget -O xxh https://github.com/xxh/xxh-appimage/releases/download/continuous/xxh-release-x86_64.AppImage
chmod +x xxh && ./xxh

Shells

Currently supported OS for target host is Linux on x86_64.

xxh-shell status xxh-plugins seamless demo
xonsh stable autojump, [+] xxh.xsh +
zsh stable ohmyzsh, p10k, [+] xxh.zsh +
fish stable ohmyfish, fisher, userconfig, [+] todo
bash stable ohmybash, [+] xxh.bash +
osquery beta
fish-appimage alpha

Search xxh shell on Github or Bitbucket or create your shell entrypoint to use another portable shell.

Prerun plugins

Prerun plugins allow to bring any portable tools, dotfiles, aliases to xxh session before running shell.

Pinned plugins: core (xxh-sudo, xxh-screen), dotfiles, docker, python, xxh, vim.

Usage

Use xxh as replace ssh to connecting to the Linux host without changing ssh arguments:

xxh <host from ~/.ssh/config>
xxh [ssh arguments] [user@]host[:port] [xxh arguments]
xxh local [xxh arguments]

Common examples (use xxh --help to get info about arguments):

xxh anyhost                                       # Connect to the host
xxh -i id_rsa -p 2222 anyhost                     # Using ssh arguments: port and key
xxh anyhost +s zsh +i                             # Set the shell and install it without yes-no question
xxh anyhost +s xonsh +hhh "~"                     # Set /home/user as home directory (read Q&A)
xxh anyhost +s bash +I xxh-plugin-bash-vim        # Preinstall the plugin
xxh anyhost +if +q                                # Force reinstall xxh on the host in quiet mode
xxh anyhost +hh /tmp/xxh +hhr                     # Upload xxh to /tmp/xxh and remove when disconnect 
source xxh.zsh anyhost +I xxh-plugin-zsh-ohmyzsh  # Connect in seamless mode with ohmyzsh plugin
xxh local +s xonsh                                # Experimental: build xxh environment inplace and without ssh

To reusing arguments and simplifying xxh usage to xxh anyhost there is config file.

Install xxh packages

xxh [+I xxh-package +I ...] [+L] [+RI xxh-package +RI ...] [+R xxh-package +R ...]

Different ways to set the xxh package source:

xxh +I xxh-shell-example                                         # install from https://github.com/xxh
xxh +I https://github.com/xxh/xxh-shell-example                  # short url for github only, for other sources use examples below or add support
xxh +I https://github.com/xxh/xxh-shell-example/tree/mybranch    # short url for github only, for other sources use examples below or add support
xxh +I xxh-shell-example+git+https://github.com/xxh/xxh-shell-example                 # long url for any git repo
xxh +I xxh-shell-example+git+https://github.com/xxh/xxh-shell-example/tree/mybranch   # github only branch support
xxh +I xxh-shell-example+path+/home/user/my-xxh-dev/xxh-shell-example                 # install from local path

Using xxh inplace without ssh connection

This is experimental magic. Please read the text below twice.

If you have a shell access on the host or you're in docker container and you can't ssh to it then you can download and build hermetic xxh environment inplace. The xxh local command works exectly like xxh remote_host and creates hermetic environment in ~/.xxh by default.

At this time we haven't portable build tools like git, wget, curl, tar and others which could be required by xxh packages build scripts. The xxh local expects the tools are on host.

To run xxh inplace on Linux x86_64 just copy and paste this bash commands:

XH=~/.xxh \
 && XD=https://github.com/xxh/xxh-portable/raw/master/result/xxh-portable-musl-alpine-Linux-x86_64.tar.gz \
 && mkdir -p $XH && cd $XH \
 && ( [[ -x $(command -v curl) ]] && curl -L $XD || wget -O- $XD ) | tar zxf - xxh \
 && echo 'Usage: ./xxh local [+s xonsh/zsh/fish/osquery/bash]'

Next time you're on host just run ~/.xxh/xxh local and you will be in your xxh environment.

Examples of use cases

Python with pip everywhere without installation

Way 1. Using xonsh

xxh anyhost +s xonsh

anyhost> python --version
Python 3.8.2

You'll get python-powered xonsh shell with portable python and pip on the host without any system installations on the host. You can install PyPi packages manually or bring it with you automatically by using xxh-plugin-prerun-dotfiles. Also don't forget about xxh-plugins like autojump.

Way 2. Using portable python on any xxh shell

xxh +RI xxh-plugin-prerun-python
xxh anyhost +s zsh

anyhost> python --version
Python 3.8.2
anyhost> pip install pandas

Using xxh-plugin-prerun-python you'll get portable Python AppImage which can be used on host without python and with any xxh shell.

Using docker on host without root access

Try xxh-plugin-prerun-docker:

xxh +RI xxh-plugin-prerun-docker
xxh anyhost +if

anyhost> xxh-docker-run
anyhost> docker ps                                                                                                                                                                                                                            
CONTAINER ID        IMAGE               COMMAND
anyhost> docker run --rm hello-world | grep Hello
Hello from Docker!
anyhost> xxh-docker-stop

Bring dotfiles to xxh session

There is xxh-plugin-prerun-dotfiles which creates config files when you go to the host using xxh. You can fork it and create your cozy settings once and forever.

Seamless Oh My Zsh (demo)

source xxh.zsh anyhost +I xxh-plugin-zsh-ohmyzsh +if +q 

This command brings your current Oh My Zsh session theme to the xxh session. If you need more complex settings just fork the xxh-plugin-zsh-ohmyzsh and hack it.

Read host as a table with osquery

$ xxh anyhost +s osquery
osquery> SELECT * FROM users WHERE username='news';
+-----+-----+----------+-------------+-----------------+-------------------+
| uid | gid | username | description | directory       | shell             |
+-----+-----+----------+-------------+-----------------+-------------------+
| 9   | 9   | news     | news        | /var/spool/news | /usr/sbin/nologin |
+-----+-----+----------+-------------+-----------------+-------------------+

All in one portable home

The xxh is very agile. You can create your own xxh-shell (shell word means it has entrypoint) which has any portable tools that you could help you on the host. Bash xxh-shell is one of this platforms that could be forked and stuffed.

Questions and answers

Development

In the xxh-dev repo there is full dockerised environment for development, testing and contribution. The process of testing and development is orchestrated by xde tool and as easy as possible.

We have teams. If you're in team it does not oblige to do something. The main goal of teams is to create group of passionate people who could help or support in complex questions. Some people could be expert in one shell and newbie in another shell and mutual assistance is the key to xxh evolution. Ask join.

Thanks

Metadata

Release files for offsh-xxh 1.0.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 offsh-xxh 1.0.0
File Size Uploaded Provenance Actions
offsh-xxh-1.0.0.tar.gz 24.2 kB Without provenance Details for offsh-xxh-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for offsh-xxh 1.0.0
File Interpreter ABI Platform Actions
offsh_xxh-1.0.0-py3-none-any.whl Python 3 none any Details for offsh_xxh-1.0.0-py3-none-any.whl

Total release size: 50.1 kB

Release files / offsh-xxh-1.0.0.tar.gz

Download URL offsh-xxh-1.0.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7b3d76e76972063c821ee073d86bbe9c9aae9bdbc6e5865406fa19316110ce25
BLAKE2b-256 checksum
How to use checksums
6aa6d899b97a34f5a0ee232d235a7d20636a02078570eff8f1e8325135347d17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Release files / offsh_xxh-1.0.0-py3-none-any.whl

Download URL offsh_xxh-1.0.0-py3-none-any.whl
Size 25.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84912cf4d663f89eb635ccb177ba2922945567d50dd690e046a71d9e48e5646d
BLAKE2b-256 checksum
How to use checksums
6bb2dfd3cff390c42d8948d4c7cb7b9a0e752a8052ba7011be19610462a501e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Security for offsh-xxh 1.0.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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

1.0.0 This release

2 release files No 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