# chandru-mck-222/chan-cli architecture

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

- Interactive diagram: https://gitdiagram.com/chandru-mck-222/chan-cli
- Repository: https://github.com/chandru-mck-222/chan-cli

## Overview

#### Purpose and Runtime

This repository is a Go command-line application, `cli-chanmck`, focused on author metadata and Git/GitHub-style repository operations. The project root is `cli-chanmck/`; it is built and containerized with `cli-chanmck/Makefile` and `cli-chanmck/Dockerfile`.

#### CLI Entry and Command Assembly

Program startup is `cli-chanmck/cmd/main.go`. It delegates command registration and execution to `cli-chanmck/cmd/cmd-server/root.go`, which is the primary CLI control boundary. The `cmd-server` structure suggests a command-oriented interface rather than a long-running server.

#### Author Information Domain

Author identity/configuration is isolated under `cli-chanmck/cmd/cmd-server/AuthorInfo/`. `Info.go` and `authmodels.go` define the author-information command/domain model, keeping user-facing identity data separate from repository mutation behavior.

Paths:
- `cli-chanmck/cmd/cmd-server/AuthorInfo/Info.go`
- `cli-chanmck/cmd/cmd-server/AuthorInfo/authmodels.go`

#### Git Operation Layer

Git actions are implemented as dedicated operation modules in `cli-chanmck/pkg/internals/github_action/`. This is the core integration boundary with the local Git executable/repository state: checkout, pull, commit, push, and synchronization are distinct stages.

Paths:
- `cli-chanmck/pkg/internals/github_action/git.go`
- `cli-chanmck/pkg/internals/github_action/gitcheckoutmain.go`
- `cli-chanmck/pkg/internals/github_action/gitcommit.go`
- `cli-chanmck/pkg/internals/github_action/gitpush.go`

#### Synchronization Workflow

`gitsync.go` coordinates multi-step repository synchronization, likely sequencing pull/update and push behavior around local repository state. Its helper package centralizes supporting synchronization logic, while workflow YAML files define alternative pull strategies, including rebase.

Paths:
- `cli-chanmck/pkg/internals/github_action/gitsync.go`
- `cli-chanmck/pkg/internals/github_action/helper/gitsync_helper.go`
- `cli-chanmck/pkg/internals/github_action/gitworkflow/gitpull.yml`
- `cli-chanmck/pkg/internals/github_action/gitworkflow/gitpullrebase.yml`

#### Primary Control and Data Flow

A user invokes the Go CLI entry point; command routing selects author-info or Git-related behavior. Git commands operate against a local checked-out repository, invoke Git actions, and interact with its configured remote—typically a GitHub remote, though no GitHub API client is present in the tree. Sync flow is the principal orchestration path: choose pull policy, update local history, then commit/push as requested. Repository state and author metadata are the key inputs; Git command outcomes are the main error/control boundary.

#### Infrastructure and Boundaries

The runtime is Go (`cli-chanmck/go.mod`), with version tooling indicated by `cli-chanmck/.tool-versions`. Docker provides a portable execution/build environment. The application depends on local Git availability and remote Git hosting credentials/configuration supplied externally; it does not contain infrastructure provisioning or a web-service layer.

Main entry points: [`cli-chanmck/pkg/internals/github_action/git.go`](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/git.go) (Git Integration), [`cli-chanmck/pkg/internals/github_action/gitsync.go`](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitsync.go) (Sync Orchestrator), [`cli-chanmck/cmd/cmd-server/root.go`](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/root.go) (Command Router), [`cli-chanmck/pkg/internals/github_action/gitpush.go`](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitpush.go) (Push)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI Runtime"]
  node_entry["Program Entry<br/>Go executable<br/>[main.go]"]
  node_root["Command Router<br/>CLI control<br/>[root.go]"]
end

subgraph group_author["Author Domain"]
  node_author_info["Author Info Command<br/>command domain<br/>[Info.go]"]
  node_author_models["Author Models<br/>domain model<br/>[authmodels.go]"]
end

subgraph group_git["Git Operations"]
  node_git_core["Git Integration<br/>Git command layer<br/>[git.go]"]
  node_checkout["Checkout<br/>Git operation<br/>[gitcheckoutmain.go]"]
  node_commit["Commit<br/>Git operation<br/>[gitcommit.go]"]
  node_push["Push<br/>Git operation<br/>[gitpush.go]"]
end

subgraph group_sync["Sync Workflow"]
  node_sync["Sync Orchestrator<br/>workflow<br/>[gitsync.go]"]
  node_sync_helper["Sync Helper<br/>workflow support<br/>[gitsync_helper.go]"]
  node_pull_policy["Pull Policies<br/>workflow definitions<br/>[gitpull.yml]"]
end

