# uutils/coreutils architecture

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

- Interactive diagram: https://gitdiagram.com/uutils/coreutils
- Repository: https://github.com/uutils/coreutils

## Overview

uutils coreutils is a cross-platform Rust reimplementation of GNU coreutils. Its primary workflow is invoking a utility with arguments and input, then producing command output and an exit status; the repository also supports a multicall `coreutils` executable. The map groups the many commands by domain and shows shared runtime services. Utility dispatch details and most command implementations were not excerpted, so the command groups are broad, and their connections to the multicall entry point are marked unverified.

Main entry points: [`src/bin/coreutils.rs`](https://github.com/uutils/coreutils/blob/main/src/bin/coreutils.rs) (Coreutils entry), [`src/uucore/src/lib/lib.rs`](https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/lib.rs) (Utility runtime), [`src/uucore/src/lib/mods/locale.rs`](https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/mods/locale.rs) (Localization), [`src/uucore/src/lib/features`](https://github.com/uutils/coreutils/tree/main/src/uucore/src/lib/features) (Shared features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and shared services"]
  node_multicall["Coreutils entry<br/>[coreutils.rs]"]
  node_command_runtime["Utility runtime<br/>[lib.rs]"]
  node_localization["Localization<br/>[locale.rs]"]
  node_shared_features["Shared features"]
end

subgraph group_files["File operations"]
  node_file_view["File viewing"]
  node_file_management["File management"]
  node_file_metadata["File metadata"]
  node_filesystem_usage["Filesystem usage"]
end

subgraph group_text["Text and data utilities"]
  node_text_transform["Text transformation"]
  node_text_selection["Text selection"]
  node_text_count["Text counting"]
  node_text_sort["Text sorting"]
  node_checksums["Checksums"]
end

subgraph group_system["System utilities"]
  node_environment["Environment commands"]
  node_process_control["Process control"]
  node_identity["Identity and host"]
end

node_user(("Shell user"))

node_user -->|"invokes"| node_multicall
node_multicall -.->|"dispatches"| node_file_view
node_multicall -.->|"dispatches"| node_file_management
node_multicall -.->|"dispatches"| node_file_metadata
node_multicall -.->|"dispatches"| node_filesystem_usage
node_multicall -.->|"dispatches"| node_text_transform
node_multicall -.->|"dispatches"| node_text_selection
node_multicall -.->|"dispatches"| node_text_count
node_multicall -.->|"dispatches"| node_text_sort
node_multicall -.->|"dispatches"| node_checksums
node_multicall -.->|"dispatches"| node_environment
node_multicall -.->|"dispatches"| node_process_control
node_multicall -.->|"dispatches"| node_identity
node_multicall -.->|"uses"| node_command_runtime
node_command_runtime -.->|"initializes"| node_localization
node_command_runtime -->|"exposes"| node_shared_features

click node_multicall "https://github.com/uutils/coreutils/blob/main/src/bin/coreutils.rs"
click node_command_runtime "https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/lib.rs"
click node_localization "https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/mods/locale.rs"
click node_shared_features "https://github.com/uutils/coreutils/tree/main/src/uucore/src/lib/features"
click node_file_view "https://github.com/uutils/coreutils/tree/main/src/uu/cat"
click node_file_management "https://github.com/uutils/coreutils/tree/main/src/uu/cp"
click node_file_metadata "https://github.com/uutils/coreutils/tree/main/src/uu/stat"
click node_filesystem_usage "https://github.com/uutils/coreutils/tree/main/src/uu/df"
click node_text_transform "https://github.com/uutils/coreutils/tree/main/src/uu/tr"
click node_text_selection "https://github.com/uutils/coreutils/tree/main/src/uu/cut"
click node_text_count "https://github.com/uutils/coreutils/tree/main/src/uu/wc"
click node_text_sort "https://github.com/uutils/coreutils/tree/main/src/uu/sort"
click node_checksums "https://github.com/uutils/coreutils/tree/main/src/uu/cksum"
click node_environment "https://github.com/uutils/coreutils/tree/main/src/uu/env"
click node_process_control "https://github.com/uutils/coreutils/tree/main/src/uu/timeout"
click node_identity "https://github.com/uutils/coreutils/tree/main/src/uu/id"

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_multicall,node_command_runtime,node_localization,node_shared_features,node_user toneBlue
class node_file_view,node_file_management,node_file_metadata,node_filesystem_usage toneAmber
class node_text_transform,node_text_selection,node_text_count,node_text_sort,node_checksums toneMint
class node_environment,node_process_control,node_identity toneRose
```

## Components

### Runtime and shared services

- [Coreutils entry](https://github.com/uutils/coreutils/blob/main/src/bin/coreutils.rs): `src/bin/coreutils.rs`
- [Utility runtime](https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/lib.rs): `src/uucore/src/lib/lib.rs`
- [Localization](https://github.com/uutils/coreutils/blob/main/src/uucore/src/lib/mods/locale.rs): `src/uucore/src/lib/mods/locale.rs`
- [Shared features](https://github.com/uutils/coreutils/tree/main/src/uucore/src/lib/features): `src/uucore/src/lib/features`

### File operations

- [File viewing](https://github.com/uutils/coreutils/tree/main/src/uu/cat): `src/uu/cat`
- [File management](https://github.com/uutils/coreutils/tree/main/src/uu/cp): `src/uu/cp`
- [File metadata](https://github.com/uutils/coreutils/tree/main/src/uu/stat): `src/uu/stat`
- [Filesystem usage](https://github.com/uutils/coreutils/tree/main/src/uu/df): `src/uu/df`

### Text and data utilities

- [Text transformation](https://github.com/uutils/coreutils/tree/main/src/uu/tr): `src/uu/tr`
- [Text selection](https://github.com/uutils/coreutils/tree/main/src/uu/cut): `src/uu/cut`
- [Text counting](https://github.com/uutils/coreutils/tree/main/src/uu/wc): `src/uu/wc`
- [Text sorting](https://github.com/uutils/coreutils/tree/main/src/uu/sort): `src/uu/sort`
- [Checksums](https://github.com/uutils/coreutils/tree/main/src/uu/cksum): `src/uu/cksum`

### System utilities

- [Environment commands](https://github.com/uutils/coreutils/tree/main/src/uu/env): `src/uu/env`
- [Process control](https://github.com/uutils/coreutils/tree/main/src/uu/timeout): `src/uu/timeout`
- [Identity and host](https://github.com/uutils/coreutils/tree/main/src/uu/id): `src/uu/id`

### Other components

- **Shell user**

## Connections

- Shell user → Coreutils entry: invokes
- Coreutils entry → File viewing: dispatches
- Coreutils entry → File management: dispatches
- Coreutils entry → File metadata: dispatches
- Coreutils entry → Filesystem usage: dispatches
- Coreutils entry → Text transformation: dispatches
- Coreutils entry → Text selection: dispatches
- Coreutils entry → Text counting: dispatches
- Coreutils entry → Text sorting: dispatches
- Coreutils entry → Checksums: dispatches
- Coreutils entry → Environment commands: dispatches
- Coreutils entry → Process control: dispatches
- Coreutils entry → Identity and host: dispatches
- Coreutils entry → Utility runtime: uses
- Utility runtime → Localization: initializes
- Utility runtime → Shared features: exposes (evidence: `src/uucore/src/lib/lib.rs`)
