Metadata-Version: 2.5
Name: litmus-cli
Version: 0.5.1
Summary: AI provenance inspector and quality-preserving transformation system
Project-URL: Homepage, https://github.com/LastDev-coder/litmus
Project-URL: Repository, https://github.com/LastDev-coder/litmus
Project-URL: Issues, https://github.com/LastDev-coder/litmus/issues
Author: Atanu
License: MIT
License-File: LICENSE
Keywords: ai-detection,c2pa,provenance,unicode,watermark
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Text Processing
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.7
Requires-Dist: typer>=0.12
Provides-Extra: c2pa
Requires-Dist: c2pa-python>=0.5; extra == 'c2pa'
Provides-Extra: code
Requires-Dist: tree-sitter-language-pack>=0.9; extra == 'code'
Requires-Dist: tree-sitter>=0.23; extra == 'code'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Requires-Dist: tree-sitter-language-pack>=0.9; extra == 'dev'
Requires-Dist: tree-sitter>=0.23; extra == 'dev'
Requires-Dist: yara-python>=4.3; extra == 'dev'
Provides-Extra: yara
Requires-Dist: yara-python>=4.3; extra == 'yara'
Description-Content-Type: text/markdown

<h1 align="center">litmus</h1>

<h3 align="center">Every file has a layer you can't see. litmus shows it to you.</h3>

<p align="center">
  Invisible characters. Hidden personal details. Code tucked inside a picture.<br>
  Find them in seconds, remove them safely, and see proof that nothing else changed.
</p>

<p align="center">
  <a href="https://pypi.org/project/litmus-cli/"><img alt="Latest release" src="https://img.shields.io/pypi/v/litmus-cli?label=release&color=3B4CC0"></a>
  <a href="https://github.com/LastDev-coder/litmus/actions/workflows/ci.yml"><img alt="Build status" src="https://github.com/LastDev-coder/litmus/actions/workflows/ci.yml/badge.svg"></a>
  <a href="https://github.com/LastDev-coder/litmus/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-3B4CC0"></a>
  <img alt="Works offline" src="https://img.shields.io/badge/works-offline-16213E">
</p>

<p align="center">
  <img alt="Demo: litmus checks an image called avatar.jpg, marks it Critical and shows the PHP code hidden inside it" src="https://raw.githubusercontent.com/LastDev-coder/litmus/main/assets/demo.gif" width="820">
</p>

---

The photo you are about to post may still carry the exact location where you
took it. The paragraph you pasted may hold characters that no screen will ever
display. The profile picture someone uploaded may end with a few lines of code
that have nothing to do with the image.

None of this shows up when you open the file. **All of it shows up in litmus.**

```bash
pip install litmus-cli
litmus serve
```

Two commands. Your browser opens. Drop in any file and see what it really contains.

---

## What litmus reveals

<table>
<tr>
<td width="33%" valign="top">

### Invisible text

Zero-width spaces, hidden direction changes and other characters that look
like nothing but change how text is read, searched, compared or run.
Text from websites, documents and chat apps can carry them without anyone
noticing.

</td>
<td width="33%" valign="top">

### Hidden personal details

GPS locations in photos. Author names, company details and editing software
in documents and PDFs. Content credentials attached to images. The
information you never meant to share.

</td>
<td width="33%" valign="top">

### Threats hidden in images

Code appended after the last pixel. A second file packed inside a picture.
A ".jpg" that is not a JPEG at all. Scripts inside SVG graphics. Images built
to exhaust memory when they open.

</td>
</tr>
</table>

## See exactly what was hidden

litmus does not stop at "something is wrong". When it finds hidden code, it
shows you that code, word for word, and explains in plain language why it
matters and what to do next.

<p align="center">
  <img alt="litmus showing PHP code hidden inside an image, with a plain-language explanation" src="https://raw.githubusercontent.com/LastDev-coder/litmus/main/assets/threat-detail.png" width="760">
</p>

Every file gets one clear reading: **No issues found**, **Warning** or
**Critical**. Check one file or a whole folder, then export a polished report
that anyone on your team can read.

<p align="center">
  <img alt="litmus checking four files at once: one critical, one warning, one with hidden info, one clear" src="https://raw.githubusercontent.com/LastDev-coder/litmus/main/assets/screenshot.png" width="760">
</p>

## Clean it. Prove it.

Removing hidden content is easy. Removing it **without damaging the file** is
the hard part. That is where litmus is different.

After every clean-up, litmus checks the result against the original before it
saves anything:

