Metadata-Version: 2.4
Name: cli-notifier
Version: 0.6.0
Summary: Push notifikasi ke HP via Telegram saat AI agent selesai task
Author: dinarradja
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

<!-- markdownlint-disable MD041 -->

[![CI](https://github.com/dinarradja/cli-notifier/actions/workflows/ci.yml/badge.svg)](https://github.com/dinarradja/cli-notifier/actions/workflows/ci.yml)
[![PyPI version](https://img.shields.io/pypi/v/cli-notifier)](https://pypi.org/project/cli-notifier/)
[![Python versions](https://img.shields.io/pypi/pyversions/cli-notifier)](https://pypi.org/project/cli-notifier/)
[![License](https://img.shields.io/pypi/l/cli-notifier)](LICENSE)

# CLI Notifier

Push notifikasi ke HP via **Telegram** saat AI agent selesai task.

```
AI Agent → notify → Telegram Bot API → HP
```

## Quick Install

```bash
pipx install cli-notifier
notify --init        # Setup AI agent global (CommandCode, Claude, Copilot)
notify --setup       # Setup Telegram @radjaCLInotifierBOT
```

**Selesai.** Setiap AI agent di project mana pun bakal kirim notifikasi ke HP.

## Cara Kerja

`notify` adalah **zero-dependency** Python script (stdlib aja — urllib, subprocess).
Kirim notifikasi langsung ke Telegram Bot API — gak perlu backend/server sendiri.

| Fitur | Status |
|-------|--------|
| Telegram bot bawaan — gak perlu bikin sendiri | ✅ |
| Zero dependency (stdlib only) | ✅ |
| Cross-platform (macOS, Linux, Windows) | ✅ |
| Auto-detect chat ID via getUpdates | ✅ |
| Env var override: `CLI_NOTIFIER_TOKEN` | ✅ |
| Global AI agent config via `--init` | ✅ |
| Clean uninstall via `--uninstall` | ✅ |
| Expo backend support (opsional) | ✅ |

## Usage

Wrap command (jalanin + notify pas selesai):
```bash
notify "sleep 5 && echo selesai"
```

Direct dari AI agent:
```bash
notify --agent "CommandCode" --message "Berhasil setup database"
notify --agent "Claude Code" --message "Gagal deploy" --status failed
```

### Semua Command

| Perintah | Fungsi |
|----------|--------|
| `notify <command>` | Jalankan command + notify |
| `--message, -m` | Kirim notifikasi langsung |
| `--status, -s` | `success` (default) / `failed` |
| `--agent, -a` | Nama AI agent |
| `--setup` | Setup ulang Telegram/Expo |
| `--init` | Setup AI agent global config |
| `--uninstall` | Hapus semua config |
| `--version` | Tampilkan versi |

## Setup Kustom

Lewati bot bawaan dan pake bot sendiri:
```bash
export CLI_NOTIFIER_TOKEN="token_dari_bot_father"
notify --setup
```

Atau install dari source:
```bash
git clone https://github.com/dinarradja/cli-notifier
cd cli-notifier
pipx install .
notify --init
notify --setup
```

## Expo (Opsional)

Kalau prefer Expo instead of Telegram:
```bash
make server
notify --setup   # Pilih Expo
```

## Development

```bash
git clone https://github.com/dinarradja/cli-notifier
cd cli-notifier
python -m venv venv && source venv/bin/activate
pip install build twine
python -m unittest tests/test_notify.py -v
```

### Build + Publish

```bash
python -m build
python -m twine upload dist/*
```

## Struktur Proyek

```
cli-notifier/
├── notify_cli.py           ← Main script (stdlib only)
├── tests/test_notify.py    ← 20 unit tests
├── backend/main.py         ← FastAPI server (opsional, untuk Expo)
├── App.js                  ← Expo app (opsional)
├── Makefile                ← Helper commands
└── .github/workflows/ci.yml ← CI pipeline
```
