# civitus-linux/civibox architecture

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

- Interactive diagram: https://gitdiagram.com/civitus-linux/civibox
- Repository: https://github.com/civitus-linux/civibox

## Overview

CiviBox is a POSIX-style toolkit that dispatches command names to utility implementations in one multicall executable. Its main workflow is invocation, command selection, then utility execution; the repository also includes authentication and system/network utilities. The README documents the broad single-binary workflow, while sampled sources show dispatch, selected utility behavior, and authentication. Some command registration details and unsampled implementations are not visible, so those relationships are kept at subsystem level.

Main entry points: [`informationes/POSIX`](https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX) (POSIX command set), [`informationes/extra`](https://github.com/civitus-linux/civibox/tree/main/informationes/extra) (Extra commands), [`main.c`](https://github.com/civitus-linux/civibox/blob/main/main.c) (Multicall dispatcher), [`include/auth/auth.c`](https://github.com/civitus-linux/civibox/blob/main/include/auth/auth.c) (Password verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dispatch["Command dispatch"]
  node_main["Multicall dispatcher<br/>[main.c]"]
end

subgraph group_posix["POSIX utilities"]
  node_posix_set["POSIX command set"]
  node_ls["Directory listing<br/>[ls.c]"]
  node_file_ops["File operations"]
  node_text_utils["Text and basic utilities"]
end

subgraph group_system["System utilities"]
  node_extra_cmds["Extra commands"]
  node_network_cmds["Network utilities<br/>[ddhcpc.c]"]
  node_rfkill["Wireless controls<br/>[rfkill.c]"]
end

subgraph group_identity["Identity and auth"]
  node_login["Interactive login<br/>[login.c]"]
  node_udm["User manager<br/>[udm.c]"]
  node_auth["Password verification<br/>[auth.c]"]
  node_auth_api["Authentication interface<br/>[auth.h]"]
end

subgraph group_shared["Shared runtime"]
  node_common_api["Common command interface<br/>[common.h]"]
  node_common_impl["Common I/O helpers<br/>[common.c]"]
  node_usage_api["Usage declaration<br/>[usage.h]"]
end

node_user(("Command user"))
node_shadow[("System account database")]

node_user -->|"invokes"| node_main
node_main -->|"dispatches"| node_posix_set
node_main -->|"dispatches"| node_extra_cmds
node_posix_set -.->|"includes"| node_ls
node_posix_set -.->|"provides"| node_file_ops
node_posix_set -.->|"provides"| node_text_utils
node_extra_cmds -.->|"includes"| node_network_cmds
node_extra_cmds -.->|"includes"| node_rfkill
node_extra_cmds -.->|"includes"| node_login
node_udm -->|"checks credentials"| node_auth
node_auth -->|"implements"| node_auth_api
node_auth -->|"reads credentials"| node_shadow

click node_main "https://github.com/civitus-linux/civibox/blob/main/main.c"
click node_posix_set "https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX"
click node_ls "https://github.com/civitus-linux/civibox/blob/main/informationes/POSIX/ls.c"
click node_file_ops "https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX"
click node_text_utils "https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX"
click node_extra_cmds "https://github.com/civitus-linux/civibox/tree/main/informationes/extra"
click node_network_cmds "https://github.com/civitus-linux/civibox/blob/main/informationes/extra/ddhcpc.c"
click node_rfkill "https://github.com/civitus-linux/civibox/blob/main/informationes/extra/rfkill.c"
click node_login "https://github.com/civitus-linux/civibox/blob/main/informationes/extra/login.c"
click node_udm "https://github.com/civitus-linux/civibox/blob/main/informationes/unfinished/udm.c"
click node_auth "https://github.com/civitus-linux/civibox/blob/main/include/auth/auth.c"
click node_auth_api "https://github.com/civitus-linux/civibox/blob/main/include/auth/auth.h"
click node_common_api "https://github.com/civitus-linux/civibox/blob/main/include/common.h"
click node_common_impl "https://github.com/civitus-linux/civibox/blob/main/etc/common.c"
click node_usage_api "https://github.com/civitus-linux/civibox/blob/main/include/usage.h"

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_main,node_user toneBlue
class node_posix_set,node_ls,node_file_ops,node_text_utils,node_shadow toneAmber
class node_extra_cmds,node_network_cmds,node_rfkill toneMint
class node_login,node_udm,node_auth,node_auth_api toneRose
class node_common_api,node_common_impl,node_usage_api toneIndigo
```

## Components

### Command dispatch

- [Multicall dispatcher](https://github.com/civitus-linux/civibox/blob/main/main.c): `main.c`

### POSIX utilities

- [POSIX command set](https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX): `informationes/POSIX`
- [Directory listing](https://github.com/civitus-linux/civibox/blob/main/informationes/POSIX/ls.c): `informationes/POSIX/ls.c`
- [File operations](https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX): `informationes/POSIX`
- [Text and basic utilities](https://github.com/civitus-linux/civibox/tree/main/informationes/POSIX): `informationes/POSIX`

### System utilities

- [Extra commands](https://github.com/civitus-linux/civibox/tree/main/informationes/extra): `informationes/extra`
- [Network utilities](https://github.com/civitus-linux/civibox/blob/main/informationes/extra/ddhcpc.c): `informationes/extra/ddhcpc.c`
- [Wireless controls](https://github.com/civitus-linux/civibox/blob/main/informationes/extra/rfkill.c): `informationes/extra/rfkill.c`

### Identity and auth

- [Interactive login](https://github.com/civitus-linux/civibox/blob/main/informationes/extra/login.c): `informationes/extra/login.c`
- [User manager](https://github.com/civitus-linux/civibox/blob/main/informationes/unfinished/udm.c): `informationes/unfinished/udm.c`
- [Password verification](https://github.com/civitus-linux/civibox/blob/main/include/auth/auth.c): `include/auth/auth.c`
- [Authentication interface](https://github.com/civitus-linux/civibox/blob/main/include/auth/auth.h): `include/auth/auth.h`

### Shared runtime

- [Common command interface](https://github.com/civitus-linux/civibox/blob/main/include/common.h): `include/common.h`
- [Common I/O helpers](https://github.com/civitus-linux/civibox/blob/main/etc/common.c): `etc/common.c`
- [Usage declaration](https://github.com/civitus-linux/civibox/blob/main/include/usage.h): `include/usage.h`

### Other components

- **Command user**
- **System account database**

## Connections

- Command user → Multicall dispatcher: invokes (evidence: `README.md`)
- Multicall dispatcher → POSIX command set: dispatches (evidence: `main.c`)
- Multicall dispatcher → Extra commands: dispatches (evidence: `main.c`)
- POSIX command set → Directory listing: includes
- POSIX command set → File operations: provides
- POSIX command set → Text and basic utilities: provides
- Extra commands → Network utilities: includes
- Extra commands → Wireless controls: includes
- Extra commands → Interactive login: includes
- User manager → Password verification: checks credentials (evidence: `informationes/unfinished/udm.c`)
- Password verification → Authentication interface: implements (evidence: `include/auth/auth.c`)
- Password verification → System account database: reads credentials (evidence: `include/auth/auth.c`)
