Metadata-Version: 2.4
Name: github-sync-agent
Version: 0.1.4
Summary: Sync all your local projects to GitHub automatically
License: MIT
Project-URL: Homepage, https://github.com/yuvalavni/Agents
Project-URL: Repository, https://github.com/yuvalavni/Agents
Project-URL: Bug Tracker, https://github.com/yuvalavni/Agents/issues
Keywords: github,git,sync,backup,automation,cli
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Environment :: Console
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pyyaml>=6.0
Requires-Dist: click>=8.0

# GitHub Sync Agent

Automatically syncs every local project directory to its own GitHub repository.

For each project it will:
1. `git init` if not already a repo
2. Create the GitHub repo if it doesn't exist yet
3. Ensure the remote uses SSH
4. Stage + commit any uncommitted changes
5. Push to `origin`

Runs daily via a systemd user timer, and on-demand via CLI.

---

## Installation

```bash
pip install github-sync-agent
```

## First-time setup

```bash
github-sync init
```

The wizard will:
- Check `git` and `gh` are installed
- Authenticate with GitHub (`gh auth login`)
- Ask which folder to scan for projects
- Set up your SSH key automatically
- **Verify SSH works** (auto-fixes port 443 and ssh-agent if needed)
- Write a config file to `~/.config/github-sync/config.yaml`

Setup will **not** complete until `ssh -T git@github.com` succeeds.

---

## Usage

```bash
# Sync all projects
github-sync sync

# Sync a single project
github-sync sync --project my-project

# Preview without making changes
github-sync sync --dry-run

# Show status of all projects
github-sync status
```

---

## Configuration (`~/.config/github-sync/config.yaml`)

Generated by `github-sync init`. You can edit it at any time.

| Key | Default | Description |
|-----|---------|-------------|
| `github_user` | _(detected from gh auth)_ | Your GitHub username |
| `projects_root` | `~/projects` | Scans all subdirectories here |
| `schedule_time` | `02:00` | Daily run time |
| `default_visibility` | `private` | `private` or `public` for new repos |
| `auto_commit_message` | `chore: auto-sync` | Commit message for auto-commits |
| `exclude` | `[]` | Directory names to skip |
| `log_file` | `~/.local/share/github-sync/github-sync.log` | Log file path |
| `log_level` | `INFO` | `DEBUG` / `INFO` / `WARNING` / `ERROR` |

### Excluding a project

```yaml
exclude:
  - SomeProjectToSkip
```

---

## Requirements

- Python 3.10+
- `git` installed
- `gh` (GitHub CLI) installed — [installation guide](https://cli.github.com)

---

## License

MIT
