Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .ai-assets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AI Assets for Microsoft Fabric CLI

This folder contains AI-related resources for agents working with the Fabric CLI.

## Folder Structure

| Folder | Purpose |
|--------|---------|
| `context/` | Background context and contributor instructions for different AI tools |
| `modes/` | Custom agents (chat modes) for VS Code Copilot |
| `prompts/` | Reusable prompt templates |
| `skills/` | Task-specific skill definitions |

## Skills

| Skill | Location | Description |
|-------|----------|-------------|
| `fabric-cli-core` | `skills/fabric-cli-core/SKILL.md` | Core CLI operations, auth, paths, safety rules |
| `fabric-cli-powerbi` | `skills/fabric-cli-powerbi/SKILL.md` | Power BI operations, semantic models, reports, refresh, DAX |

### Skill Scripts

Each skill includes automation scripts for common tasks:

| Skill | Scripts |
|-------|---------|
| `fabric-cli-core` | `health_check.py` |
| `fabric-cli-powerbi` | `refresh_model.py`, `list_refresh_history.py`, `rebind_report.py` |

Scripts are located in each skill's `scripts/` folder. Run with `python scripts/<script>.py --help` for usage.

## Modes (Custom Agents)

Custom agents appear in the VS Code Copilot dropdown. See `modes/README.md` for setup.

| Mode | File | Deploy Location |
|------|------|-----------------|
| **Fab** | `modes/fab.agent.md` | `.github/agents/fab.agent.md` |

## Prompts

Reusable prompt templates for common Fabric CLI tasks. See `prompts/README.md` for details.

| Prompt | Description |
|--------|-------------|
| `create-workspace` | Create a new Microsoft Fabric workspace with configuration |

## Context Files

Context files provide project instructions for different AI coding assistants. See `context/README.md` for setup instructions.

| File | Target Tool | Deploy Location |
|------|-------------|-----------------|
| `context/copilot-instructions.md` | GitHub Copilot | `.github/copilot-instructions.md` |
| `context/CLAUDE.md` | Claude Code | `CLAUDE.md` or `.claude/CLAUDE.md` |
| `context/cursorrules.md` | Cursor | `.cursorrules` (no extension) |
121 changes: 121 additions & 0 deletions .ai-assets/context/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# CLAUDE.md — Microsoft Fabric CLI

Context for Claude Code helping users work with the Fabric CLI. Copy or symlink to `CLAUDE.md` or `.claude/CLAUDE.md`.

## What is Fabric CLI?

**Fabric CLI** (`fab`) is a command-line tool for **Microsoft Fabric** with interactive (REPL) and command-line modes.

- **Install**: `pip install ms-fabric-cli`
- **Python**: 3.10, 3.11, 3.12, 3.13
- **Platforms**: Windows, Linux, macOS

## Core Design Pattern

Filesystem-like hierarchy with dot entity suffixes:

```
/Workspace1.Workspace/Notebook1.Notebook
/Workspace1.Workspace/FolderA.Folder/SemanticModel1.SemanticModel
/Prod.Workspace/Lakehouse1.Lakehouse/Tables/customers
```

## Hierarchy Structure

- **Tenant** → top-level container
- **Workspace** → personal or team workspace
- **Folder** → organizes items (up to ~10 levels)
- **Item** → individual resource (Notebook, SemanticModel, Lakehouse, etc.)
- **OneLakeItem** → storage within Lakehouse (Tables, Files)

## Modes

- **Interactive mode**: REPL environment, commands without `fab` prefix
- **Command-line mode**: Single command execution, best for scripts

Switch: `fab config set mode interactive` or `fab config set mode cli`

## Common Commands

```bash
# Authentication
fab auth login # Interactive login
fab auth status # Check auth status

# Navigation
fab ls # List items in current location
fab ls -a # Include hidden entities
fab cd /Workspace1.Workspace # Change directory

# Item operations
fab get MyNotebook.Notebook # Get item details
fab cp source.Notebook dest.Notebook # Copy item
fab rm OldItem.Report # Delete item

# Workspace operations
fab ls / # List all workspaces
fab mkdir /NewWorkspace.Workspace # Create workspace
```

