Metadata-Version: 2.4
Name: gitlater
Version: 0.2.1
Summary: Not now. Later.
Project-URL: Homepage, https://github.com/cwahyu/gitlater
Project-URL: Repository, https://github.com/cwahyu/gitlater
Project-URL: Issues, https://github.com/cwahyu/gitlater/issues
Author: Catur Wahyu
License: MIT
License-File: LICENSE
Keywords: cli,git,pre-commit,productivity,time-management
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# gitlater

Not now. Later.

## What is this?

`gitlater` is a small tool that helps you **do things at the right time**.

It started with git commits.
Now it works anywhere — CLI, pre-commit, or inside your Python scripts.

It doesn’t optimize productivity.
It protects your boundaries.

## Why?

Sometimes the problem is not:

- writing code
- committing code
- running scripts

But **when** you do it.

`gitlater` helps you say:

> Not now. Later.”

## Features

- simple time-based commit guard
- two modes:
  - `personal` → allow outside working hours
  - `work` → allow during working hours
- weekend & holiday awareness
- project-level configuration
- zero external dependencies

## Installation

### Using uv (CLI tool)

```bash
uv tool install gitlater
```

### Using uv (Python dependency)

```bash
uv add gitlater
```

### Local development

```bash
uv sync
uv run gitlater status
```

## Setup

Initialize in your project:

```bash
gitlater init
```

This creates:

```text
.gitlater/
  config.toml
  holidays.txt
```

## Configuration

### .gitlater/config.toml

```toml
mode = "personal"

[work_hours]
start = 9
end = 18
```

### .gitlater/holidays.txt

```text
2026-01-01 # New Year
2026-08-17 # Independence Day
```

## Pre-commit integration

Add to your local pre-commit config:

```yaml
- repo: local
  hooks:
    - id: gitlater
      name: git later
      entry: gitlater check
      language: system
      stages: [pre-commit]
      pass_filenames: false
```

`pass_filenames: false` ensures the check runs once (not per file).

## Usage

```bash
gitlater status
```

Example:

```text
🌙 Not now — this time is yours.

🗓 Friday • 10:08
⏳ Next window: 18:00
```

## Using in Python scripts

`gitlater` can also be used directly inside Python scripts.

### Basic check

```python
from gitlater import allow

if not allow():
    print("Skip execution")
    exit()

# run your logic
print("Running task...")
```

### Get status message

```python
from gitlater import status

allowed, message = status()

if not allowed:
    print(message)
else:
    print("Running task...")
```

### Enforce (exit automatically)

```python
from gitlater import guard

guard()

# only runs if allowed
print("Running task...")
```

### Notes

- Uses the same .gitlater/ configuration as the CLI
- Behavior depends on the current working directory
- No external dependencies required

## Philosophy

gitlater is intentionally simple.

- no remote API
- no auto-detection
- no global config

It doesn’t decide your schedule.

## Roadmap

Keep it boring.

Future improvements (if needed):

- better status output
- small UX refinements
- optional helpers (init, holidays)

## License

MIT
