Metadata-Version: 2.4
Name: pro-inital
Version: 0.1.3
Summary: Initialize Git/GitHub backup, auto backup hooks, and releases for a project.
Author: Dawalishi
License-Expression: MIT
Keywords: git,github,backup,release,project-init
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# pro-inital

`pro-init` turns the current directory into a Git-backed project with optional GitHub backup, automatic push hooks, idle-time auto backup, and a first GitHub Release.

Chinese documentation: [README_zh.md](README_zh.md)

## What it is for

Use `pro-init` when you start or inherit a local project and want a repeatable safety baseline:

- initialize Git if the directory is not already a repository
- configure Git identity when missing
- check `git`, GitHub CLI `gh`, and Chocolatey on Windows
- guide GitHub CLI login
- exclude files larger than 10 MB from Git backup
- create a GitHub remote repository when requested
- commit the current project state
- create a first GitHub Release when requested
- install project-level scripts under `.pro_init/`
- install a `post-commit` hook that pushes after every commit
- optionally install a Windows scheduled task that watches the project and auto commits/pushes after files become idle

## Install

```powershell
python -m pip install pro-inital
```

For local wheel testing:

```powershell
python -m pip install .\dist\pro_inital-0.1.3-py3-none-any.whl
```

## Quick start

Open PowerShell in the project directory:

```powershell
cd path\to\your\project
pro-init
```

Follow the prompts. The default flow creates a private GitHub repository and a first release.

## Common commands

Initialize with no GitHub remote:

```powershell
pro-init --no-remote
```

Create a public GitHub repository instead of private:

```powershell
pro-init --public
```

Choose a repository name:

```powershell
pro-init --repo-name MyProject
```

Choose the first release tag:

```powershell
pro-init --release-version v0.1.0
```

## Generated files

Generated project scripts are placed under:

```text
.pro_init/
```

The main generated scripts are:

- `.pro_init/git_backup.ps1`: commit and push current changes
- `.pro_init/auto_backup_watch.ps1`: watch files and auto backup after idle time
- `.pro_init/install_auto_backup_task.ps1`: install the Windows scheduled task
- `.pro_init/create_release.ps1`: create a GitHub Release from a clean working tree

## Automatic backup

`pro-init` installs a local Git hook:

```text
.git/hooks/post-commit
```

The hook pushes automatically after each commit, but only when `origin` exists.

If you accept the scheduled task prompt, a Windows task starts the watcher after login. The watcher waits until file activity has been idle, then runs:

```text
git add .
git commit -m "Auto backup <timestamp>"
git push
```

This is designed for small project code changes. Keep generated build outputs ignored.

## Large file rule

Files larger than 10 MB are written to `.gitignore` before backup. The generated backup script also rescans for new large files before committing.

This avoids accidentally committing maps, datasets, bitstreams, videos, logs, or archives. Use Git LFS or external storage for large artifacts.

## Release policy

Automatic backups are for history and recovery. Releases should represent stable milestones.

Create a release manually from a clean repository:

```powershell
.\.pro_init\create_release.ps1 -Version v0.1.1 -Title "Stable milestone"
```

## Requirements

- Python 3.9+
- Windows PowerShell for auto-install and scheduled-task features
- Git
- GitHub CLI `gh`
- Chocolatey only when `git` or `gh` need to be installed automatically on Windows

## Troubleshooting

Check GitHub login:

```powershell
gh auth status
```

Check remote:

```powershell
git remote -v
```

Check current Git state:

```powershell
git status
```

Start the generated watcher task manually:

```powershell
Start-ScheduledTask -TaskName "ProInit_AutoBackup_<project_name>"
```
