# hashinami46/hashinami-cli architecture

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

- Interactive diagram: https://gitdiagram.com/hashinami46/hashinami-cli
- Repository: https://github.com/hashinami46/hashinami-cli

## Overview

Hashinami CLI downloads and organizes assets from Sakamichi apps and games. Users select an app and asset type through the CLI; the command routes to asset-download operations, which resolve server and local paths and save downloaded files. Talk-app message retrieval can first gather metadata and authenticate requests. The README also documents catalog and multiple asset-format support, automatic organization, and multiple languages. The graph reflects shown calls and imports; several download internals and README-described capabilities are only partially sampled.

Main entry points: [`src/cli.js`](https://github.com/hashinami46/hashinami-cli/blob/master/src/cli.js) (Command routing), [`src/MainConfig.js`](https://github.com/hashinami46/hashinami-cli/blob/master/src/MainConfig.js) (App configuration), [`src/RequestHandler/RequestEndpoint.js`](https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestEndpoint.js) (App endpoints), [`src/RequestHandler/RequestAttribute.js`](https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestAttribute.js) (Request credentials)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["Command routing<br/>[cli.js]"]
  node_api["JavaScript API<br/>[main.js]"]
end

subgraph group_requests["Request setup"]
  node_endpoints["App endpoints<br/>[RequestEndpoint.js]"]
  node_auth["Request credentials"]
end

subgraph group_assets["Asset workflow"]
  node_preparation["Asset preparation"]
  node_downloader["Asset downloads<br/>[AssetDownload.js]"]
  node_archive[("Local asset archive")]
end

subgraph group_support["Runtime support"]
  node_config["App configuration<br/>[MainConfig.js]"]
  node_dependencies["Python dependencies"]
  node_python["Python packages"]
end

node_user(("CLI user"))

node_user -->|"selects downloads"| node_cli
node_cli -->|"dispatches downloads"| node_downloader
node_cli -->|"requests metadata"| node_preparation
node_cli -->|"updates tokens"| node_auth
node_cli -->|"installs packages"| node_dependencies
node_downloader -->|"resolves paths"| node_endpoints
node_preparation -->|"gets credentials"| node_auth
node_auth -->|"resolves token route"| node_endpoints
node_downloader -->|"writes assets"| node_archive
node_dependencies -->|"uses runtime settings"| node_config
node_dependencies -->|"installs packages"| node_python
node_api -->|"exports"| node_config
node_api -->|"exports"| node_endpoints
node_api -->|"exports"| node_auth
node_api -->|"exports"| node_preparation
node_config -->|"imports"| node_endpoints
node_config -->|"imports"| node_auth
node_endpoints -->|"uses app settings"| node_config

click node_cli "https://github.com/hashinami46/hashinami-cli/blob/master/src/cli.js"
click node_api "https://github.com/hashinami46/hashinami-cli/blob/master/src/main.js"
click node_config "https://github.com/hashinami46/hashinami-cli/blob/master/src/MainConfig.js"
click node_endpoints "https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestEndpoint.js"
click node_auth "https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestAttribute.js"
click node_preparation "https://github.com/hashinami46/hashinami-cli/blob/master/src/AssetHandler/AssetPreDownload.js"
click node_downloader "https://github.com/hashinami46/hashinami-cli/blob/master/src/AssetHandler/AssetDownload.js"
click node_dependencies "https://github.com/hashinami46/hashinami-cli/blob/master/src/DependencyHandler/DependencyHandler.js"

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_cli,node_api,node_user toneBlue
class node_endpoints,node_auth toneAmber
class node_preparation,node_downloader,node_archive toneMint
class node_config,node_dependencies,node_python toneRose
```

## Components

### User entry

- [Command routing](https://github.com/hashinami46/hashinami-cli/blob/master/src/cli.js): `src/cli.js`
- [JavaScript API](https://github.com/hashinami46/hashinami-cli/blob/master/src/main.js): `src/main.js`

### Request setup

- [App endpoints](https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestEndpoint.js): `src/RequestHandler/RequestEndpoint.js`
- [Request credentials](https://github.com/hashinami46/hashinami-cli/blob/master/src/RequestHandler/RequestAttribute.js): `src/RequestHandler/RequestAttribute.js`

### Asset workflow

- [Asset preparation](https://github.com/hashinami46/hashinami-cli/blob/master/src/AssetHandler/AssetPreDownload.js): `src/AssetHandler/AssetPreDownload.js`
- [Asset downloads](https://github.com/hashinami46/hashinami-cli/blob/master/src/AssetHandler/AssetDownload.js): `src/AssetHandler/AssetDownload.js`
- **Local asset archive**

### Runtime support

- [App configuration](https://github.com/hashinami46/hashinami-cli/blob/master/src/MainConfig.js): `src/MainConfig.js`
- [Python dependencies](https://github.com/hashinami46/hashinami-cli/blob/master/src/DependencyHandler/DependencyHandler.js): `src/DependencyHandler/DependencyHandler.js`
- **Python packages**

### Other components

- **CLI user**

## Connections

- CLI user → Command routing: selects downloads (evidence: `readme.md`)
- Command routing → Asset downloads: dispatches downloads (evidence: `src/cli.js`)
- Command routing → Asset preparation: requests metadata (evidence: `src/cli.js`)
- Command routing → Request credentials: updates tokens (evidence: `src/cli.js`)
- Command routing → Python dependencies: installs packages (evidence: `src/cli.js`)
- Asset downloads → App endpoints: resolves paths (evidence: `src/AssetHandler/AssetDownload.js`)
- Asset preparation → Request credentials: gets credentials (evidence: `src/AssetHandler/AssetPreDownload.js`)
- Request credentials → App endpoints: resolves token route (evidence: `src/RequestHandler/RequestAttribute.js`)
- Asset downloads → Local asset archive: writes assets (evidence: `src/AssetHandler/AssetDownload.js`)
- Python dependencies → App configuration: uses runtime settings (evidence: `src/DependencyHandler/DependencyHandler.js`)
- Python dependencies → Python packages: installs packages (evidence: `src/DependencyHandler/DependencyHandler.js`)
- JavaScript API → App configuration: exports (evidence: `src/main.js`)
- JavaScript API → App endpoints: exports (evidence: `src/main.js`)
- JavaScript API → Request credentials: exports (evidence: `src/main.js`)
- JavaScript API → Asset preparation: exports (evidence: `src/main.js`)
- App configuration → App endpoints: imports (evidence: `src/MainConfig.js`)
- App configuration → Request credentials: imports (evidence: `src/MainConfig.js`)
- App endpoints → App configuration: uses app settings (evidence: `src/RequestHandler/RequestEndpoint.js`)
