Metadata-Version: 2.4
Name: sync-pilot
Version: 0.1.0
Summary: Interactive TUI tool for syncing projects to remote servers via rsync + SSH
Project-URL: Homepage, https://github.com/cidxb/sync-pilot
Project-URL: Repository, https://github.com/cidxb/sync-pilot
Author: Liang Yi
License-Expression: MIT
License-File: LICENSE
Keywords: remote,rsync,ssh,sync,training,tui
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Description-Content-Type: text/markdown

# sync-pilot

交互式 TUI 工具，通过 rsync + SSH 同步项目到远端服务器。专为 ML/DL 训练工作流设计。

Interactive TUI tool for syncing projects to remote servers via rsync + SSH. Built for ML/DL training workflows.

## Features / 功能

- **Push/Pull** — rsync 同步代码和 checkpoints
- **Remote Training** — 一键推送代码 + tmux 启动远端训练，自动加 `uv run` 前缀
- **Monitor** — GPU 状态、tmux session 输出查看、实时 attach、session 管理
- **Status** — 项目状态总览（远端目录大小、checkpoint 数量）
- **Data Push** — 一次性推送大型数据集
- **i18n** — 自动检测系统语言（中/英），支持 `--lang` 和 `SYNC_PILOT_LANG` 覆盖

## Install / 安装

```bash
pip install sync-pilot
# or
uv add sync-pilot
```

## Quick Start / 快速开始

```bash
# 1. Initialize config in your project directory
cd /path/to/your/project
sync-pilot init

# 2. Edit sync_config.yaml with your remote server info
vim sync_config.yaml

# 3. Launch interactive TUI
sync-pilot
```

## Usage / 使用

```bash
sync-pilot              # Interactive TUI menu
sync-pilot init         # Generate config files in current directory
sync-pilot push         # Push code to remote
sync-pilot pull         # Pull checkpoints from remote
sync-pilot train        # Push + launch remote training
sync-pilot push-data    # One-time data upload
sync-pilot watch        # Monitor GPU & tmux sessions
sync-pilot status       # Project status overview
```

### Options

```
-c, --config FILE    Config file path (default: auto-detect)
-p, --project NAME   Target project name
--lang zh|en         Force UI language
-V, --version        Show version
```

## Configuration / 配置

`sync_config.yaml`:

```yaml
remote_host: 1.2.3.4
remote_user: root
remote_port: 22          # Optional, default 22

projects:
  my_project:
    description: "My ML project"
    local_path: /home/user/workspace/project/
    remote_path: /mnt/workspace/project/
    exclude_file: rsync_exclude.txt   # Relative to this config file
    use_uv: true                      # Auto-prefix python commands with uv run
    pull_directories:
      - checkpoints/
    checkpoint_patterns:              # For status search (default: *.pth, *.pt)
      - "*.pth"
      - "*.safetensors"

  training_data:
    description: "Training dataset (32GB)"
    local_path: /home/user/data/
    remote_path: /mnt/data/
    pull_only: true                   # Prevent accidental push
```

### Config file auto-detection

sync-pilot looks for config files in this order:
1. `sync_config.yaml`
2. `sync-pilot.yaml`
3. `.sync-pilot.yaml`

## Requirements / 依赖

- Python >= 3.10
- `rsync` and `ssh` available on PATH
- `tmux` on the remote server (for training/watch features)
- SSH key-based auth configured (recommended)

## License

MIT
