# 1gmedia/ghlcli architecture

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

- Interactive diagram: https://gitdiagram.com/1gmedia/ghlcli
- Repository: https://github.com/1gmedia/ghlcli

## Overview

ghlcli is primarily an agent-friendly GoHighLevel CLI with a Python SDK, official public-API access, endpoint discovery, and a guarded experimental Firebase/internal workflow lane. Users invoke CRM commands or SDK methods to read and manage GHL resources; workflow-builder scripts additionally turn campaign definitions into draft workflows. The README also documents endpoint coverage, REPL, and agent-skill usage. The graph follows shown imports, calls, and README statements; unsampled command details are represented only at subsystem level.

Main entry points: [`cli_anything/gohighlevel/cli_extensions.py`](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/cli_extensions.py) (Foundation commands), [`cli_anything/gohighlevel/gohighlevel_cli.py`](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/gohighlevel_cli.py) (GHL command CLI), [`cli_anything/gohighlevel/utils/ghl_internal_client.py`](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_internal_client.py) (Internal API client), [`cli_anything/gohighlevel/utils/ghl_client.py`](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_client.py) (Public API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_main_cli["GHL command CLI<br/>[gohighlevel_cli.py]"]
  node_extensions["Foundation commands<br/>[cli_extensions.py]"]
  node_repl["Interactive REPL<br/>[repl_skin.py]"]
  node_sdk["Python SDK<br/>[client.py]"]
  node_agent_skill["Agent skill package"]
end

subgraph group_public["Public API lane"]
  node_public_client["Public API client<br/>[ghl_client.py]"]
  node_pit_auth["PIT authentication<br/>[pit.py]"]
  node_public_service["GoHighLevel public API"]
end

subgraph group_internal["Internal workflow lane"]
  node_internal_client["Internal API client"]
  node_firebase_auth["Firebase token manager"]
  node_secure_token["Google Secure Token API"]
  node_workflow_builder["Workflow builder"]
  node_campaign_scripts["Campaign builders"]
  node_sequence_parser["Email sequence parser"]
  node_internal_service["GoHighLevel internal API"]
end

subgraph group_support["Discovery and setup"]
  node_artist_setup["Artist provisioning"]
  node_endpoint_catalog["Endpoint catalog<br/>[endpoints.py]"]
  node_mcp_inventory["MCP inventory<br/>[mcp_inventory.py]"]
  node_coverage["Coverage reporting<br/>[coverage.py]"]
  node_registry["Command registry<br/>[registry.py]"]
  node_qa["QA stress harness<br/>[qa_stress.py]"]
end

node_operator(("CLI / SDK user"))

node_operator -->|"runs commands"| node_main_cli
node_operator -->|"calls SDK"| node_sdk
node_main_cli -->|"registers commands"| node_extensions
node_main_cli -->|"calls API"| node_public_client
node_main_cli -->|"launches REPL"| node_repl
node_main_cli -->|"calls internal API"| node_internal_client
node_main_cli -->|"builds workflows"| node_workflow_builder
node_extensions -->|"registers coverage"| node_coverage
node_extensions -->|"runs setup"| node_artist_setup
node_extensions -->|"routes requests"| node_internal_client
node_extensions -->|"routes requests"| node_public_client
node_sdk -->|"uses credentials"| node_pit_auth
node_sdk -->|"sends API requests"| node_public_service
node_public_client -->|"builds auth headers"| node_pit_auth
node_public_client -->|"sends API requests"| node_public_service
node_workflow_builder -->|"creates workflow steps"| node_internal_client
node_internal_client -->|"gets ID token"| node_firebase_auth
node_firebase_auth -->|"refreshes token"| node_secure_token
node_internal_client -->|"sends internal requests"| node_internal_service
node_campaign_scripts -->|"uses builder"| node_workflow_builder
node_campaign_scripts -->|"parses sequences"| node_sequence_parser
node_coverage -->|"compares endpoints"| node_endpoint_catalog
node_coverage -->|"compares tools"| node_mcp_inventory
node_extensions -->|"uses command registry"| node_registry
node_extensions -->|"registers QA"| node_qa
node_operator -->|"uses agent skill"| node_agent_skill

click node_main_cli "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/gohighlevel_cli.py"
click node_extensions "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/cli_extensions.py"
click node_repl "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/repl_skin.py"
click node_sdk "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/sdk/client.py"
click node_public_client "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_client.py"
click node_pit_auth "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/auth/pit.py"
click node_internal_client "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_internal_client.py"
click node_firebase_auth "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_internal_client.py"
click node_workflow_builder "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/workflow_builder.py"
click node_campaign_scripts "https://github.com/1gmedia/ghlcli/tree/main/builders"
click node_sequence_parser "https://github.com/1gmedia/ghlcli/blob/main/builders/_email_sequences_parser.py"
click node_artist_setup "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/artist_provisioning.py"
click node_endpoint_catalog "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/endpoints.py"
click node_mcp_inventory "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/mcp_inventory.py"
click node_coverage "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/coverage.py"
click node_registry "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/registry.py"
click node_qa "https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/qa_stress.py"
click node_agent_skill "https://github.com/1gmedia/ghlcli/tree/main/skills"

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_cli,node_extensions,node_repl,node_sdk,node_agent_skill,node_operator toneBlue
class node_public_client,node_pit_auth,node_public_service toneAmber
class node_internal_client,node_firebase_auth,node_secure_token,node_workflow_builder,node_campaign_scripts,node_sequence_parser,node_internal_service toneMint
class node_artist_setup,node_endpoint_catalog,node_mcp_inventory,node_coverage,node_registry,node_qa toneRose
```

## Components

### User interfaces

- [GHL command CLI](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/gohighlevel_cli.py): `cli_anything/gohighlevel/gohighlevel_cli.py`
- [Foundation commands](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/cli_extensions.py): `cli_anything/gohighlevel/cli_extensions.py`
- [Interactive REPL](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/repl_skin.py): `cli_anything/gohighlevel/utils/repl_skin.py`
- [Python SDK](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/sdk/client.py): `cli_anything/gohighlevel/sdk/client.py`
- [Agent skill package](https://github.com/1gmedia/ghlcli/tree/main/skills): `skills`

### Public API lane

- [Public API client](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_client.py): `cli_anything/gohighlevel/utils/ghl_client.py`
- [PIT authentication](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/auth/pit.py): `cli_anything/gohighlevel/auth/pit.py`
- **GoHighLevel public API**

### Internal workflow lane

- [Internal API client](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_internal_client.py): `cli_anything/gohighlevel/utils/ghl_internal_client.py`
- [Firebase token manager](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/ghl_internal_client.py): `cli_anything/gohighlevel/utils/ghl_internal_client.py`
- **Google Secure Token API**
- [Workflow builder](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/utils/workflow_builder.py): `cli_anything/gohighlevel/utils/workflow_builder.py`
- [Campaign builders](https://github.com/1gmedia/ghlcli/tree/main/builders): `builders`
- [Email sequence parser](https://github.com/1gmedia/ghlcli/blob/main/builders/_email_sequences_parser.py): `builders/_email_sequences_parser.py`
- **GoHighLevel internal API**

### Discovery and setup

- [Artist provisioning](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/artist_provisioning.py): `cli_anything/gohighlevel/artist_provisioning.py`
- [Endpoint catalog](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/endpoints.py): `cli_anything/gohighlevel/endpoints.py`
- [MCP inventory](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/mcp_inventory.py): `cli_anything/gohighlevel/mcp_inventory.py`
- [Coverage reporting](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/coverage.py): `cli_anything/gohighlevel/coverage.py`
- [Command registry](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/registry.py): `cli_anything/gohighlevel/registry.py`
- [QA stress harness](https://github.com/1gmedia/ghlcli/blob/main/cli_anything/gohighlevel/qa_stress.py): `cli_anything/gohighlevel/qa_stress.py`

### Other components

- **CLI / SDK user**

## Connections

- CLI / SDK user → GHL command CLI: runs commands (evidence: `README.md`)
- CLI / SDK user → Python SDK: calls SDK (evidence: `README.md`)
- GHL command CLI → Foundation commands: registers commands (evidence: `cli_anything/gohighlevel/gohighlevel_cli.py`)
- GHL command CLI → Public API client: calls API (evidence: `cli_anything/gohighlevel/gohighlevel_cli.py`)
- GHL command CLI → Interactive REPL: launches REPL (evidence: `cli_anything/gohighlevel/gohighlevel_cli.py`)
- GHL command CLI → Internal API client: calls internal API (evidence: `cli_anything/gohighlevel/gohighlevel_cli.py`)
- GHL command CLI → Workflow builder: builds workflows (evidence: `cli_anything/gohighlevel/gohighlevel_cli.py`)
- Foundation commands → Coverage reporting: registers coverage (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- Foundation commands → Artist provisioning: runs setup (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- Foundation commands → Internal API client: routes requests (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- Foundation commands → Public API client: routes requests (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- Python SDK → PIT authentication: uses credentials (evidence: `cli_anything/gohighlevel/sdk/client.py`)
- Python SDK → GoHighLevel public API: sends API requests (evidence: `README.md`)
- Public API client → PIT authentication: builds auth headers (evidence: `cli_anything/gohighlevel/auth/pit.py`)
- Public API client → GoHighLevel public API: sends API requests (evidence: `cli_anything/gohighlevel/utils/ghl_client.py`)
- Workflow builder → Internal API client: creates workflow steps (evidence: `cli_anything/gohighlevel/utils/workflow_builder.py`)
- Internal API client → Firebase token manager: gets ID token (evidence: `cli_anything/gohighlevel/utils/ghl_internal_client.py`)
- Firebase token manager → Google Secure Token API: refreshes token (evidence: `cli_anything/gohighlevel/utils/ghl_internal_client.py`)
- Internal API client → GoHighLevel internal API: sends internal requests (evidence: `README.md`)
- Campaign builders → Workflow builder: uses builder (evidence: `builders/consulti-nurture-builder.py`)
- Campaign builders → Email sequence parser: parses sequences (evidence: `builders/wf1-course-interest-builder.py`)
- Coverage reporting → Endpoint catalog: compares endpoints (evidence: `cli_anything/gohighlevel/coverage.py`)
- Coverage reporting → MCP inventory: compares tools (evidence: `cli_anything/gohighlevel/coverage.py`)
- Foundation commands → Command registry: uses command registry (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- Foundation commands → QA stress harness: registers QA (evidence: `cli_anything/gohighlevel/cli_extensions.py`)
- CLI / SDK user → Agent skill package: uses agent skill (evidence: `README.md`)