node_build["Build &amp; Container<br/>tooling"]
node_local_repo[("Local Git Repository<br/>external state")]
node_remote[("Remote Git Host<br/>external remote")]

node_build -->|"builds"| node_entry
node_entry -->|"starts"| node_root
node_root -->|"routes author commands"| node_author_info
node_author_info -->|"uses"| node_author_models
node_root -->|"routes Git commands"| node_git_core
node_git_core -->|"performs"| node_checkout
node_git_core -->|"performs"| node_commit
node_git_core -->|"performs"| node_push
node_git_core -->|"invokes Git against"| node_local_repo
node_root -->|"runs sync"| node_sync
node_sync -->|"uses"| node_sync_helper
node_sync -->|"selects"| node_pull_policy
node_sync -->|"commits as requested"| node_commit
node_sync -->|"pushes as requested"| node_push
node_pull_policy -->|"updates history"| node_local_repo
node_push -->|"pushes to"| node_remote
node_remote -.->|"pull source"| node_local_repo

click node_build "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/Makefile"
click node_entry "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/main.go"
click node_root "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/root.go"
click node_author_info "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/AuthorInfo/Info.go"
click node_author_models "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/AuthorInfo/authmodels.go"
click node_git_core "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/git.go"
click node_checkout "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitcheckoutmain.go"
click node_commit "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitcommit.go"
click node_push "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitpush.go"
click node_sync "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitsync.go"
click node_sync_helper "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/helper/gitsync_helper.go"
click node_pull_policy "https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitworkflow/gitpull.yml"

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_entry,node_root toneBlue
class node_author_info,node_author_models toneAmber
class node_git_core,node_checkout,node_commit,node_push toneMint
class node_sync,node_sync_helper,node_pull_policy toneRose
class node_build,node_local_repo,node_remote toneNeutral
```

## Components

### CLI Runtime

- [Program Entry](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/main.go): Go executable · `cli-chanmck/cmd/main.go`
- [Command Router](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/root.go): CLI control · Registers and executes commands. · `cli-chanmck/cmd/cmd-server/root.go`

### Author Domain

- [Author Info Command](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/AuthorInfo/Info.go): command domain · `cli-chanmck/cmd/cmd-server/AuthorInfo/Info.go`
- [Author Models](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/cmd/cmd-server/AuthorInfo/authmodels.go): domain model · `cli-chanmck/cmd/cmd-server/AuthorInfo/authmodels.go`

### Git Operations

- [Git Integration](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/git.go): Git command layer · Boundary to the local Git executable and repository state. · `cli-chanmck/pkg/internals/github_action/git.go`
- [Checkout](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitcheckoutmain.go): Git operation · `cli-chanmck/pkg/internals/github_action/gitcheckoutmain.go`
- [Commit](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitcommit.go): Git operation · `cli-chanmck/pkg/internals/github_action/gitcommit.go`
- [Push](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitpush.go): Git operation · `cli-chanmck/pkg/internals/github_action/gitpush.go`

### Sync Workflow

- [Sync Orchestrator](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitsync.go): workflow · Coordinates pull/update and optional commit/push stages. · `cli-chanmck/pkg/internals/github_action/gitsync.go`
- [Sync Helper](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/helper/gitsync_helper.go): workflow support · `cli-chanmck/pkg/internals/github_action/helper/gitsync_helper.go`
- [Pull Policies](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/pkg/internals/github_action/gitworkflow/gitpull.yml): workflow definitions · Defines normal and rebase pull strategies. · `cli-chanmck/pkg/internals/github_action/gitworkflow/gitpull.yml`

### Other components

- [Build & Container](https://github.com/chandru-mck-222/chan-cli/blob/main/cli-chanmck/Makefile): tooling · Builds and packages the CLI. · `cli-chanmck/Makefile`
- **Local Git Repository**: external state · Working tree, history, and Git configuration.
- **Remote Git Host**: external remote · Configured remote with externally supplied credentials.

## Connections

- Build & Container → Program Entry: builds
- Program Entry → Command Router: starts
- Command Router → Author Info Command: routes author commands
- Author Info Command → Author Models: uses
- Command Router → Git Integration: routes Git commands
- Git Integration → Checkout: performs
- Git Integration → Commit: performs
- Git Integration → Push: performs
- Git Integration → Local Git Repository: invokes Git against
- Command Router → Sync Orchestrator: runs sync
- Sync Orchestrator → Sync Helper: uses
- Sync Orchestrator → Pull Policies: selects
- Sync Orchestrator → Commit: commits as requested
- Sync Orchestrator → Push: pushes as requested
- Pull Policies → Local Git Repository: updates history
- Push → Remote Git Host: pushes to
- Remote Git Host → Local Git Repository: pull source
