# v-alexmoraru/fabric-cli architecture

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

- Interactive diagram: https://gitdiagram.com/v-alexmoraru/fabric-cli
- Repository: https://github.com/v-alexmoraru/fabric-cli

## Overview

Microsoft Fabric CLI (`fab`) is a file-system-inspired terminal interface for exploring and managing Fabric resources. The main workflow is user command → CLI parsing and dispatch → context-aware resource operations → authenticated Fabric or OneLake APIs → formatted terminal output. Separate command families cover jobs, tables, API requests, authentication, configuration, and labels. The hierarchy and context layer resolve virtual paths into Fabric resources. Edges are limited to relationships explicit in the README or SOURCE INDEX; unsampled implementations and service calls are not inferred.

Main entry points: [`src/fabric_cli/client/fab_api_client.py`](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_client.py) (HTTP API client), [`src/fabric_cli/commands/fs`](https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/fs) (Filesystem commands), [`src/fabric_cli/main.py`](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/main.py) (CLI entry), [`src/fabric_cli/client/fab_api_onelake.py`](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_onelake.py) (OneLake API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry and commands"]
  node_main["CLI entry<br/>[main.py]"]
  node_parsers["Command parsers"]
  node_fs["Filesystem commands"]
  node_authcmd["Auth commands<br/>[fab_auth.py]"]
  node_jobs["Job commands<br/>[fab_jobs.py]"]
  node_tables["Table commands"]
  node_api_cmd["API commands"]
end

subgraph group_runtime["Runtime and context"]
  node_auth["Authentication<br/>[fab_auth.py]"]
  node_context["Session context<br/>[fab_context.py]"]
  node_pathresolve["Path resolution"]
  node_hierarchy["Resource hierarchy<br/>[fab_element.py]"]
  node_workspace["Workspace model<br/>[fab_workspace.py]"]
  node_commands["Command registry<br/>[fab_commands.py]"]
  node_types["Resource types<br/>[fab_types.py]"]
end

subgraph group_services["Fabric API clients"]
  node_client["HTTP API client<br/>[fab_api_client.py]"]
  node_item_api["Item API<br/>[fab_api_item.py]"]
  node_onelake_api["OneLake API<br/>[fab_api_onelake.py]"]
end

subgraph group_operations["Resource operations"]
  node_jobs_api["Job operations<br/>[fab_api_jobs.py]"]
  node_tables_api["Table operations<br/>[fab_api_tables.py]"]
  node_storage["File storage helpers<br/>[fab_storage.py]"]
end

subgraph group_support["Supporting capabilities"]
  node_config[("Configuration")]
  node_memstore["Memory cache<br/>[fab_mem_store.py]"]
  node_errors["Error handling"]
  node_output["Terminal output<br/>[fab_ui.py]"]
  node_constants["CLI constants<br/>[fab_constant.py]"]
  node_exceptions["CLI exceptions<br/>[fab_exceptions.py]"]
  node_logger["Logging<br/>[fab_logger.py]"]
  node_util["Core utilities<br/>[fab_util.py]"]
end

node_user(("CLI user"))
node_fabric[("Microsoft Fabric")]
node_onelake[("OneLake")]

node_user -->|"runs commands"| node_main
node_main -->|"sets up"| node_parsers
node_parsers -->|"dispatches"| node_fs
node_parsers -->|"dispatches"| node_jobs
node_main -->|"invokes"| node_authcmd
node_main -->|"uses"| node_commands
node_fs -.->|"uses API client"| node_client
node_fs -.->|"resolves paths"| node_pathresolve
node_fs -->|"manages items"| node_item_api
node_fs -->|"operates OneLake"| node_onelake_api
node_authcmd -->|"manages login"| node_auth
node_jobs -->|"manages runs"| node_jobs_api
node_tables -->|"operates tables"| node_tables_api
node_tables -->|"reads files"| node_onelake_api
node_api_cmd -.->|"makes requests"| node_client
node_client -->|"uses credentials"| node_auth
node_client -->|"reads settings"| node_config
node_client -.->|"sends requests"| node_fabric
node_onelake_api -.->|"accesses data"| node_onelake
node_storage -->|"uses API"| node_onelake_api
node_context -->|"uses identity"| node_auth
node_context -->|"resolves location"| node_pathresolve
node_pathresolve -->|"looks up workspaces"| node_memstore
node_hierarchy -->|"models resources"| node_workspace
node_client -->|"parses failures"| node_errors
node_client -->|"logs requests"| node_logger
node_fs -->|"prints results"| node_output
node_main -->|"loads settings"| node_config

click node_main "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/main.py"
click node_parsers "https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/parsers"
click node_fs "https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/fs"
click node_authcmd "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/commands/auth/fab_auth.py"
click node_jobs "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/commands/jobs/fab_jobs.py"
click node_tables "https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/tables"
click node_api_cmd "https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/api"
click node_auth "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_auth.py"
click node_context "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_context.py"
click node_pathresolve "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_handle_context.py"
click node_hierarchy "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/hiearchy/fab_element.py"
click node_workspace "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/hiearchy/fab_workspace.py"
click node_commands "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_commands.py"
click node_types "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_types.py"
click node_client "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_client.py"
click node_item_api "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_item.py"
click node_onelake_api "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_onelake.py"
click node_jobs_api "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_jobs.py"
click node_tables_api "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_tables.py"
click node_storage "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_storage.py"
click node_config "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_state_config.py"
click node_memstore "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_mem_store.py"
click node_errors "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_error_parser.py"
click node_output "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_ui.py"
click node_constants "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_constant.py"
click node_exceptions "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_exceptions.py"
click node_logger "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_logger.py"
click node_util "https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_util.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_main,node_parsers,node_fs,node_authcmd,node_jobs,node_tables,node_api_cmd,node_user toneBlue
class node_auth,node_context,node_pathresolve,node_hierarchy,node_workspace,node_commands,node_types,node_fabric,node_onelake toneAmber
class node_client,node_item_api,node_onelake_api toneMint
class node_jobs_api,node_tables_api,node_storage toneRose
class node_config,node_memstore,node_errors,node_output,node_constants,node_exceptions,node_logger,node_util toneIndigo
```

## Components

### CLI entry and commands

- [CLI entry](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/main.py): `src/fabric_cli/main.py`
- [Command parsers](https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/parsers): `src/fabric_cli/parsers`
- [Filesystem commands](https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/fs): `src/fabric_cli/commands/fs`
- [Auth commands](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/commands/auth/fab_auth.py): `src/fabric_cli/commands/auth/fab_auth.py`
- [Job commands](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/commands/jobs/fab_jobs.py): `src/fabric_cli/commands/jobs/fab_jobs.py`
- [Table commands](https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/tables): `src/fabric_cli/commands/tables`
- [API commands](https://github.com/v-alexmoraru/fabric-cli/tree/main/src/fabric_cli/commands/api): `src/fabric_cli/commands/api`

### Runtime and context

- [Authentication](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_auth.py): `src/fabric_cli/core/fab_auth.py`
- [Session context](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_context.py): `src/fabric_cli/core/fab_context.py`
- [Path resolution](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_handle_context.py): `src/fabric_cli/core/fab_handle_context.py`
- [Resource hierarchy](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/hiearchy/fab_element.py): `src/fabric_cli/core/hiearchy/fab_element.py`
- [Workspace model](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/hiearchy/fab_workspace.py): `src/fabric_cli/core/hiearchy/fab_workspace.py`
- [Command registry](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_commands.py): `src/fabric_cli/core/fab_commands.py`
- [Resource types](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_types.py): `src/fabric_cli/core/fab_types.py`

### Fabric API clients

- [HTTP API client](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_client.py): `src/fabric_cli/client/fab_api_client.py`
- [Item API](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_item.py): `src/fabric_cli/client/fab_api_item.py`
- [OneLake API](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_onelake.py): `src/fabric_cli/client/fab_api_onelake.py`

### Resource operations

- [Job operations](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_jobs.py): `src/fabric_cli/client/fab_api_jobs.py`
- [Table operations](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/client/fab_api_tables.py): `src/fabric_cli/client/fab_api_tables.py`
- [File storage helpers](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_storage.py): `src/fabric_cli/utils/fab_storage.py`

### Supporting capabilities

- [Configuration](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_state_config.py): `src/fabric_cli/core/fab_state_config.py`
- [Memory cache](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_mem_store.py): `src/fabric_cli/utils/fab_mem_store.py`
- [Error handling](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_error_parser.py): `src/fabric_cli/utils/fab_error_parser.py`
- [Terminal output](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_ui.py): `src/fabric_cli/utils/fab_ui.py`
- [CLI constants](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_constant.py): `src/fabric_cli/core/fab_constant.py`
- [CLI exceptions](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_exceptions.py): `src/fabric_cli/core/fab_exceptions.py`
- [Logging](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/core/fab_logger.py): `src/fabric_cli/core/fab_logger.py`
- [Core utilities](https://github.com/v-alexmoraru/fabric-cli/blob/main/src/fabric_cli/utils/fab_util.py): `src/fabric_cli/utils/fab_util.py`

### Other components

- **CLI user**
- **Microsoft Fabric**
- **OneLake**

## Connections

- CLI user → CLI entry: runs commands
- CLI entry → Command parsers: sets up (evidence: `src/fabric_cli/main.py`)
- Command parsers → Filesystem commands: dispatches (evidence: `src/fabric_cli/parsers/fab_fs_parser.py`)
- Command parsers → Job commands: dispatches (evidence: `src/fabric_cli/parsers/fab_jobs_parser.py`)
- CLI entry → Auth commands: invokes (evidence: `src/fabric_cli/main.py`)
- CLI entry → Command registry: uses (evidence: `src/fabric_cli/main.py`)
- Filesystem commands → HTTP API client: uses API client
- Filesystem commands → Path resolution: resolves paths (evidence: `src/fabric_cli/commands/fs/fab_fs.py`)
- Filesystem commands → Item API: manages items (evidence: `src/fabric_cli/commands/fs/export/fab_fs_export_item.py`)
- Filesystem commands → OneLake API: operates OneLake
- Auth commands → Authentication: manages login (evidence: `src/fabric_cli/commands/auth/fab_auth.py`)
- Job commands → Job operations: manages runs
- Table commands → Table operations: operates tables (evidence: `src/fabric_cli/commands/tables/fab_tables_load.py`)
- Table commands → OneLake API: reads files (evidence: `src/fabric_cli/commands/tables/fab_tables_load.py`)
- API commands → HTTP API client: makes requests
- HTTP API client → Authentication: uses credentials (evidence: `src/fabric_cli/client/fab_api_client.py`)
- HTTP API client → Configuration: reads settings (evidence: `src/fabric_cli/client/fab_api_client.py`)
- HTTP API client → Microsoft Fabric: sends requests
- OneLake API → OneLake: accesses data
- File storage helpers → OneLake API: uses API (evidence: `src/fabric_cli/utils/fab_storage.py`)
- Session context → Authentication: uses identity (evidence: `src/fabric_cli/core/fab_context.py`)
- Session context → Path resolution: resolves location (evidence: `src/fabric_cli/core/fab_context.py`)
- Path resolution → Memory cache: looks up workspaces (evidence: `src/fabric_cli/core/fab_handle_context.py`)
- Resource hierarchy → Workspace model: models resources (evidence: `src/fabric_cli/core/hiearchy/fab_hiearchy.py`)
- HTTP API client → Error handling: parses failures (evidence: `src/fabric_cli/client/fab_api_client.py`)
- HTTP API client → Logging: logs requests (evidence: `src/fabric_cli/client/fab_api_client.py`)
- Filesystem commands → Terminal output: prints results (evidence: `src/fabric_cli/commands/fs/fab_fs.py`)
- CLI entry → Configuration: loads settings (evidence: `src/fabric_cli/main.py`)
