# themazyworlds/powerls architecture

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

- Interactive diagram: https://gitdiagram.com/themazyworlds/powerls
- Repository: https://github.com/themazyworlds/powerls

## Overview

#### Purpose and Runtime

`powerls` is a Linux terminal directory explorer, positioned as a colorful C++20 replacement for `ls`. It builds a native command-line executable (`pls`); there is no server, web tier, or persistent data store.

Core application entry point:
- `src/main.cpp`

#### Application Boundary

The program’s runtime behavior is concentrated in one translation unit:
- `src/main.cpp`

This file is the executable entry point and therefore owns CLI invocation, filesystem inspection, terminal-oriented formatting/color output, and process exit behavior. The application boundary is the local filesystem and terminal: users invoke the binary, it reads directory metadata, then writes a rendered listing to standard output.

#### Build and Artifact Generation

CMake defines the native build graph and executable target:
- `CMakeLists.txt`
- `src/main.cpp`

A C++20-capable compiler plus CMake and a generator such as Make or Ninja are required. Release builds produce the `pls` binary, which the README describes installing under `~/.local/bin`.

#### Distribution Packaging

The repository supports Linux distribution through parallel package definitions rather than application-specific installers:
- `debian/control`
- `debian/rules`
- `packaging/arch/powerls/PKGBUILD`

Debian packaging uses standard `debhelper` metadata and rules. Arch packaging is represented by an AUR-oriented `PKGBUILD` plus generated package metadata:
- `packaging/arch/powerls/.SRCINFO`
- `packaging/arch/powerls/PKGBUILD`

These layers consume the built native artifact and establish OS-level installation, dependency, and versioning boundaries.

#### Release Pipeline

GitHub Actions automates release production and publication:
- `.github/workflows/release.yml`
- `CMakeLists.txt`
- `debian/rules`

The release flow builds with CMake/Ninja, creates a portable Linux x86_64 tarball, builds a Debian `.deb`, creates/uploads GitHub Release assets, and synchronizes Arch package metadata downstream. External services are GitHub Actions, GitHub Releases, and Arch/AUR infrastructure accessed through SSH.

#### Versioning and Release Inputs

Debian release version history is maintained separately from the C++ source:
- `debian/changelog`
- `debian/control`

The release workflow and packaging definitions must remain aligned on artifact name, version, architecture, and install location. Arch’s `.SRCINFO` is a derived AUR-facing representation of the `PKGBUILD`, while Debian’s changelog/rules/control form its source-package contract.

#### Operational Flow

1. User or CI invokes CMake against `CMakeLists.txt`.
2. The compiler builds `src/main.cpp` into the CLI executable.
3. The executable enumerates a requested/local directory and emits styled terminal output.
4. Packaging layers wrap that executable as Debian, Arch, or portable archive artifacts.
5. The release workflow publishes artifacts and updates the AUR package repository.

