Metadata-Version: 2.4
Name: hermes-font-scale
Version: 0.1.4
Summary: Unofficial community helper — make Hermes Desktop GUI font bigger in one command.
Author: LUKE
License: MIT
Project-URL: Homepage, https://github.com/hsukevin0407-crypto/hermes-font-scale
Project-URL: Issues, https://github.com/hsukevin0407-crypto/hermes-font-scale/issues
Keywords: hermes-agent,cli,accessibility,font-size,electron
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
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.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 🐍 hermes-font-scale

> Unofficial community helper — patch **Hermes Desktop GUI** font size in one command, atomically and reversibly.
> NOT affiliated with [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent).

![Tests](https://img.shields.io/github/actions/workflow/status/hsukevin0407-crypto/hermes-font-scale/test.yml?branch=main&label=tests)
![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)
![License](https://img.shields.io/github/license/hsukevin0407-crypto/hermes-font-scale)
![Version](https://img.shields.io/github/v/release/hsukevin0407-crypto/hermes-font-scale)

---

## ✨ Features

- **Atomic font patch** — rewrites only the `html { font-size: clamp(...) }` line; crash-safe via temp-file + `os.replace()`
- **Reversible** — `reset` restores from an auto-created `.bak`; `set` is idempotent and skips unnecessary writes
- **Zero runtime deps** — stdlib only; works on Python 3.9–3.12 across Windows / macOS / Linux
- **Multi-OS path resolution** — auto-detects Hermes install from `HERMES_HOME`, env var, or 10+ known install paths
- **Diagnostic `doctor` command** — 4-check health report pinpoints the exact failure before you patch

---

## 🚀 Getting Started

### Prerequisites

- Python >= 3.9

### Installation

Currently available from source only (PyPI publication pending):

```bash
pip install "git+https://github.com/hsukevin0407-crypto/hermes-font-scale.git@v0.1.1"
```

Or clone and install locally:

```bash
git clone https://github.com/hsukevin0407-crypto/hermes-font-scale.git
cd hermes-font-scale
pip install -e .
```

### Usage

```bash
# Check current state (run this first)
hermes-font-scale status

# Set base font size (10–32 px; responsive max is auto-computed)
hermes-font-scale set 18

# Preview without writing anything
hermes-font-scale set 18 --dry-run

# Run the 4-check diagnostic
hermes-font-scale doctor

# Restore the original CSS from the .bak file
hermes-font-scale reset

# Machine-readable output
hermes-font-scale status --json
```

After `set`, **restart Hermes Desktop** to see the change.

---

## 🏗️ Architecture

```mermaid
graph LR
    A[CLI: hermes-font-scale] --> B{Command}
    B -->|set N| C[Locate globals.css]
    B -->|reset| D[Restore from .bak]
    B -->|status| E[Read current value]
    B -->|doctor| F[4-check diagnostic]
    C --> G[Atomic rewrite via os.replace]
    G --> H[globals.css patched]
```

Hermes Desktop hard-codes font size in one CSS anchor:

```css
/* node_modules/@nous-research/ui/dist/ui/globals.css */
html {
  font-size: clamp(14px, calc(14px + 2 * ((100vw - 1400px) / 400)), 18px);
}
```

`hermes-font-scale set N` rewrites the two numeric bounds to `N` and `N+4`, preserving responsive behavior. Everything else in the file is untouched.

**Compatibility note:** the official Hermes Desktop installer may bundle `node_modules` inside `app.asar`. Run `hermes-font-scale doctor` — if the "font-size clause present" check fails because the file is inside an ASAR archive, see the [open issue](https://github.com/hsukevin0407-crypto/hermes-font-scale/issues) for workarounds.

---

## 🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first.

```bash
# Run tests
pip install pytest pytest-cov
pytest

# Lint
pip install ruff
ruff check src tests
```

CI runs on Python 3.9, 3.10, 3.11, 3.12 across Ubuntu / Windows / macOS.

## 📄 License

[MIT](LICENSE)

---

> **Disclaimer:** Unofficial community project. Not affiliated with or endorsed by Nous Research. Use at your own risk.
