Metadata-Version: 2.4
Name: scp-constructor
Version: 0.2.0
Summary: Scan repositories for scp.yaml files and build architecture graphs
Requires-Python: >=3.12
Requires-Dist: httpx>=0.25
Requires-Dist: neo4j>=5.0
Requires-Dist: pydantic>=2.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0
Requires-Dist: typer>=0.9
Description-Content-Type: text/markdown

# SCP Constructor

Build architecture graphs from `scp.yaml` files. Scan local directories or GitHub organizations, validate manifests, sync to Neo4j, and export to JSON, Mermaid, or OpenC2 actuator profiles.

## Installation

```bash
uv sync
```

## Usage

### Validate SCP Files

```bash
uv run scp-cli validate ./examples
```

### Scan Local Directory

```bash
# Scan and export to Mermaid
uv run scp-cli scan ./path/to/repos --export mermaid

# Scan and export to JSON
uv run scp-cli scan ./path/to/repos --export json -o graph.json

# Scan and export OpenC2 actuator profile (for SOAR)
uv run scp-cli scan ./path/to/repos --export openc2 -o actuators.json
```

### Transform JSON to Other Formats

```bash
# Scan once, transform many
uv run scp-cli scan ./repos --export json -o graph.json
uv run scp-cli transform graph.json --export mermaid -o diagram.mmd
uv run scp-cli transform graph.json --export openc2 -o actuators.json
```

### Scan GitHub Organization

```bash
export GITHUB_TOKEN=ghp_xxx
uv run scp-cli scan-github myorg --export mermaid
```

### Sync to Neo4j

```bash
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USER=neo4j
export NEO4J_PASSWORD=password

uv run scp-cli scan ./repos
```

## Commands

| Command | Description |
|---------|-------------|
| `scp-cli validate <path>` | Validate SCP files |
| `scp-cli scan <path>` | Scan local directory |
| `scp-cli scan-github <org>` | Scan GitHub org |
| `scp-cli transform <json>` | Transform JSON to other formats |
| `scp-cli version` | Show version |

## Export Formats

- **JSON**: Graph with nodes/edges arrays
- **Mermaid**: Flowchart diagram with tier styling
- **OpenC2**: Actuator profile for SOAR integration

## Environment Variables

| Variable | Description |
|----------|-------------|
| `GITHUB_TOKEN` | GitHub PAT for org scanning |
| `NEO4J_URI` | Neo4j connection URI |
| `NEO4J_USER` | Neo4j username |
| `NEO4J_PASSWORD` | Neo4j password |