- **Pictures** keep every pixel exactly as it was.
- **Graphics** draw exactly the same shapes.
- **Source code** is saved only when its structure is proven unchanged.
- **Documents and PDFs** lose only their hidden details, never their content.

If litmus cannot confirm the result, it does not save it. Your original stays
untouched, and litmus tells you why.

## Works the way you work

| Where | How |
|---|---|
| **In your browser** | Drag and drop files, see results, download clean copies, export a report |
| **In your terminal** | Check and clean single files or entire folders with one command |
| **In every pull request** | Stop hidden characters and risky files before they reach your main branch |
| **Before every commit** | A pre-commit hook blocks hidden characters at the source |
| **At your upload form** | Check each upload before you save it, and block what looks dangerous |
| **On a shared folder** | Watch for new files and move suspicious ones to quarantine |

## Who it's for

- **Writers and editors** who want clean text before it is published.
- **Anyone sharing photos** who wants to keep their location to themselves.
- **Developers** who want hidden characters out of their code, for good.
- **Security teams** who need a fast first check on files from outside.
- **Platforms that accept uploads** and want a gate in front of their storage.

## Private by design

litmus runs entirely on your computer. There is no account, no cloud, no
upload and no tracking. Your files never leave your machine, so you can use it
on contracts, source code and personal photos with confidence.

## Honest by design

Trust comes from saying clearly what a tool can and cannot do.

- **litmus is not an antivirus.** A "No issues found" result means none of its
  checks matched. It is not proof that a file is safe.
- litmus finds **hidden content**. It does not detect statistical AI
  watermarks in plain text, because no public tool can. It never labels a
  file "AI-generated" or "human-written".
- Finding nothing is not proof that nothing is there. litmus reports only what
  it can actually check.

---

## Get started

```bash
pip install litmus-cli      # install
litmus serve                # open the app in your browser
```

Requires Python 3.11 or newer. For checks against known threat signatures,
install `pip install "litmus-cli[yara]"`.

<details>
<summary><strong>Command-line reference</strong></summary>

<br>

| Command | What it does |
|---|---|
| `litmus inspect PATH...` | Check files or folders without changing them |
| `litmus transform PATH...` | Clean files, verified before anything is saved |
| `litmus guard FILE` | Check one file and print one verdict (exit 0 allowed, 1 blocked) |
| `litmus watch DIR` | Check new files in a folder as they arrive |
| `litmus serve` | Open the app in your browser |

```bash
litmus inspect photo.jpg                              # what is hiding in this file?
litmus inspect uploads/ --security-report report.html # shareable plain-language report
litmus transform photo.jpg -o photo-clean.jpg         # save a cleaned copy
litmus transform notes.md --in-place --backup         # clean in place, keep a backup
litmus watch uploads/ --quarantine quarantine/        # move high-threat files aside
litmus --help                                         # every command and option
```

</details>

<details>
<summary><strong>Pull requests, commits and upload forms</strong></summary>

<br>

**Pull requests** (GitHub Actions):

```yaml
- uses: actions/checkout@v4
- uses: LastDev-coder/litmus@v0.5.0
  with:
    paths: "."
    fail-on: warning
```

**Commits** (`.pre-commit-config.yaml`):

```yaml
repos:
  - repo: https://github.com/LastDev-coder/litmus
    rev: v0.5.0
    hooks:
      - id: litmus-inspect
```

**Upload forms:**

```python
from litmus import scan_upload

verdict = scan_upload(data, "avatar.png")
if not verdict.allowed:
    reject(verdict.reasons)
```

The upload check fails closed: if a check you asked for cannot run, the file
is not allowed.

</details>

<details>
<summary><strong>Supported files</strong></summary>

<br>

| File type | Check | Clean |
|---|:---:|:---:|
| Text and source code | ✓ | ✓ |
| PNG, JPEG, GIF, WebP | ✓ | ✓ |
| SVG | ✓ | ✓ |
| BMP, ICO, TIFF, HEIC / HEIF, AVIF | ✓ | |
| PDF | ✓ | ✓ |
| Word, Excel, PowerPoint | ✓ | ✓ |

</details>

---

<p align="center">
  <strong>Try it on one file. See what you've been sharing.</strong><br><br>
  <code>pip install litmus-cli && litmus serve</code>
</p>

<p align="center">
  <a href="https://github.com/LastDev-coder/litmus/blob/main/SECURITY.md">Security</a> ·
  <a href="https://github.com/LastDev-coder/litmus/blob/main/LICENSE">MIT License</a>
</p>