## Authentication

1. **Interactive user**: `fab auth login` (browser/WAM)
2. **Service principal (secret)**:
```bash
export FAB_SPN_TENANT_ID="<tenant>"
export FAB_SPN_CLIENT_ID="<client>"
export FAB_SPN_CLIENT_SECRET="<secret>"
fab auth login --service-principal
```
3. **Federated credential**: `FAB_SPN_FEDERATED_TOKEN` environment variable
4. **Managed identity**: For Azure-hosted workloads

## Hidden Entities

Dot-prefixed, not shown by default. Use `ls -a` to view.

- **Tenant-level**: `.capacities`, `.gateways`, `.connections`, `.domains`
- **Workspace-level**: `.managedidentities`, `.sparkpools`, `.externaldatashares`

## Common Item Types

| Suffix | Type |
|--------|------|
| `.Workspace` | Workspace |
| `.Folder` | Folder |
| `.Notebook` | Notebook |
| `.SemanticModel` | Power BI dataset |
| `.Report` | Power BI report |
| `.Lakehouse` | Lakehouse |
| `.DataPipeline` | Data pipeline |
| `.Warehouse` | Data warehouse |
| `.Eventhouse` | Eventhouse (real-time) |
| `.KQLDatabase` | KQL Database |

## File Storage Locations

Config files in `~/.config/fab/`:
- `cache.bin` - encrypted token cache
- `config.json` - CLI settings
- `auth.json` - auth info (non-sensitive)

Debug logs:
- **Windows**: `%AppData%/fabcli_debug.log`
- **macOS**: `~/Library/Logs/fabcli_debug.log`
- **Linux**: `~/.local/state/fabcli_debug.log`

## Best Practices

1. Always verify paths before destructive operations
2. Use `--dry-run` when available for preview
3. Check auth status with `fab auth status` if commands fail
4. Use relative paths when working within a workspace
5. Prefer `fab get --output json` for scripting

## Getting Help

```bash
fab --help # General help
fab <command> --help # Command-specific help
fab docs # Open documentation
```
56 changes: 56 additions & 0 deletions .ai-assets/context/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Context Files

This folder contains context/instruction files for different AI coding assistants. Each file provides the same core project information, formatted for the specific tool.

## Available Files

| File | Target Tool | Usage |
|------|-------------|-------|
| `copilot-instructions.md` | GitHub Copilot | Copy to `.github/copilot-instructions.md` |
| `CLAUDE.md` | Claude Code | Copy to repo root as `CLAUDE.md` or `.claude/CLAUDE.md` |
| `cursorrules.md` | Cursor | Copy content to `.cursorrules` in repo root (no extension) |

## Setup Instructions

### GitHub Copilot

```bash
# From repo root
cp .ai-assets/context/copilot-instructions.md .github/copilot-instructions.md
```

Copilot automatically loads `.github/copilot-instructions.md` for all chat and code generation requests.

### Claude Code

```bash
# From repo root
cp .ai-assets/context/CLAUDE.md ./CLAUDE.md
# Or use .claude directory
mkdir -p .claude && cp .ai-assets/context/CLAUDE.md .claude/CLAUDE.md
```

Claude Code automatically loads `CLAUDE.md` at session start.

### Cursor

```bash
# From repo root - note: no file extension
cp .ai-assets/context/cursorrules.md .cursorrules
```

Cursor automatically loads `.cursorrules` for all AI interactions.

## Content Differences

All files contain the same core information about:
- Project overview and design patterns
- Code structure and layout
- Build/test commands
- Error handling patterns
- Code standards and security rules

The main differences are:
- **Copilot**: Full detailed instructions optimized for chat and code review
- **Claude Code**: Concise format optimized for Claude's memory system (first 200 lines loaded)
- **Cursor**: Compact rules format for Cursor's context window
151 changes: 151 additions & 0 deletions .ai-assets/context/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# GitHub Copilot Instructions - Microsoft Fabric CLI

Context for GitHub Copilot helping users work with the Fabric CLI. Copy or symlink to `.github/copilot-instructions.md`.

