# bear2305/pp-script architecture

> Architecture diagram of the GitHub repository bear2305/pp-script, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bear2305/pp-script
- Repository: https://github.com/bear2305/pp-script

## Overview

PP is a small Bash launcher for Python’s built-in HTTP server. The documented workflow is: invoke `pp`, select the supplied directory or default to the current directory, show network-interface information, then start serving that directory on port 8000. Source excerpts were unavailable, so the relationships shown are limited to those explicitly described in the README.

Main entry points: [`pp`](https://github.com/bear2305/pp-script/blob/main/pp) (PP launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Terminal user"))
node_pp["PP launcher"]
node_served_dir["Selected directory"]
node_ip_cmd["ip command"]
node_python_server["Python HTTP server"]
node_network_clients(("Local network clients"))

node_user -->|"invokes"| node_pp
node_user -->|"selects directory"| node_served_dir
node_pp -->|"defaults to cwd"| node_served_dir
node_pp -->|"checks interface"| node_ip_cmd
node_ip_cmd -->|"returns IP info"| node_pp
node_pp -->|"displays IP info"| node_user
node_pp -->|"starts server"| node_python_server
node_python_server -->|"serves files"| node_served_dir
node_network_clients -->|"requests files"| node_python_server

click node_pp "https://github.com/bear2305/pp-script/blob/main/pp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_network_clients toneBlue
class node_pp toneTeal
class node_served_dir,node_ip_cmd toneIndigo
class node_python_server toneMint
```

## Components

### Other components

- **Terminal user**
- [PP launcher](https://github.com/bear2305/pp-script/blob/main/pp): `pp`
- **Selected directory**
- **ip command**
- **Python HTTP server**
- **Local network clients**

## Connections

- Terminal user → PP launcher: invokes
- Terminal user → Selected directory: selects directory
- PP launcher → Selected directory: defaults to cwd
- PP launcher → ip command: checks interface
- ip command → PP launcher: returns IP info
- PP launcher → Terminal user: displays IP info
- PP launcher → Python HTTP server: starts server
- Python HTTP server → Selected directory: serves files
- Local network clients → Python HTTP server: requests files