Main entry points: [`.github/workflows/release.yml`](https://github.com/themazyworlds/powerls/blob/main/.github/workflows/release.yml) (Release workflow), [`src/main.cpp`](https://github.com/themazyworlds/powerls/blob/main/src/main.cpp) (pls executable), [`debian/rules`](https://github.com/themazyworlds/powerls/blob/main/debian/rules) (Debian build rules), [`CMakeLists.txt`](https://github.com/themazyworlds/powerls/blob/main/CMakeLists.txt) (CMake build graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["CLI Runtime"]
  node_user(("Terminal user<br/>actor"))
  node_cli["pls executable<br/>C++20 CLI<br/>[main.cpp]"]
  node_filesystem[("Local filesystem<br/>system boundary")]
  node_terminal["Standard output<br/>terminal"]
end

subgraph group_build["Native Build"]
  node_cmake["CMake build graph<br/>build definition<br/>[CMakeLists.txt]"]
  node_compiler["C++20 compiler<br/>toolchain"]
  node_binary["Built pls binary<br/>native artifact"]
end

subgraph group_packages["Distribution Packaging"]
  node_debian_contract["Debian package contract<br/>Debian metadata"]
  node_debian_rules["Debian build rules<br/>debhelper rules"]
  node_deb["Debian .deb<br/>package artifact"]
  node_arch_pkgbuild["Arch PKGBUILD<br/>Arch package definition"]
  node_srcinfo["AUR .SRCINFO<br/>derived package metadata<br/>[.SRCINFO]"]
end

subgraph group_release["Release Automation"]
  node_release_workflow["Release workflow<br/>GitHub Actions workflow<br/>[release.yml]"]
  node_tarball["Linux x86_64 tarball<br/>portable artifact"]
  node_github_releases{{"GitHub Releases<br/>external publication"}}
  node_aur{{"Arch/AUR infrastructure<br/>external package service"}}
end

node_user -->|"invokes"| node_cli
node_cli -->|"enumerates"| node_filesystem
node_cli -->|"renders listing"| node_terminal
node_cmake -->|"configures build"| node_compiler
node_compiler -->|"compiles src/main.cpp"| node_binary
node_binary -.->|"is runtime artifact"| node_cli
node_debian_contract -->|"defines package contract"| node_debian_rules
node_binary -->|"packaged by"| node_debian_rules
node_debian_rules -->|"builds"| node_deb
node_binary -.->|"package input"| node_arch_pkgbuild
node_arch_pkgbuild -->|"generates"| node_srcinfo
node_release_workflow -->|"runs CMake/Ninja"| node_cmake
node_release_workflow -->|"creates"| node_tarball
node_release_workflow -->|"builds"| node_deb
node_release_workflow -->|"uploads assets"| node_github_releases
node_release_workflow -->|"syncs metadata"| node_aur
node_srcinfo -->|"AUR-facing metadata"| node_aur

click node_cli "https://github.com/themazyworlds/powerls/blob/main/src/main.cpp"
click node_cmake "https://github.com/themazyworlds/powerls/blob/main/CMakeLists.txt"
click node_debian_contract "https://github.com/themazyworlds/powerls/blob/main/debian/control"
click node_debian_rules "https://github.com/themazyworlds/powerls/blob/main/debian/rules"
click node_arch_pkgbuild "https://github.com/themazyworlds/powerls/blob/main/packaging/arch/powerls/PKGBUILD"
click node_srcinfo "https://github.com/themazyworlds/powerls/blob/main/packaging/arch/powerls/.SRCINFO"
click node_release_workflow "https://github.com/themazyworlds/powerls/blob/main/.github/workflows/release.yml"

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_cli,node_filesystem,node_terminal toneBlue
class node_cmake,node_compiler,node_binary toneAmber
class node_debian_contract,node_debian_rules,node_deb,node_arch_pkgbuild,node_srcinfo toneMint
class node_release_workflow,node_tarball,node_github_releases,node_aur toneRose
```

## Components

### CLI Runtime

- **Terminal user**: actor
- [pls executable](https://github.com/themazyworlds/powerls/blob/main/src/main.cpp): C++20 CLI · Lists local directories with terminal styling. · `src/main.cpp`
- **Local filesystem**: system boundary
- **Standard output**: terminal

### Native Build

- [CMake build graph](https://github.com/themazyworlds/powerls/blob/main/CMakeLists.txt): build definition · `CMakeLists.txt`
- **C++20 compiler**: toolchain
- **Built pls binary**: native artifact

### Distribution Packaging

- [Debian package contract](https://github.com/themazyworlds/powerls/blob/main/debian/control): Debian metadata · Defines dependencies and release version history. · `debian/control`
- [Debian build rules](https://github.com/themazyworlds/powerls/blob/main/debian/rules): debhelper rules · `debian/rules`
- **Debian .deb**: package artifact
- [Arch PKGBUILD](https://github.com/themazyworlds/powerls/blob/main/packaging/arch/powerls/PKGBUILD): Arch package definition · `packaging/arch/powerls/PKGBUILD`
- [AUR .SRCINFO](https://github.com/themazyworlds/powerls/blob/main/packaging/arch/powerls/.SRCINFO): derived package metadata · `packaging/arch/powerls/.SRCINFO`

### Release Automation

- [Release workflow](https://github.com/themazyworlds/powerls/blob/main/.github/workflows/release.yml): GitHub Actions workflow · Builds, packages, publishes, and syncs Arch metadata. · `.github/workflows/release.yml`
- **Linux x86_64 tarball**: portable artifact
- **GitHub Releases**: external publication
- **Arch/AUR infrastructure**: external package service · Receives package metadata through SSH.

## Connections

- Terminal user → pls executable: invokes
- pls executable → Local filesystem: enumerates
- pls executable → Standard output: renders listing
- CMake build graph → C++20 compiler: configures build
- C++20 compiler → Built pls binary: compiles src/main.cpp
- Built pls binary → pls executable: is runtime artifact
- Debian package contract → Debian build rules: defines package contract
- Built pls binary → Debian build rules: packaged by
- Debian build rules → Debian .deb: builds
- Built pls binary → Arch PKGBUILD: package input
- Arch PKGBUILD → AUR .SRCINFO: generates
- Release workflow → CMake build graph: runs CMake/Ninja
- Release workflow → Linux x86_64 tarball: creates
- Release workflow → Debian .deb: builds
- Release workflow → GitHub Releases: uploads assets
- Release workflow → Arch/AUR infrastructure: syncs metadata
- AUR .SRCINFO → Arch/AUR infrastructure: AUR-facing metadata
