Metadata-Version: 2.4
Name: abip-cli
Version: 0.1.0
Summary: Command-line interface for checking and reporting abusive IP addresses with AbuseIPDB
Project-URL: Homepage, https://github.com/fernansd/abip-cli
Project-URL: Repository, https://github.com/fernansd/abip-cli
Project-URL: Issues, https://github.com/fernansd/abip-cli/issues
Project-URL: Changelog, https://github.com/fernansd/abip-cli/blob/main/CHANGELOG.md
Author: Fernan SD
License-Expression: MIT
License-File: LICENSE
Keywords: abuseipdb,cli,cybersecurity,ip-reputation,threat-intelligence
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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 :: Internet
Classifier: Topic :: Security
Classifier: Topic :: System :: Networking :: Monitoring
Requires-Python: >=3.10
Requires-Dist: click
Requires-Dist: httpx
Requires-Dist: python-dotenv
Requires-Dist: rich
Description-Content-Type: text/markdown

# abip-cli

`abip-cli` is a Python package that installs the `abip` command for checking and reporting abusive IP addresses with the [AbuseIPDB](https://www.abuseipdb.com/) API.

It supports single IP lookups, CIDR block checks, abuse reports, and blacklist queries with either rich terminal output or JSON for scripting.

## Features

- Check the reputation of a single IP address
- Inspect an entire CIDR block for reported addresses
- Submit abuse reports to AbuseIPDB
- Fetch blacklist entries with filters for confidence, IP version, and countries
- Use readable terminal output or `--json` for automation

## Install

```bash
pip install abip-cli
```

The package name on PyPI is `abip-cli`, but the installed command is:

```bash
abip
```

You can also run it as a module:

```bash
python -m abip --help
```

## Authentication

Create an AbuseIPDB API token and make it available as `ABUSEIPDB_TOKEN`.

Preferred for installed CLI usage:

```bash
export ABUSEIPDB_TOKEN="your-token-here"
```

For local development, a `.env` file is also supported:

```env
ABUSEIPDB_TOKEN=your-token-here
```

## Usage

Show help:

```bash
abip --help
```

Show the installed version:

```bash
abip --version
```

Check a single IP:

```bash
abip check 8.8.8.8
abip check 8.8.8.8 --days 90 --verbose
abip --json check 8.8.8.8
```

Check a CIDR block:

```bash
abip block 203.0.113.0/24
abip --json block 203.0.113.0/24 --days 7
```

Report an abusive IP:

```bash
abip report 203.0.113.10 --categories 18,22 --comment "SSH brute-force attempts"
abip report 203.0.113.10 --categories 14 --comment "Port scanning" --timestamp 2025-01-10T15:04:05Z
```

Fetch blacklist data:

```bash
abip blacklist
abip blacklist --min-confidence 75 --limit 50
abip blacklist --ip-version 4 --countries US,CN
abip --json blacklist --limit 10
```

## Exit codes

- `0` for successful execution
- `1` for API and runtime errors

## Development

Install development dependencies with `uv`:

```bash
uv sync --group dev
```

Run tests:

```bash
uv run pytest
```

Build distributions:

```bash
uv run python -m build
uv run twine check dist/*
```

## Release

This repository includes GitHub Actions workflows for CI and PyPI publishing via Trusted Publishing.

Before the first release, configure the project on PyPI to trust this GitHub repository, then create a GitHub release to trigger publishing.
