# samsmith00/epictl architecture

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

- Interactive diagram: https://gitdiagram.com/samsmith00/epictl
- Repository: https://github.com/samsmith00/epictl

## Overview

epictl is a command-line manager for Epicor Method and Data Directive BPMs. The main workflow configures an environment, initializes or clones a manifest, edits local code, validates it, then applies or deletes the BPM; browsing directives and describing BPMs are a related read workflow. The graph separates CLI orchestration, environment access, directive-specific operations, and local manifest/code handling. README capabilities guide the unsampled command links; sampled excerpts confirm client update/validation behavior and Epicor REST calls, but do not expose every query or dispatch implementation.

Main entry points: [`src/epictl/client/factory.py`](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/factory.py) (Client factory), [`src/epictl/cli/__main__.py`](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/__main__.py) (CLI entry), [`src/epictl/cli/mutators.py`](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/mutators.py) (BPM commands), [`src/epictl/client/method_directives/queries.py`](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/queries.py) (Method client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_cli_entry["CLI entry<br/>[__main__.py]"]
  node_cli_mutators["BPM commands<br/>[mutators.py]"]
  node_cli_config["Config commands<br/>[config.py]"]
  node_cli_auth["Auth test<br/>[auth.py]"]
  node_cli_method_queries["Method output<br/>[queries.py]"]
  node_cli_data_queries["Data output<br/>[queries.py]"]
  node_method_output_utils["Method formatting<br/>[queries.py]"]
  node_data_output_utils["Data formatting<br/>[queries.py]"]
end

subgraph group_client["Epicor client"]
  node_client_factory["Client factory<br/>[factory.py]"]
  node_client_config["Environment config<br/>[config.py]"]
  node_client_auth["Authentication<br/>[auth.py]"]
end

subgraph group_directives["Directive operations"]
  node_method_client["Method client<br/>[queries.py]"]
  node_method_mutators["Method mutations<br/>[mutators.py]"]
  node_method_helpers["Method BPM helpers<br/>[mutators.py]"]
  node_data_client["Data client<br/>[queries.py]"]
  node_data_mutators["Data mutations<br/>[mutators.py]"]
  node_data_helpers["Data BPM helpers<br/>[mutators.py]"]
end

subgraph group_workspace["Local workspace"]
  node_workspace_files["Manifests and code"]
end

node_engineer(("Engineer"))
node_epicor{{"Epicor REST API"}}

node_engineer -->|"runs"| node_cli_entry
node_cli_entry -->|"dispatches commands"| node_cli_mutators
node_cli_entry -->|"dispatches commands"| node_cli_config
node_cli_entry -->|"dispatches command"| node_cli_auth
node_cli_mutators -->|"selects client"| node_client_factory
node_cli_mutators -->|"reads and writes"| node_workspace_files
node_cli_config -->|"manages configs"| node_client_config
node_cli_auth -->|"tests credentials"| node_client_auth
node_client_auth -->|"tests authentication"| node_epicor
node_client_factory -->|"selects Method client"| node_method_client
node_client_factory -->|"selects Method client"| node_method_mutators
node_client_factory -->|"selects Data client"| node_data_client
node_client_factory -->|"selects Data client"| node_data_mutators
node_method_client -->|"queries directives"| node_epicor
node_data_client -->|"queries directives"| node_epicor
node_method_mutators -->|"uses BPM helpers"| node_method_helpers
node_data_mutators -->|"uses BPM helpers"| node_data_helpers
node_method_mutators -->|"updates BPMs"| node_epicor
node_data_mutators -->|"updates BPMs"| node_epicor
node_method_helpers -->|"validates code"| node_epicor
node_data_helpers -->|"validates code"| node_epicor
node_method_client -->|"returns query results"| node_cli_method_queries
node_data_client -->|"returns query results"| node_cli_data_queries
node_cli_method_queries -->|"formats details"| node_method_output_utils
node_cli_data_queries -->|"formats details"| node_data_output_utils

click node_cli_entry "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/__main__.py"
click node_cli_mutators "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/mutators.py"
click node_cli_config "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/config.py"
click node_cli_auth "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/auth.py"
click node_cli_method_queries "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/method_directives/queries.py"
click node_cli_data_queries "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/data_directives/queries.py"
click node_client_factory "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/factory.py"
click node_client_config "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/config.py"
click node_client_auth "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/auth.py"
click node_method_client "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/queries.py"
click node_method_mutators "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/mutators.py"
click node_method_helpers "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/utils/mutators.py"
click node_data_client "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/queries.py"
click node_data_mutators "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/mutators.py"
click node_data_helpers "https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/utils/mutators.py"
click node_method_output_utils "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/method_directives/utils/queries.py"
click node_data_output_utils "https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/data_directives/utils/queries.py"

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_entry,node_cli_mutators,node_cli_config,node_cli_auth,node_cli_method_queries,node_cli_data_queries,node_method_output_utils,node_data_output_utils toneBlue
class node_client_factory,node_client_config,node_client_auth toneAmber
class node_method_client,node_method_mutators,node_method_helpers,node_data_client,node_data_mutators,node_data_helpers,node_epicor toneMint
class node_workspace_files toneRose
class node_engineer toneIndigo
```

## Components

### CLI commands

- [CLI entry](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/__main__.py): `src/epictl/cli/__main__.py`
- [BPM commands](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/mutators.py): `src/epictl/cli/mutators.py`
- [Config commands](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/config.py): `src/epictl/cli/config.py`
- [Auth test](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/auth.py): `src/epictl/cli/auth.py`
- [Method output](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/method_directives/queries.py): `src/epictl/cli/method_directives/queries.py`
- [Data output](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/data_directives/queries.py): `src/epictl/cli/data_directives/queries.py`
- [Method formatting](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/method_directives/utils/queries.py): `src/epictl/cli/method_directives/utils/queries.py`
- [Data formatting](https://github.com/samsmith00/epictl/blob/development/src/epictl/cli/data_directives/utils/queries.py): `src/epictl/cli/data_directives/utils/queries.py`

### Epicor client

- [Client factory](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/factory.py): `src/epictl/client/factory.py`
- [Environment config](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/config.py): `src/epictl/client/config.py`
- [Authentication](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/auth.py): `src/epictl/client/auth.py`

### Directive operations

- [Method client](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/queries.py): `src/epictl/client/method_directives/queries.py`
- [Method mutations](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/mutators.py): `src/epictl/client/method_directives/mutators.py`
- [Method BPM helpers](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/method_directives/utils/mutators.py): `src/epictl/client/method_directives/utils/mutators.py`
- [Data client](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/queries.py): `src/epictl/client/data_directives/queries.py`
- [Data mutations](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/mutators.py): `src/epictl/client/data_directives/mutators.py`
- [Data BPM helpers](https://github.com/samsmith00/epictl/blob/development/src/epictl/client/data_directives/utils/mutators.py): `src/epictl/client/data_directives/utils/mutators.py`

### Local workspace

- **Manifests and code**

### Other components

- **Engineer**
- **Epicor REST API**

## Connections

- Engineer → CLI entry: runs
- CLI entry → BPM commands: dispatches commands
- CLI entry → Config commands: dispatches commands
- CLI entry → Auth test: dispatches command
- BPM commands → Client factory: selects client
- BPM commands → Manifests and code: reads and writes
- Config commands → Environment config: manages configs
- Auth test → Authentication: tests credentials
- Authentication → Epicor REST API: tests authentication
- Client factory → Method client: selects Method client
- Client factory → Method mutations: selects Method client
- Client factory → Data client: selects Data client
- Client factory → Data mutations: selects Data client
- Method client → Epicor REST API: queries directives
- Data client → Epicor REST API: queries directives
- Method mutations → Method BPM helpers: uses BPM helpers
- Data mutations → Data BPM helpers: uses BPM helpers
- Method mutations → Epicor REST API: updates BPMs
- Data mutations → Epicor REST API: updates BPMs
- Method BPM helpers → Epicor REST API: validates code
- Data BPM helpers → Epicor REST API: validates code
- Method client → Method output: returns query results
- Data client → Data output: returns query results
- Method output → Method formatting: formats details
- Data output → Data formatting: formats details
