# hanif-mianjee/hanif-cli-tools architecture

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

- Interactive diagram: https://gitdiagram.com/hanif-mianjee/hanif-cli-tools
- Repository: https://github.com/hanif-mianjee/hanif-cli-tools

## Overview

Hanif is a personal productivity CLI. The principal workflow is a user invoking `hanif`, selecting a Git or productivity command, and receiving an operation such as branch management, clipboard access, or a local server. Other documented stages include interactive squash and pre-commit-hook management. The tree identifies command and function modules, but no source excerpts were supplied, so internal dispatch and delegation links are shown as unverified rather than inferred.

Main entry points: [`bin/hanif`](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/bin/hanif) (Hanif CLI), [`lib/commands/git.sh`](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/git.sh) (Git commands), [`lib/commands/squash.sh`](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/squash.sh) (Commit squash), [`lib/commands/pr.sh`](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/pr.sh) (Pull requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Hanif CLI"]
end

subgraph group_git["Git workflows"]
  node_git_cmd["Git commands<br/>[git.sh]"]
  node_branch_cmd["Branch naming<br/>[wip.sh]"]
  node_git_setup["Git profiles<br/>[git-setup.sh]"]
  node_stash["Stash manager<br/>[stash.sh]"]
  node_undo["Undo actions<br/>[undo.sh]"]
  node_squash["Commit squash<br/>[squash.sh]"]
  node_pr["Pull requests<br/>[pr.sh]"]
end

subgraph group_productivity["Productivity tools"]
  node_clip["Clipboard<br/>[clip.sh]"]
  node_ip["IP lookup<br/>[ip.sh]"]
  node_ports["Port tools<br/>[ports.sh]"]
  node_serve["Static server<br/>[serve.sh]"]
end

subgraph group_repo_tools["Repository tools"]
  node_precommit["Hook manager<br/>[pre-commit.sh]"]
  node_env["Environment settings<br/>[env.sh]"]
end

node_user(("User"))
node_browser["Web browser"]
node_clipboard_service["System clipboard"]
node_git_repo[("Git repository")]

node_user -->|"invokes"| node_cli
node_cli -.->|"dispatches"| node_git_cmd
node_cli -.->|"dispatches"| node_branch_cmd
node_cli -.->|"dispatches"| node_git_setup
node_cli -.->|"dispatches"| node_stash
node_cli -.->|"dispatches"| node_undo
node_cli -.->|"dispatches"| node_squash
node_cli -.->|"dispatches"| node_pr
node_cli -.->|"dispatches"| node_clip
node_cli -.->|"dispatches"| node_ip
node_cli -.->|"dispatches"| node_ports
node_cli -.->|"dispatches"| node_serve
node_cli -.->|"dispatches"| node_precommit
node_cli -.->|"dispatches"| node_env
node_pr -->|"opens URL"| node_browser
node_clip -->|"copies to"| node_clipboard_service
node_git_cmd -->|"operates on"| node_git_repo
node_squash -->|"rewrites commits"| node_git_repo

click node_cli "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/bin/hanif"
click node_git_cmd "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/git.sh"
click node_branch_cmd "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/wip.sh"
click node_git_setup "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/git-setup.sh"
click node_stash "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/stash.sh"
click node_undo "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/undo.sh"
click node_squash "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/squash.sh"
click node_pr "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/pr.sh"
click node_clip "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/clip.sh"
click node_ip "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/ip.sh"
click node_ports "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/ports.sh"
click node_serve "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/serve.sh"
click node_precommit "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/pre-commit.sh"
click node_env "https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/env.sh"

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_user,node_browser toneBlue
class node_git_cmd,node_branch_cmd,node_git_setup,node_stash,node_undo,node_squash,node_pr,node_git_repo toneAmber
class node_clip,node_ip,node_ports,node_serve toneMint
class node_precommit,node_env toneRose
class node_clipboard_service toneIndigo
```

## Components

### CLI entry

- [Hanif CLI](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/bin/hanif): `bin/hanif`

### Git workflows

- [Git commands](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/git.sh): `lib/commands/git.sh`
- [Branch naming](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/wip.sh): `lib/commands/wip.sh`
- [Git profiles](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/git-setup.sh): `lib/commands/git-setup.sh`
- [Stash manager](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/stash.sh): `lib/commands/stash.sh`
- [Undo actions](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/undo.sh): `lib/commands/undo.sh`
- [Commit squash](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/squash.sh): `lib/commands/squash.sh`
- [Pull requests](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/pr.sh): `lib/commands/pr.sh`

### Productivity tools

- [Clipboard](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/clip.sh): `lib/commands/clip.sh`
- [IP lookup](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/ip.sh): `lib/commands/ip.sh`
- [Port tools](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/ports.sh): `lib/commands/ports.sh`
- [Static server](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/serve.sh): `lib/commands/serve.sh`

### Repository tools

- [Hook manager](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/pre-commit.sh): `lib/commands/pre-commit.sh`
- [Environment settings](https://github.com/hanif-mianjee/hanif-cli-tools/blob/main/lib/commands/env.sh): `lib/commands/env.sh`

### Other components

- **User**
- **Web browser**
- **System clipboard**
- **Git repository**

## Connections

- User → Hanif CLI: invokes (evidence: `README.md`)
- Hanif CLI → Git commands: dispatches
- Hanif CLI → Branch naming: dispatches
- Hanif CLI → Git profiles: dispatches
- Hanif CLI → Stash manager: dispatches
- Hanif CLI → Undo actions: dispatches
- Hanif CLI → Commit squash: dispatches
- Hanif CLI → Pull requests: dispatches
- Hanif CLI → Clipboard: dispatches
- Hanif CLI → IP lookup: dispatches
- Hanif CLI → Port tools: dispatches
- Hanif CLI → Static server: dispatches
- Hanif CLI → Hook manager: dispatches
- Hanif CLI → Environment settings: dispatches
- Pull requests → Web browser: opens URL (evidence: `README.md`)
- Clipboard → System clipboard: copies to (evidence: `README.md`)
- Git commands → Git repository: operates on (evidence: `README.md`)
- Commit squash → Git repository: rewrites commits (evidence: `README.md`)
