aimux 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aimux-0.1.1/.git +1 -0
- aimux-0.1.1/.gitignore +10 -0
- aimux-0.1.1/PKG-INFO +63 -0
- aimux-0.1.1/README.md +50 -0
- aimux-0.1.1/SKILL.md +93 -0
- aimux-0.1.1/design.md +1038 -0
- aimux-0.1.1/pyproject.toml +36 -0
- aimux-0.1.1/skills/sync_file/SKILL.md +100 -0
- aimux-0.1.1/src/aimux/__init__.py +2 -0
- aimux-0.1.1/src/aimux/__main__.py +4 -0
- aimux-0.1.1/src/aimux/aimux.conf +8 -0
- aimux-0.1.1/src/aimux/cli.py +607 -0
- aimux-0.1.1/src/aimux/constants.py +31 -0
- aimux-0.1.1/src/aimux/output.py +37 -0
- aimux-0.1.1/src/aimux/session.py +105 -0
- aimux-0.1.1/src/aimux/ssh.py +318 -0
- aimux-0.1.1/src/aimux/tmux.py +147 -0
- aimux-0.1.1/src/aimux/transfer.py +365 -0
- aimux-0.1.1/src/aimux/wait.py +43 -0
- aimux-0.1.1/tests/.gitkeep +1 -0
- aimux-0.1.1/tests/conftest.py +11 -0
- aimux-0.1.1/tests/manual_localhost_8824_remote.md +191 -0
- aimux-0.1.1/tests/remote_test.md +130 -0
- aimux-0.1.1/tests/test_cli_remote.py +197 -0
- aimux-0.1.1/tests/test_file_transfer.py +193 -0
- aimux-0.1.1/tests/test_remote_server_integration.py +46 -0
- aimux-0.1.1/tests/test_ssh_remote.py +177 -0
- aimux-0.1.1/tests/test_tmux.py +28 -0
aimux-0.1.1/.git
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gitdir: /home/fuqingxu/cc-workspace/aimux/.git/worktrees/283a4107
|
aimux-0.1.1/.gitignore
ADDED
aimux-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aimux
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: AI-agent-friendly tmux wrapper: unified local + remote sessions, single-pane sessions, safe primitives.
|
|
5
|
+
Author: aimux
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Requires-Dist: rich>=13
|
|
9
|
+
Requires-Dist: typer>=0.12
|
|
10
|
+
Provides-Extra: test
|
|
11
|
+
Requires-Dist: pytest>=8; extra == 'test'
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# aimux
|
|
15
|
+
|
|
16
|
+
AI-agent-friendly tmux wrapper. See `design.md` for the full specification.
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install -e .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# create a local session
|
|
28
|
+
aimux new --name=dev
|
|
29
|
+
|
|
30
|
+
# send a command, wait, then read the last 200 lines
|
|
31
|
+
aimux send-keys local/dev -- "make test" Enter
|
|
32
|
+
aimux wait-last-command-complete local/dev --timeout=5m --print-lines=200
|
|
33
|
+
|
|
34
|
+
# list everything
|
|
35
|
+
aimux ls
|
|
36
|
+
|
|
37
|
+
# upload files or directories to an SSH host via sftp
|
|
38
|
+
aimux send_files worker /tmp/upload ./dist ./README.md --gitignore
|
|
39
|
+
aimux get_files worker ./downloads /tmp/upload/README.md /tmp/upload/dist
|
|
40
|
+
|
|
41
|
+
# done
|
|
42
|
+
aimux kill local/dev
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Remote sessions are local tmux sessions whose first pane runs `ssh <host>`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aimux remote add --host=10.0.1.5 --port=22 --user=deploy --name=worker
|
|
49
|
+
aimux new --remote=worker --name=task-1
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Tests
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
python3 -m pytest
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
For the issue server `root@localhost:8824`, see the human-readable manual test
|
|
59
|
+
in `tests/manual_localhost_8824_remote.md`. To verify a remote session by
|
|
60
|
+
listing files on the target host, see `tests/remote_test.md`.
|
|
61
|
+
|
|
62
|
+
Command surface: session commands, file transfer commands, and remote host commands. See
|
|
63
|
+
`design.md`.
|
aimux-0.1.1/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# aimux
|
|
2
|
+
|
|
3
|
+
AI-agent-friendly tmux wrapper. See `design.md` for the full specification.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install -e .
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# create a local session
|
|
15
|
+
aimux new --name=dev
|
|
16
|
+
|
|
17
|
+
# send a command, wait, then read the last 200 lines
|
|
18
|
+
aimux send-keys local/dev -- "make test" Enter
|
|
19
|
+
aimux wait-last-command-complete local/dev --timeout=5m --print-lines=200
|
|
20
|
+
|
|
21
|
+
# list everything
|
|
22
|
+
aimux ls
|
|
23
|
+
|
|
24
|
+
# upload files or directories to an SSH host via sftp
|
|
25
|
+
aimux send_files worker /tmp/upload ./dist ./README.md --gitignore
|
|
26
|
+
aimux get_files worker ./downloads /tmp/upload/README.md /tmp/upload/dist
|
|
27
|
+
|
|
28
|
+
# done
|
|
29
|
+
aimux kill local/dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Remote sessions are local tmux sessions whose first pane runs `ssh <host>`:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
aimux remote add --host=10.0.1.5 --port=22 --user=deploy --name=worker
|
|
36
|
+
aimux new --remote=worker --name=task-1
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Tests
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python3 -m pytest
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For the issue server `root@localhost:8824`, see the human-readable manual test
|
|
46
|
+
in `tests/manual_localhost_8824_remote.md`. To verify a remote session by
|
|
47
|
+
listing files on the target host, see `tests/remote_test.md`.
|
|
48
|
+
|
|
49
|
+
Command surface: session commands, file transfer commands, and remote host commands. See
|
|
50
|
+
`design.md`.
|
aimux-0.1.1/SKILL.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aimux
|
|
3
|
+
description: |
|
|
4
|
+
Use aimux when you need a long-lived shell session — a REPL, a build/server you
|
|
5
|
+
want to interact with across multiple commands, or anything running on a remote
|
|
6
|
+
SSH host. Use bash directly for one-shot commands. aimux gives you session
|
|
7
|
+
primitives, file-transfer helpers, and remote-host helpers; this skill
|
|
8
|
+
explains how to combine them.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Usage
|
|
13
|
+
|
|
14
|
+
`aimux` is tool that enables tmux-like capability cross ssh.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
(.venv) /home/.../...$ aimux -h
|
|
18
|
+
|
|
19
|
+
Usage: aimux [OPTIONS] COMMAND [ARGS]...
|
|
20
|
+
|
|
21
|
+
aimux — AI-agent-friendly tmux wrapper.
|
|
22
|
+
|
|
23
|
+
─ Options
|
|
24
|
+
--help -h Show this message and exit.
|
|
25
|
+
|
|
26
|
+
─ Commands
|
|
27
|
+
ls List all aimux sessions.
|
|
28
|
+
new Create a new session.
|
|
29
|
+
attach Attach to a session. ⚠️ Human use only — agents should use send-keys + capture.
|
|
30
|
+
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.
|
|
31
|
+
send_files Upload multiple local files or directories to an SSH host using sftp.
|
|
32
|
+
get_files Download multiple remote files or directories from an SSH host using sftp.
|
|
33
|
+
capture Capture pane output (last N lines).
|
|
34
|
+
kill Destroy a single session. Does not accept wildcards or batch.
|
|
35
|
+
wait-last-command-complete Block until the pane's foreground process is back at a shell. Local sessions only.
|
|
36
|
+
remote Remote-host management (reads/appends ~/.ssh/config).
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
# Example
|
|
40
|
+
|
|
41
|
+
1. adding and naming a remote host in `aimux`.
|
|
42
|
+
|
|
43
|
+
First, usually you will get a ssh address, for example,
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
HostName localhost
|
|
47
|
+
Port 8824
|
|
48
|
+
User root
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To begin, you will need to check whether this address is already inside `aimux`'s storage:
|
|
52
|
+
```bash
|
|
53
|
+
$ aimux remote ls
|
|
54
|
+
HOST USER HOSTNAME PORT STATUS RTT
|
|
55
|
+
github.com git github.com 22 auth-required 2261ms
|
|
56
|
+
local-8824 root localhost 8824 reachable 709ms
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If not in storage, you will have to add that server using:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
aimux remote add --host localhost --port 8824 --user root --name local-8824 --timeout 2s
|
|
63
|
+
aimux remote test local-8824 --timeout 2s
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
2. Creating a session and run command in it.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
aimux new --remote local-8824 --name testsession
|
|
70
|
+
aimux send-keys "local-8824/testsession" -- 'ls -la' Enter
|
|
71
|
+
aimux capture "local-8824/testsession" --lines 200
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. Upload and download files.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# aimux send_files REMOTE REMOTE_DIR LOCAL_PATH... [--gitignore]
|
|
78
|
+
# aimux get_files REMOTE LOCAL_DIR REMOTE_PATH...
|
|
79
|
+
aimux send_files local-8824 /tmp/upload /home/fuqingxu/cc-workspace/aimux/2fdacb03/tests
|
|
80
|
+
aimux get_files local-8824 /home/fuqingxu/cc-workspace/aimux /tmp/upload
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use `--gitignore` on upload when ignored files should be skipped:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
aimux send_files local-8824 /tmp/upload /home/fuqingxu/cc-workspace/aimux/2fdacb03/tests --gitignore
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
4. Clean up.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
aimux kill "local-8824/testsession"
|
|
93
|
+
```
|