Skip to main content

AI-agent-friendly tmux wrapper: unified local + remote sessions, single-pane sessions, safe primitives.

Project description

aimux

aimux is an AI-agent-friendly tmux wrapper.

Use aimux when you need a long-lived shell session — a REPL, a build/server you want to interact with across multiple commands, or anything running on a remote SSH host. Use bash directly for one-shot commands. aimux gives you session primitives, file-transfer helpers, and remote-host helpers; this skill explains how to combine them.

Install

pip install aimux # or `uv pip install aimux` if using uv venv

Usage

aimux is tool that enables tmux-like capability cross ssh.

(.venv) /home/.../...$ aimux -h

Usage: aimux [OPTIONS] COMMAND [ARGS]...

aimux  AI-agent-friendly tmux wrapper.

─ Options
--help  -h        Show this message and exit.

─ Commands 
ls                          List all aimux sessions.
new                         Create a new session.
attach                      Attach to a session. ⚠️  Human use only  agents should use send-keys + capture.
send-keys                   Send keys to a session. Behaves exactly like 'tmux send-keys': supports -F/-H/-K/-l/-M/-R/-X/-N <count>. Pass 'Enter' as a key to submit a line.     
send_files                  Upload multiple local files or directories to an SSH host using sftp.
get_files                   Download multiple remote files or directories from an SSH host using sftp.
capture                     Capture pane output (last N lines).
kill                        Destroy a single session. Does not accept wildcards or batch.
wait-last-command-complete  Block until the pane's foreground process is back at a shell. Local sessions only.
remote                      Remote-host management (reads/appends ~/.ssh/config).

Example

  1. adding and naming a remote host in aimux.

First, usually you will get a ssh address, for example,

HostName localhost
Port 8824
User root

To begin, you will need to check whether this address is already inside aimux's storage:

$ aimux remote ls
HOST              USER  HOSTNAME    PORT  STATUS         RTT   
github.com        git   github.com  22    auth-required  2261ms
local-8824        root  localhost   8824  reachable      709ms

If not in storage, you will have to add that server using:

aimux remote add --host localhost --port 8824 --user root --name local-8824 --timeout 2s
aimux remote test local-8824 --timeout 2s
  1. Creating a session and run command in it.
aimux new --remote local-8824 --name testsession
aimux send-keys "local-8824/testsession" -- 'ls -la' Enter
aimux capture "local-8824/testsession" --lines 200
  1. Creating a bridge session.

Bridge remotes are reverse-connected clients. Start a broker on the server, connect a client back to it, then create sessions through the same --remote API. Bridge remotes require an explicit profile:

# server
aimux bridge deploy --port=8765

# client
aimux reverse connect http://SERVER:8765 --identifier=winbox --token=<token>

# server
aimux remote ls
aimux new --remote=winbox --profile=cmd --name=cmd-1
aimux send-keys winbox/cmd-1 -- "echo hello" Enter
aimux capture winbox/cmd-1 --lines=50

Windows bridge profiles include cmd, powershell, pwsh, and mingw64 when available. macOS exposes mac-pty and mac-terminal; Linux exposes posix-pty.

  1. Forward a browser-facing HTTP service through the bridge server.
aimux port forward https://SERVER/aimux_bridge \
  --local-port=8080 \
  --remote-host=127.0.0.1 \
  --remote-port=3000 \
  --token=<token>

Open http://127.0.0.1:8080. Ordinary HTTP requests, streaming SSE responses, and WebSocket upgrades are forwarded to http://127.0.0.1:3000 from the bridge server's network namespace. Use --remote-scheme=https for an HTTPS target.

  1. Upload and download files.

File transfer for bridge remotes

aimux send_files and aimux get_files work the same way for bridge remotes as for SSH hosts — the CLI auto-detects the remote type and dispatches accordingly. Bridge transfers use a base64-encoded file.* message family over the existing SSE+POST channel, with no sftp dependency on the client.

aimux send_files winbox 'C:\Users\dev\proj' ./src --gitignore
aimux get_files winbox ./logs 'C:\Users\dev\proj\logs'

Differences vs the SSH path:

  • Single-file size limit defaults to 16 MiB (configurable via AIMUX_BRIDGE_MAX_FILE_SIZE if you want to override it in code).
  • Files are written with mode 0o644; existing timestamps/permissions are not preserved.
  • Symlinks are not followed on the remote side — they show up as symlink entries in directory listings and are skipped during recursive download.
  • .. segments in remote paths are rejected to prevent traversal.
# aimux send_files REMOTE REMOTE_DIR LOCAL_PATH... [--gitignore]
# aimux get_files REMOTE LOCAL_DIR REMOTE_PATH...
aimux send_files local-8824 /tmp/upload /home/testdir/tests
aimux get_files local-8824 /home/testdir/tests /tmp/upload

Use --gitignore on upload when ignored files should be skipped:

aimux send_files local-8824 /tmp/upload /home/testdir/tests --gitignore
  1. Clean up.
aimux kill "local-8824/testsession"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aimux-0.1.12.tar.gz (333.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aimux-0.1.12-py3-none-any.whl (58.8 kB view details)

Uploaded Python 3

File details

Details for the file aimux-0.1.12.tar.gz.

File metadata

  • Download URL: aimux-0.1.12.tar.gz
  • Upload date:
  • Size: 333.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aimux-0.1.12.tar.gz
Algorithm Hash digest
SHA256 701bcd5676380f8321250fc72db2eaedf19c0311ebc07eca423fc7dbad2f25be
MD5 661c8781649385c964f1ff4bf76acb3f
BLAKE2b-256 f85c8b61ac01e56fc5933f8add20e7fb9545d3fcd50dc7230fcf18f29c21c727

See more details on using hashes here.

File details

Details for the file aimux-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: aimux-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 58.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aimux-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 60f20fb3bf6955d9b205e6a34dd2dc77ea048db1b2c43b8f7f0c1a8f4ceefc3c
MD5 58c18feda8b7c0e079f73ee0a2ab8de0
BLAKE2b-256 fc3c8388d92d9464e065aaeb0d8f7299db49fa85c7968983213343bf03b7650b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page