Add Claude Code integration: shared config + Setup tab

- Shared servers.json at ~/.server-connections/ (GUI + Claude Code)
- Setup tab: one-click install of ssh.py, /ssh skill, SSH key
- Duplicate checks — safe to run multiple times
- tools/ssh.py + tools/skill-ssh.md bundled
- Updated README with integration docs (EN/RU/ZH)
- Deploy guide for new machines

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chrome-storm-c442
2026-02-23 09:01:22 -05:00
parent e84975b4c1
commit 42a6a876d3
7 changed files with 868 additions and 21 deletions

211
README.md
View File

@@ -2,7 +2,7 @@
<p align="center">
<strong>Desktop GUI for managing remote servers</strong><br>
CustomTkinter + Paramiko | Dark Theme
CustomTkinter + Paramiko | Dark Theme | Claude Code Integration
</p>
<p align="center">
@@ -22,6 +22,7 @@
- **SFTP Transfer** — upload/download files with progress bar
- **SSH Keys** — generate ed25519, install on server, copy to clipboard
- **Status Monitor** — background check every 60 sec (online/offline badges)
- **Claude Code Integration** — one-click setup, shared config with `/ssh` skill
- **Dark Theme** — modern CustomTkinter interface
### Installation
@@ -55,12 +56,41 @@ Output goes to `releases/ServerManager-v1.0.0-{platform}.exe`
3. **Terminal** — select server → Terminal tab → type command → Run
4. **Files** — select server → Files tab → set paths → Upload/Download
5. **Keys** — Keys tab → Generate Key → Install on Server
6. Status badges update automatically (green = online, red = offline)
6. **Setup** — Setup tab → "Install Everything" → Claude Code ready
7. Status badges update automatically (green = online, red = offline)
### Claude Code Integration
ServerManager and Claude Code share the same config file: `~/.server-connections/servers.json`
**How it works:**
```
ServerManager GUI ←→ ~/.server-connections/servers.json ←→ ssh.py (Claude Code)
↕ ↕
Add/edit/delete /ssh skill
servers in GUI executes commands
```
- Add a server in GUI → Claude Code sees it immediately via `/ssh list`
- Both use the same `ssh.py` + `servers.json`
- Passwords **never** pass through the AI API
**Setup on a new machine:**
1. Install ServerManager (clone repo or download binary)
2. Open Setup tab → click "Install Everything"
3. Done. Claude Code now has `/ssh` skill and access to your servers
The Setup tab installs:
- `ssh.py``~/.server-connections/` (SSH utility)
- `/ssh` skill → `~/.claude/commands/ssh.md` (Claude Code skill)
- SSH key (ed25519) — if not exists
- Checks for duplicates — safe to run multiple times
### Configuration
On first launch, `config/servers.json` is created from template.
Add servers via GUI or edit the JSON directly.
Shared config location: `~/.server-connections/servers.json`
Add servers via GUI or edit the JSON directly:
```json
{
@@ -96,7 +126,7 @@ App executes: sudo -S -p '' bash -c 'systemctl restart nginx'
### Security
- `config/servers.json` is in `.gitignore` — never committed
- `servers.json` is in `.gitignore` — never committed
- Passwords stored locally only, **never sent to any AI/API**
- SSH keys (ed25519) — recommended auth method
- sudo password sent via stdin (not visible in process list)
@@ -110,19 +140,40 @@ ServerManager/
├── version.py # Version info
├── build.py # PyInstaller build script
├── core/ # Business logic
│ ├── server_store.py # CRUD + JSON + observer
│ ├── server_store.py # CRUD + JSON + observer (shared config)
│ ├── ssh_client.py # Paramiko SSH/SFTP wrapper
│ ├── claude_setup.py # Claude Code integration installer
│ ├── status_checker.py # Background monitoring
│ └── connection_factory.py
├── gui/ # CustomTkinter UI
│ ├── app.py # Main window
│ ├── sidebar.py # Server list + search
│ ├── server_dialog.py # Add/Edit modal
│ ├── tabs/ # Terminal, Files, Info, Keys
│ ├── tabs/ # Terminal, Files, Info, Keys, Setup
│ └── widgets/ # StatusBadge
├── config/ # Server configs
├── tools/ # CLI tools (installed to ~/.server-connections/)
│ ├── ssh.py # SSH utility for Claude Code
│ └── skill-ssh.md # /ssh skill template
├── config/ # Example configs
├── releases/ # Built executables
└── docs/ # Documentation
└── README.md # This file (EN/RU/ZH)
```
### Deploy on a new machine
```bash
# 1. Clone
git clone https://git.sensey24.ru/aibot777/server-manager.git
cd server-manager
# 2. Install deps
pip install -r requirements.txt
# 3. Launch and setup
python main.py
# → Setup tab → Install Everything
# → Add your servers via + Add
# → Done! Both GUI and Claude Code are ready
```
---
@@ -136,6 +187,7 @@ ServerManager/
- **SFTP** — загрузка и скачивание файлов с прогресс-баром
- **SSH-ключи** — генерация ed25519, установка на сервер, копирование
- **Мониторинг** — фоновая проверка каждые 60 сек (бейджи online/offline)
- **Интеграция с Claude Code** — установка в один клик, общий конфиг со скиллом `/ssh`
- **Тёмная тема** — современный интерфейс CustomTkinter
### Установка
@@ -169,12 +221,57 @@ python build.py
3. **Терминал** — выберите сервер → вкладка Terminal → введите команду → Run
4. **Файлы** — выберите сервер → вкладка Files → укажите пути → Upload/Download
5. **Ключи** — вкладка Keys → Generate Key → Install on Server
6. Бейджи статуса обновляются автоматически (зелёный = online, красный = offline)
6. **Настройка Claude** — вкладка Setup → "Install Everything" → Claude Code готов
7. Бейджи статуса обновляются автоматически (зелёный = online, красный = offline)
### Интеграция с Claude Code
ServerManager и Claude Code используют **один и тот же файл конфигурации**: `~/.server-connections/servers.json`
**Как это работает:**
```
ServerManager GUI ←→ ~/.server-connections/servers.json ←→ ssh.py (Claude Code)
↕ ↕
Добавил/изменил скилл /ssh
сервер в GUI выполняет команды
```
- Добавил сервер в GUI → Claude Code сразу видит его через `/ssh list`
- Оба используют один `ssh.py` + `servers.json`
- Пароли **никогда** не проходят через API нейронки
**Настройка на новой машине:**
1. Установить ServerManager (клонировать репо или скачать бинарник)
2. Открыть вкладку Setup → нажать "Install Everything"
3. Готово. Claude Code теперь имеет скилл `/ssh` и доступ к серверам
Вкладка Setup устанавливает:
- `ssh.py``~/.server-connections/` (SSH-утилита)
- скилл `/ssh``~/.claude/commands/ssh.md` (скилл Claude Code)
- SSH-ключ (ed25519) — если ещё не создан
- Проверяет дубли — безопасно запускать повторно
### Конфигурация
При первом запуске `config/servers.json` создаётся из шаблона.
Добавляйте серверы через GUI или редактируйте JSON напрямую.
Общий конфиг: `~/.server-connections/servers.json`
Добавляйте серверы через GUI или редактируйте JSON:
```json
{
"servers": [
{
"alias": "my-server",
"ip": "1.2.3.4",
"port": 22,
"user": "root",
"password": "secret",
"type": "ssh",
"notes": "Production"
}
]
}
```
### Авто-sudo
@@ -194,12 +291,29 @@ python build.py
### Безопасность
- `config/servers.json` в `.gitignore` — никогда не коммитится
- `servers.json` в `.gitignore` — никогда не коммитится
- Пароли хранятся только локально, **никогда не передаются в AI/API**
- SSH-ключи (ed25519) — рекомендуемый метод аутентификации
- sudo-пароль передаётся через stdin (не виден в списке процессов)
- При использовании с Claude Code: через API нейронки проходят только alias + команда, пароли остаются в локальном JSON-файле
### Развёртывание на новой машине
```bash
# 1. Клонировать
git clone https://git.sensey24.ru/aibot777/server-manager.git
cd server-manager
# 2. Установить зависимости
pip install -r requirements.txt
# 3. Запустить и настроить
python main.py
# → Вкладка Setup → Install Everything
# → Добавить серверы через + Add
# → Готово! GUI и Claude Code работают с одним конфигом
```
---
## 中文
@@ -211,6 +325,7 @@ python build.py
- **SFTP传输** — 带进度条的文件上传/下载
- **SSH密钥** — 生成ed25519、安装到服务器、复制到剪贴板
- **状态监控** — 每60秒后台检查在线/离线徽标)
- **Claude Code集成** — 一键设置,与`/ssh`技能共享配置
- **深色主题** — 现代CustomTkinter界面
### 安装
@@ -244,12 +359,57 @@ python build.py
3. **终端** — 选择服务器 → Terminal标签 → 输入命令 → Run
4. **文件** — 选择服务器 → Files标签 → 设置路径 → Upload/Download
5. **密钥** — Keys标签 → Generate Key → Install on Server
6. 状态徽标自动更新(绿色 = 在线,红色 = 离线)
6. **设置Claude** — Setup标签 → "Install Everything" → Claude Code就绪
7. 状态徽标自动更新(绿色 = 在线,红色 = 离线)
### Claude Code集成
ServerManager和Claude Code共享**同一个配置文件**`~/.server-connections/servers.json`
**工作原理:**
```
ServerManager GUI ←→ ~/.server-connections/servers.json ←→ ssh.py (Claude Code)
↕ ↕
在GUI中添加/编辑 /ssh技能
服务器 执行命令
```
- 在GUI中添加服务器 → Claude Code立即通过 `/ssh list` 看到
- 两者使用相同的 `ssh.py` + `servers.json`
- 密码**绝不**通过AI API传递
**在新机器上设置:**
1. 安装ServerManager克隆仓库或下载二进制文件
2. 打开Setup标签 → 点击 "Install Everything"
3. 完成。Claude Code现在拥有 `/ssh` 技能并可访问您的服务器
Setup标签安装
- `ssh.py``~/.server-connections/`SSH工具
- `/ssh` 技能 → `~/.claude/commands/ssh.md`Claude Code技能
- SSH密钥ed25519— 如果不存在
- 检查重复 — 可安全重复运行
### 配置
首次启动时,`config/servers.json` 从模板自动创建。
通过GUI添加服务器或直接编辑JSON文件。
共享配置位置:`~/.server-connections/servers.json`
通过GUI添加服务器或直接编辑JSON
```json
{
"servers": [
{
"alias": "my-server",
"ip": "1.2.3.4",
"port": 22,
"user": "root",
"password": "secret",
"type": "ssh",
"notes": "Production"
}
]
}
```
### 自动sudo
@@ -269,12 +429,29 @@ python build.py
### 安全性
- `config/servers.json``.gitignore` 中 — 永不提交
- `servers.json``.gitignore` 中 — 永不提交
- 密码仅存储在本地,**绝不发送到任何AI/API**
- SSH密钥ed25519— 推荐的认证方式
- sudo密码通过stdin传递在进程列表中不可见
- 与Claude Code配合使用时只有别名和命令通过AI API传递密码保留在本地JSON文件中
### 在新机器上部署
```bash
# 1. 克隆
git clone https://git.sensey24.ru/aibot777/server-manager.git
cd server-manager
# 2. 安装依赖
pip install -r requirements.txt
# 3. 启动并设置
python main.py
# → Setup标签 → Install Everything
# → 通过 + Add 添加服务器
# → 完成GUI和Claude Code使用同一个配置
```
---
## License