Metadata-Version: 2.4
Name: ghostmode-cli
Version: 0.1.6
Summary: Air-gapped, local test repair CLI powered by Ollama
License-Expression: MIT
Project-URL: Repository, https://github.com/CedZzzzzzzzz/ghostmode-cli
Project-URL: Issues, https://github.com/CedZzzzzzzzz/ghostmode-cli/issues
Classifier: Development Status :: 3 - Alpha
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
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer>=0.12.0
Requires-Dist: rich>=13.7.0
Requires-Dist: httpx>=0.27.0
Dynamic: license-file

# GhostMode

**The Air-Gapped, Self-Healing Code Repair Agent for Low-Resource Hardware.**

GhostMode runs a trusted test command, identifies a likely application frame, asks a local Ollama model for a function replacement, applies it with a backup, and retains it only after the tests pass. It never contacts a network target other than loopback Ollama.

## Supported languages

GhostMode currently supports Python, JavaScript/React (`.js`, `.jsx`, `.ts`, `.tsx`), and PHP/Laravel. Python receives AST syntax validation; JavaScript/React and PHP use conservative structural validation before their own local test tools provide final verification.

## Install and run

```bash
pip install ghostmode-cli
ollama pull qwen2.5-coder:1.5b
ghostmode doctor
```

To upgrade an existing installation:

```bash
pip install --upgrade ghostmode-cli
```

Run GhostMode from the project you want to repair:

```bash
ghostmode run "pytest -q"
```

For npm projects:

```bash
ghostmode run "npm test"
```

Inspect a project locally for high-signal risks without changing files:

```bash
ghostmode inspect
```

Each finding includes severity, repair priority, and potential impact so developers can review the most harmful risks first.

Ask the local model to propose one high-priority inspection fix and verify that existing tests still pass:

```bash
ghostmode inspect --propose --test-cmd "pytest -q"
```

GhostMode asks before applying the proposal. Passing existing tests does not prove the finding is fixed; add a regression test for that behavior.

Use `--dry-run` to review a diff without changing files. GhostMode never edits tests unless `--allow-test-edits` is explicitly passed.
For Vitest projects, `ghostmode run "npm test"` automatically uses single-run mode instead of watch mode.

## Memory budget

| Component | Budget |
| --- | ---: |
| GhostMode Python process | under 100 MB RSS |
| Ollama + 0.5B model | about 1 GB |
| Ollama + 1.5B model | about 2 GB |

## Limitations

Small local models are best at simple, single-function faults. Multi-file, API-wide, and logic-heavy repairs often need human review. Only run trusted test commands: the command is intentionally executed through a shell to support normal test invocations.