---

## What is Fabric CLI?

**Fabric CLI** (`fab`) is a command-line tool for **Microsoft Fabric** with interactive (REPL) and command-line modes.

- **Install**: `pip install ms-fabric-cli`
- **Python**: 3.10, 3.11, 3.12, 3.13
- **Platforms**: Windows, Linux, macOS
- **Shells**: PowerShell, Bash, Zsh, cmd

---

## Core Design Pattern

The CLI models Fabric as a **filesystem-like hierarchy** with **dot entity suffixes**:

```
/Workspace1.Workspace/Notebook1.Notebook
/Workspace1.Workspace/FolderA.Folder/SemanticModel1.SemanticModel
/Prod.Workspace/Lakehouse1.Lakehouse/Tables/customers
```

---

## Hierarchy Structure

- **Tenant** → top-level container
- **Workspace** → personal or team workspace
- **Folder** → organizes items (up to ~10 levels)
- **Item** → individual resource (Notebook, SemanticModel, Lakehouse, etc.)
- **OneLakeItem** → storage within Lakehouse (Tables, Files)

---

## Modes

- **Interactive mode**: REPL environment, commands without `fab` prefix
- **Command-line mode**: Single command execution, best for scripts

Switch modes with `fab config set mode interactive` or `fab config set mode cli`.

---

## Common Commands

```bash
# Authentication
fab auth login # Interactive login
fab auth status # Check auth status

# Navigation
fab ls # List items in current location
fab ls -a # Include hidden entities
fab cd /Workspace1.Workspace # Change directory

# Item operations
fab get MyNotebook.Notebook # Get item details
fab cp source.Notebook dest.Notebook # Copy item
fab rm OldItem.Report # Delete item

# Workspace operations
fab ls / # List all workspaces
fab mkdir /NewWorkspace.Workspace # Create workspace
```

---

## Authentication

Supported patterns:

1. **Interactive user**: `fab auth login` (browser/WAM)
2. **Service principal (secret)**:
```bash
export FAB_SPN_TENANT_ID="<tenant>"
export FAB_SPN_CLIENT_ID="<client>"
export FAB_SPN_CLIENT_SECRET="<secret>"
fab auth login --service-principal
```
3. **Federated credential**: `FAB_SPN_FEDERATED_TOKEN` environment variable
4. **Managed identity**: For Azure-hosted workloads

---

## Hidden Entities

Dot-prefixed entities not shown by default. Use `ls -a` to view.

- **Tenant-level**: `.capacities`, `.gateways`, `.connections`, `.domains`
- **Workspace-level**: `.managedidentities`, `.sparkpools`, `.externaldatashares`

```bash
fab ls .capacities
fab ls ws1.Workspace/.sparkpools
```

---

## Common Item Types

| Suffix | Type |
|--------|------|
| `.Workspace` | Workspace |
| `.Folder` | Folder |
| `.Notebook` | Notebook |
| `.SemanticModel` | Power BI dataset |
| `.Report` | Power BI report |
| `.Lakehouse` | Lakehouse |
| `.DataPipeline` | Data pipeline |
| `.Warehouse` | Data warehouse |
| `.Eventhouse` | Eventhouse (real-time) |
| `.KQLDatabase` | KQL Database |

---

## File Storage Locations

Config files in `~/.config/fab/`:
- `cache.bin` - encrypted token cache
- `config.json` - CLI settings
- `auth.json` - auth info (non-sensitive)

Debug logs:
- **Windows**: `%AppData%/fabcli_debug.log`
- **macOS**: `~/Library/Logs/fabcli_debug.log`
- **Linux**: `~/.local/state/fabcli_debug.log`

---

## Best Practices

1. **Always verify paths** before destructive operations
2. **Use `--dry-run`** when available for preview
3. **Check auth status** with `fab auth status` if commands fail
4. **Use relative paths** when working within a workspace
5. **Prefer `fab get --output json`** for scripting

---

## Getting Help

```bash
fab --help # General help
fab <command> --help # Command-specific help
fab docs # Open documentation
```
Loading