# warshoow/grab-cli architecture

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

- Interactive diagram: https://gitdiagram.com/warshoow/grab-cli
- Repository: https://github.com/warshoow/grab-cli
- Video tour (about a minute): https://gitdiagram.com/warshoow/grab-cli/video

## Overview

grab-cli is a Bash command-line tool for selectively copying tools from a Git monorepo into a project, tracking them in a manifest, and optionally sending changes back. The documented workflow is configure or initialize, add/install tools, optionally run hooks, then use or update them. The README documents broad command capabilities, but no source excerpts were available, so internal call structure is not inferred; feature nodes share the documented script path.

Main entry points: [`grab`](https://github.com/warshoow/grab-cli/blob/master/grab) (grab CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_config["Configuration"]
  node_grab["grab CLI"]
  node_setup["Setup and defaults"]
  node_init["Project initialization"]
  node_configfile["Global config"]
  node_manifest[".grabfile"]
end

subgraph group_acquire["Tool Acquisition"]
  node_add["Add tool"]
  node_install["Install manifest tools"]
  node_cache[("Sparse repo cache")]
  node_installed[("Installed tools")]
  node_hooks["Post-grab hooks"]
end

subgraph group_manage["Tool Management"]
  node_remove["Remove tool"]
  node_update["Update tools"]
  node_push["Push tool changes"]
  node_publish["Publish tool"]
  node_inspect["List and status"]
end

subgraph group_use["Tool Use"]
  node_exec["Execute tool"]
  node_path["Resolve tool path"]
end

node_maintainer(("Project maintainer"))
node_workspace["Project workspace"]
node_monorepo[("Tools monorepo")]
node_git["Git"]

node_maintainer -->|"runs commands"| node_grab
node_grab -->|"dispatches"| node_setup
node_grab -->|"dispatches"| node_init
node_grab -->|"dispatches"| node_add
node_grab -->|"dispatches"| node_install
node_grab -->|"dispatches"| node_remove
node_grab -->|"dispatches"| node_update
node_grab -->|"dispatches"| node_push
node_grab -->|"dispatches"| node_publish
node_grab -->|"dispatches"| node_inspect
node_grab -->|"dispatches"| node_exec
node_grab -->|"dispatches"| node_path
node_grab -->|"dispatches"| node_hooks
node_setup -->|"writes defaults"| node_configfile
node_init -->|"creates"| node_manifest
node_init -->|"initializes"| node_workspace
node_add -->|"records tool"| node_manifest
node_install -->|"reads tools"| node_manifest
node_add -->|"uses sparse cache"| node_cache
node_install -->|"uses sparse cache"| node_cache
node_add -->|"fetches tool"| node_monorepo
node_install -->|"fetches tools"| node_monorepo
node_add -->|"copies tool"| node_installed
node_install -->|"copies tools"| node_installed
node_add -->|"may run hook"| node_hooks
node_install -->|"may run hooks"| node_hooks
node_hooks -->|"sets up project"| node_workspace
node_remove -->|"removes tool"| node_installed
node_remove -->|"updates manifest"| node_manifest
node_update -->|"fetches updates"| node_monorepo
node_update -->|"updates tools"| node_installed
node_push -->|"pushes changes"| node_monorepo
node_publish -->|"publishes folder"| node_monorepo
node_inspect -->|"reads manifest"| node_manifest
node_inspect -->|"lists remote tools"| node_monorepo
node_exec -->|"runs entrypoint"| node_installed
node_path -->|"resolves location"| node_installed
node_add -->|"uses Git"| node_git
node_install -->|"uses Git"| node_git
node_update -->|"uses Git"| node_git
node_push -->|"uses Git"| node_git
node_publish -->|"uses Git"| node_git
node_git -->|"transfers repository data"| node_monorepo

click node_grab "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_setup "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_init "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_add "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_install "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_hooks "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_remove "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_update "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_push "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_publish "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_inspect "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_exec "https://github.com/warshoow/grab-cli/blob/master/grab"
click node_path "https://github.com/warshoow/grab-cli/blob/master/grab"

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_grab,node_setup,node_init,node_configfile,node_manifest toneBlue
class node_add,node_install,node_cache,node_installed,node_hooks,node_monorepo toneAmber
class node_remove,node_update,node_push,node_publish,node_inspect toneMint
class node_exec,node_path toneRose
class node_maintainer,node_workspace,node_git toneIndigo
```

## Components

### Configuration

- [grab CLI](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Setup and defaults](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Project initialization](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- **Global config**
- **.grabfile**

### Tool Acquisition

- [Add tool](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Install manifest tools](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- **Sparse repo cache**
- **Installed tools**
- [Post-grab hooks](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`

### Tool Management

- [Remove tool](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Update tools](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Push tool changes](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Publish tool](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [List and status](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`

### Tool Use

- [Execute tool](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`
- [Resolve tool path](https://github.com/warshoow/grab-cli/blob/master/grab): `grab`

### Other components

- **Project maintainer**
- **Project workspace**
- **Tools monorepo**
- **Git**

## Connections

- Project maintainer → grab CLI: runs commands
- grab CLI → Setup and defaults: dispatches
- grab CLI → Project initialization: dispatches
- grab CLI → Add tool: dispatches
- grab CLI → Install manifest tools: dispatches
- grab CLI → Remove tool: dispatches
- grab CLI → Update tools: dispatches
- grab CLI → Push tool changes: dispatches
- grab CLI → Publish tool: dispatches
- grab CLI → List and status: dispatches
- grab CLI → Execute tool: dispatches
- grab CLI → Resolve tool path: dispatches
- grab CLI → Post-grab hooks: dispatches
- Setup and defaults → Global config: writes defaults
- Project initialization → .grabfile: creates
- Project initialization → Project workspace: initializes
- Add tool → .grabfile: records tool
- Install manifest tools → .grabfile: reads tools
- Add tool → Sparse repo cache: uses sparse cache
- Install manifest tools → Sparse repo cache: uses sparse cache
- Add tool → Tools monorepo: fetches tool
- Install manifest tools → Tools monorepo: fetches tools
- Add tool → Installed tools: copies tool
- Install manifest tools → Installed tools: copies tools
- Add tool → Post-grab hooks: may run hook
- Install manifest tools → Post-grab hooks: may run hooks
- Post-grab hooks → Project workspace: sets up project
- Remove tool → Installed tools: removes tool
- Remove tool → .grabfile: updates manifest
- Update tools → Tools monorepo: fetches updates
- Update tools → Installed tools: updates tools
- Push tool changes → Tools monorepo: pushes changes
- Publish tool → Tools monorepo: publishes folder
- List and status → .grabfile: reads manifest
- List and status → Tools monorepo: lists remote tools
- Execute tool → Installed tools: runs entrypoint
- Resolve tool path → Installed tools: resolves location
- Add tool → Git: uses Git
- Install manifest tools → Git: uses Git
- Update tools → Git: uses Git
- Push tool changes → Git: uses Git
- Publish tool → Git: uses Git
- Git → Tools monorepo: transfers repository data
