Metadata-Version: 2.4
Name: lwg-git
Version: 0.1.1
Summary: Light Weight Git - a simple Git command-line interface
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# LWG — Light Weight Git

[![PyPI](https://img.shields.io/pypi/v/lwg-git)](https://pypi.org/project/lwg-git/)
[![Python](https://img.shields.io/pypi/pyversions/lwg-git)](https://pypi.org/project/lwg-git/)
[![License](https://img.shields.io/github/license/darkrho07/lwg)](https://github.com/darkrho07/lwg/blob/main/LICENSE)

**LWG (Light Weight Git)** is a lightweight command-line tool that simplifies common Git workflows into short, easy-to-remember commands.

Instead of repeatedly typing multiple Git commands, LWG provides a simple interface for initializing repositories, committing changes, and pushing them to a remote repository.

---

## Features

- Simple Git workflow
- Quick repository initialization
- One-command commit and push
- GitHub HTTPS authentication setup
- Clear error handling
- Lightweight Python CLI
- Uses your existing Git installation

---

## Requirements

Before installing LWG, make sure you have:

- **Python 3.10 or newer**
- **Git**
- A GitHub account and repository if you want to push to GitHub

Check your installed versions:

```bash
python --version
git --version
```

---

## Installation

Install LWG directly from PyPI:

```bash
python -m pip install lwg-git
```

Verify the installation:

```bash
lwg --version
```

You can also view the available commands:

```bash
lwg --help
```

---

## Quick Start

### 1. Configure GitHub Authentication

If you use GitHub over HTTPS, configure your credentials:

```bash
lwg setup
```

LWG will ask for:

- GitHub username
- GitHub Personal Access Token (PAT)

> **Note:** GitHub does not accept your normal account password for Git HTTPS authentication. Use a Personal Access Token instead.

If your Git authentication is already configured, you can skip this step.

---

### 2. Initialize a Repository

Navigate to your project directory:

```bash
cd my-project
```

Then run:

```bash
lwg i https://github.com/USERNAME/REPOSITORY.git
```

LWG performs the equivalent of:

```bash
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin https://github.com/USERNAME/REPOSITORY.git
git push -u origin main
```

Your project is now initialized and pushed to the remote repository.

---

### 3. Push Changes

After making changes to your project, run:

```bash
lwg p "your commit message" main
```

For example:

```bash
lwg p "added authentication system" main
```

This performs:

```bash
git add .
git commit -m "added authentication system"
git push origin main
```

---

# Commands

| Command | Description |
|---|---|
| `lwg --help` | Display available commands |
| `lwg --version` | Display the installed version |
| `lwg setup` | Configure GitHub HTTPS credentials |
| `lwg i <url>` | Initialize a repository and connect it to a remote |
| `lwg p <message> <branch>` | Commit and push changes |

---

# Command Reference

## `lwg setup`

Configure GitHub HTTPS credentials.

```bash
lwg setup
```

LWG will prompt you for your GitHub username and Personal Access Token.

Example:

```text
LWG GitHub Setup
----------------
GitHub username: your-username
GitHub personal access token: ********

✓ GitHub credentials configured.
✓ Username: your-username
✓ Token saved.
```

---

## `lwg i <url>`

Initialize the current directory as a Git repository and connect it to a remote repository.

### Syntax

```bash
lwg i <repository-url>
```

### Example

```bash
lwg i https://github.com/username/my-project.git
```

This command:

1. Initializes a Git repository.
2. Stages the project files.
3. Creates the initial commit.
4. Renames the branch to `main`.
5. Adds the remote repository as `origin`.
6. Pushes the `main` branch.

---

## `lwg p <message> <branch>`

Stage, commit, and push changes to a remote branch.

### Syntax

```bash
lwg p "<commit message>" <branch>
```

### Example

```bash
lwg p "fix login bug" main
```

This is equivalent to:

```bash
git add .
git commit -m "fix login bug"
git push origin main
```

---

## `lwg --help`

Display the command-line help:

```bash
lwg --help
```

---

## `lwg --version`

Display the installed LWG version:

```bash
lwg --version
```

---

# Typical Workflow

A typical first-time workflow looks like this:

```bash
cd my-project

lwg setup

lwg i https://github.com/username/my-project.git
```

After making changes:

```bash
lwg p "added new feature" main
```

And for another update:

```bash
lwg p "fixed authentication bug" main
```

---

# Why LWG?

A typical Git repository setup requires multiple commands:

```bash
git init
git add .
git commit -m "Initial commit"
git branch -M main
git remote add origin URL
git push -u origin main
```

LWG simplifies this into:

```bash
lwg i URL
```

Likewise, a normal update requires:

```bash
git add .
git commit -m "message"
git push origin main
```

With LWG:

```bash
lwg p "message" main
```

LWG is designed to provide a simple interface for common Git workflows while keeping Git as the underlying version control system.

---

# Development

Clone the repository:

```bash
git clone https://github.com/darkrho07/lwg.git
cd lwg
```

Install LWG in editable mode:

```bash
python -m pip install -e .
```

Run the development version:

```bash
lwg --help
```

---

# Project Structure

```text
lwg/
├── .github/
│   └── workflows/
│       └── release.yml
├── src/
│   └── lwg/
│       ├── __init__.py
│       ├── __main__.py
│       ├── auth.py
│       ├── cli.py
│       └── git.py
├── tests/
│   └── __init__.py
├── .gitignore
├── LICENSE
├── README.md
└── pyproject.toml
```

---

# Contributing

Contributions, bug reports, and feature requests are welcome.

### To contribute:

1. Fork the repository.
2. Create a new branch.
3. Make your changes.
4. Test your changes.
5. Open a pull request.

For bugs and feature requests, open an issue on GitHub.

---

# License

LWG is released under the **MIT License**.

See the [LICENSE](LICENSE) file for details.

---

# Links

- [PyPI](https://pypi.org/project/lwg-git/)
- [GitHub Repository](https://github.com/darkrho07/lwg)
- [Issues](https://github.com/darkrho07/lwg/issues)

---

# Author

Created and maintained by **[darkrho07](https://github.com/darkrho07)**.

If you find LWG useful, consider giving the repository a ⭐ on GitHub.
