Metadata-Version: 2.4
Name: pinescript-claude-hook
Version: 0.1.0
Summary: Claude Code hook that auto-compiles PineScript files via TradingView API
Author: Odyssee
License: MIT
Project-URL: Homepage, https://github.com/deepentropy/pinescript-claude-hook
Project-URL: Repository, https://github.com/deepentropy/pinescript-claude-hook
Project-URL: Issues, https://github.com/deepentropy/pinescript-claude-hook/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Compilers
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24.0
Dynamic: license-file

<p align="center">
  <img src="assets/banner.jpg" alt="PineScript Auto-Compiler" width="100%">
</p>

# PineScript Auto-Compiler for Claude Code

A [Claude Code hook](https://docs.anthropic.com/en/docs/claude-code/hooks) that automatically compiles `.pine` files against the TradingView API every time Claude edits or creates one.

## Install

```bash
pip install pinescript-claude-hook
```

Then copy the hook config into your project:

```bash
git clone https://github.com/DeepEntropy/pinescript-claude-hook.git /tmp/pch
cp -r /tmp/pch/.claude your-project/.claude
rm -rf /tmp/pch
```

Or manually add to your `.claude/settings.json`:

```json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "python .claude/hooks/compile-pine.py",
            "timeout": 30
          }
        ]
      }
    ]
  }
}
```

Open Claude Code in your project directory and the hook is active.

## How it works

When Claude Code writes or edits a `.pine` file, the hook runs `.claude/hooks/compile-pine.py`, which calls the TradingView public compile API. Claude sees the result (errors, warnings, or success) and can fix issues immediately.

## CLI usage

You can also compile files directly:

```bash
pinescript-compile path/to/file.pine
```

## Requirements

- Python 3.11+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
