# anjisuan608/lichen-history-cli architecture

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

- Interactive diagram: https://gitdiagram.com/anjisuan608/lichen-history-cli
- Repository: https://github.com/anjisuan608/lichen-history-cli

## Overview

Lichen History CLI provides shared bash-style command history across Minecraft client mods, server plugins and proxies. Users submit history commands, the platform adapter delegates parsing and command actions to common logic, which reads or updates its own history store; expansion is dispatched back through the platform to execute the recalled command. The README also documents permissions, configuration reload, file operations and platform-specific config screens. Platform adapters are grouped by runtime; some platform wiring is represented by its exact source directory because those files were not sampled.

Main entry points: [`common/src/main/java/org/anjisuan608/historycli/HistoryCommandHandler.java`](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCommandHandler.java) (Command handler), [`fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java`](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java) (Client command runtime), [`fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java`](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java) (Server commands), [`velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java`](https://github.com/anjisuan608/lichen-history-cli/blob/main/velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java) (Velocity commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Shared command core"]
  node_handler["Command handler"]
  node_parser["Argument parser<br/>[HistoryParser.java]"]
  node_store[("History log store<br/>[HistoryStore.java]")]
  node_suggestions["Command suggestions"]
end

subgraph group_clients["Client mods"]
  node_client_commands["Client commands"]
  node_client_capture["Client capture and expansion"]
  node_client_adapters["Other client adapters"]
  node_client_runtime["Client command runtime"]
end

subgraph group_servers["Server plugins"]
  node_server_commands["Server commands"]
  node_plugin_adapters["Plugin adapters"]
  node_server_runtime["Server command runtime"]
end

subgraph group_proxies["Proxy plugins"]
  node_proxy_commands["Velocity commands"]
  node_proxy_adapters["Bungee adapter"]
  node_proxy_runtime["Proxy command runtime"]
end

subgraph group_settings["Settings and access"]
  node_permissions["Permission nodes"]
  node_config_io["Config IO"]
  node_toml_config["TOML config IO"]
  node_client_config["Client config screens"]
end

node_player(("Player"))
node_server_operator(("Server operator"))
node_proxy_user(("Proxy user or console"))

node_player -->|"enters command"| node_client_commands
node_client_commands -->|"delegates"| node_handler
node_client_capture -->|"records and resolves"| node_store
node_client_capture -->|"dispatches expansion"| node_client_runtime
node_client_runtime -->|"executes command"| node_player
node_server_operator -->|"enters command"| node_server_commands
node_server_commands -->|"delegates"| node_handler
node_plugin_adapters -->|"delegates"| node_handler
node_proxy_user -->|"enters command"| node_proxy_commands
node_proxy_commands -->|"delegates"| node_handler
node_proxy_adapters -->|"delegates"| node_handler
node_handler -->|"parses arguments"| node_parser
node_handler -->|"reads and updates"| node_store
node_handler -->|"dispatches expansion"| node_client_runtime
node_handler -->|"dispatches expansion"| node_server_runtime
node_handler -->|"dispatches expansion"| node_proxy_runtime
node_client_runtime -->|"executes command"| node_player
node_server_runtime -->|"executes command"| node_server_operator
node_proxy_runtime -->|"executes command"| node_proxy_user
node_client_commands -->|"requests suggestions"| node_suggestions
node_server_commands -->|"requests suggestions"| node_suggestions
node_proxy_commands -->|"requests suggestions"| node_suggestions
node_server_commands -->|"checks access"| node_permissions
node_proxy_commands -->|"checks access"| node_permissions
node_client_config -->|"edits configuration"| node_toml_config
node_config_io -->|"uses TOML format"| node_toml_config
node_client_adapters -.->|"registers client behavior"| node_client_runtime

click node_client_commands "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java"
click node_client_capture "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/mixin/client/ClientPacketListenerMixin.java"
click node_client_adapters "https://github.com/anjisuan608/lichen-history-cli/tree/main/forge/src/main/java/org/anjisuan608/historycli/forge/client"
click node_server_commands "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java"
click node_plugin_adapters "https://github.com/anjisuan608/lichen-history-cli/tree/main/bukkit/src/main/java/org/anjisuan608/historycli/bukkit"
click node_proxy_commands "https://github.com/anjisuan608/lichen-history-cli/blob/main/velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java"
click node_proxy_adapters "https://github.com/anjisuan608/lichen-history-cli/tree/main/bungee/src/main/java/org/anjisuan608/historycli/bungee"
click node_handler "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCommandHandler.java"
click node_parser "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryParser.java"
click node_store "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryStore.java"
click node_suggestions "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistorySuggestions.java"
click node_permissions "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/PermissionNode.java"
click node_config_io "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCliConfigIO.java"
click node_toml_config "https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCliTomlConfigIO.java"
click node_client_config "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/HistoryConfigScreen.java"
click node_client_runtime "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java"
click node_server_runtime "https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java"
click node_proxy_runtime "https://github.com/anjisuan608/lichen-history-cli/blob/main/velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java"

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_handler,node_parser,node_store,node_suggestions,node_proxy_user toneBlue
class node_client_commands,node_client_capture,node_client_adapters,node_client_runtime toneAmber
class node_server_commands,node_plugin_adapters,node_server_runtime,node_server_operator toneMint
class node_proxy_commands,node_proxy_adapters,node_proxy_runtime toneRose
class node_permissions,node_config_io,node_toml_config,node_client_config,node_player toneIndigo
```

## Components

### Shared command core

- [Command handler](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCommandHandler.java): `common/src/main/java/org/anjisuan608/historycli/HistoryCommandHandler.java`
- [Argument parser](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryParser.java): `common/src/main/java/org/anjisuan608/historycli/HistoryParser.java`
- [History log store](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryStore.java): `common/src/main/java/org/anjisuan608/historycli/HistoryStore.java`
- [Command suggestions](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistorySuggestions.java): `common/src/main/java/org/anjisuan608/historycli/HistorySuggestions.java`

### Client mods

- [Client commands](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java): `fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java`
- [Client capture and expansion](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/mixin/client/ClientPacketListenerMixin.java): `fabric/src/client/java/org/anjisuan608/historycli/fabric/mixin/client/ClientPacketListenerMixin.java`
- [Other client adapters](https://github.com/anjisuan608/lichen-history-cli/tree/main/forge/src/main/java/org/anjisuan608/historycli/forge/client): `forge/src/main/java/org/anjisuan608/historycli/forge/client`
- [Client command runtime](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java): `fabric/src/client/java/org/anjisuan608/historycli/fabric/client/ClientHistoryCommand.java`

### Server plugins

- [Server commands](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java): `fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java`
- [Plugin adapters](https://github.com/anjisuan608/lichen-history-cli/tree/main/bukkit/src/main/java/org/anjisuan608/historycli/bukkit): `bukkit/src/main/java/org/anjisuan608/historycli/bukkit`
- [Server command runtime](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java): `fabric/src/main/java/org/anjisuan608/historycli/fabric/server/ServerHistoryCommand.java`

### Proxy plugins

- [Velocity commands](https://github.com/anjisuan608/lichen-history-cli/blob/main/velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java): `velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java`
- [Bungee adapter](https://github.com/anjisuan608/lichen-history-cli/tree/main/bungee/src/main/java/org/anjisuan608/historycli/bungee): `bungee/src/main/java/org/anjisuan608/historycli/bungee`
- [Proxy command runtime](https://github.com/anjisuan608/lichen-history-cli/blob/main/velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java): `velocity/src/main/java/org/anjisuan608/historycli/velocity/command/VelocityHistoryCommand.java`

### Settings and access

- [Permission nodes](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/PermissionNode.java): `common/src/main/java/org/anjisuan608/historycli/PermissionNode.java`
- [Config IO](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCliConfigIO.java): `common/src/main/java/org/anjisuan608/historycli/HistoryCliConfigIO.java`
- [TOML config IO](https://github.com/anjisuan608/lichen-history-cli/blob/main/common/src/main/java/org/anjisuan608/historycli/HistoryCliTomlConfigIO.java): `common/src/main/java/org/anjisuan608/historycli/HistoryCliTomlConfigIO.java`
- [Client config screens](https://github.com/anjisuan608/lichen-history-cli/blob/main/fabric/src/client/java/org/anjisuan608/historycli/fabric/client/HistoryConfigScreen.java): `fabric/src/client/java/org/anjisuan608/historycli/fabric/client/HistoryConfigScreen.java`

### Other components

- **Player**
- **Server operator**
- **Proxy user or console**

## Connections

- Player → Client commands: enters command
- Client commands → Command handler: delegates
- Client capture and expansion → History log store: records and resolves
- Client capture and expansion → Client command runtime: dispatches expansion
- Client command runtime → Player: executes command
- Server operator → Server commands: enters command
- Server commands → Command handler: delegates
- Plugin adapters → Command handler: delegates
- Proxy user or console → Velocity commands: enters command
- Velocity commands → Command handler: delegates
- Bungee adapter → Command handler: delegates
- Command handler → Argument parser: parses arguments
- Command handler → History log store: reads and updates
- Command handler → Client command runtime: dispatches expansion
- Command handler → Server command runtime: dispatches expansion
- Command handler → Proxy command runtime: dispatches expansion
- Client command runtime → Player: executes command
- Server command runtime → Server operator: executes command
- Proxy command runtime → Proxy user or console: executes command
- Client commands → Command suggestions: requests suggestions
- Server commands → Command suggestions: requests suggestions
- Velocity commands → Command suggestions: requests suggestions
- Server commands → Permission nodes: checks access
- Velocity commands → Permission nodes: checks access
- Client config screens → TOML config IO: edits configuration
- Config IO → TOML config IO: uses TOML format
- Other client adapters → Client command runtime: registers client behavior
