Skip to content

Commit bf02390

Browse files
authored
Merge branch 'main' into host-app-user-agent
2 parents ec9ee93 + cde8838 commit bf02390

File tree

878 files changed

+594824
-31710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

878 files changed

+594824
-31710
lines changed

.ai-assets/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# AI Assets for Microsoft Fabric CLI
2+
3+
This folder contains AI-related resources for agents working with the Fabric CLI.
4+
5+
## Folder Structure
6+
7+
| Folder | Purpose |
8+
|--------|---------|
9+
| `context/` | Background context and contributor instructions for different AI tools |
10+
| `modes/` | Custom agents (chat modes) for VS Code Copilot |
11+
| `prompts/` | Reusable prompt templates |
12+
| `skills/` | Task-specific skill definitions |
13+
14+
## Skills
15+
16+
| Skill | Location | Description |
17+
|-------|----------|-------------|
18+
| `fabric-cli-core` | `skills/fabric-cli-core/SKILL.md` | Core CLI operations, auth, paths, safety rules |
19+
| `fabric-cli-powerbi` | `skills/fabric-cli-powerbi/SKILL.md` | Power BI operations, semantic models, reports, refresh, DAX |
20+
21+
### Skill Scripts
22+
23+
Each skill includes automation scripts for common tasks:
24+
25+
| Skill | Scripts |
26+
|-------|---------|
27+
| `fabric-cli-core` | `health_check.py` |
28+
| `fabric-cli-powerbi` | `refresh_model.py`, `list_refresh_history.py`, `rebind_report.py` |
29+
30+
Scripts are located in each skill's `scripts/` folder. Run with `python scripts/<script>.py --help` for usage.
31+
32+
## Modes (Custom Agents)
33+
34+
Custom agents appear in the VS Code Copilot dropdown. See `modes/README.md` for setup.
35+
36+
| Mode | File | Deploy Location |
37+
|------|------|-----------------|
38+
| **Fab** | `modes/fab.agent.md` | `.github/agents/fab.agent.md` |
39+
40+
## Prompts
41+
42+
Reusable prompt templates for common Fabric CLI tasks. See `prompts/README.md` for details.
43+
44+
| Prompt | Description |
45+
|--------|-------------|
46+
| `create-workspace` | Create a new Microsoft Fabric workspace with configuration |
47+
48+
## Context Files
49+
50+
Context files provide project instructions for different AI coding assistants. See `context/README.md` for setup instructions.
51+
52+
| File | Target Tool | Deploy Location |
53+
|------|-------------|-----------------|
54+
| `context/copilot-instructions.md` | GitHub Copilot | `.github/copilot-instructions.md` |
55+
| `context/CLAUDE.md` | Claude Code | `CLAUDE.md` or `.claude/CLAUDE.md` |
56+
| `context/cursorrules.md` | Cursor | `.cursorrules` (no extension) |

.ai-assets/context/CLAUDE.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# CLAUDE.md — Microsoft Fabric CLI
2+
3+
Context for Claude Code helping users work with the Fabric CLI. Copy or symlink to `CLAUDE.md` or `.claude/CLAUDE.md`.
4+
5+
## What is Fabric CLI?
6+
7+
**Fabric CLI** (`fab`) is a command-line tool for **Microsoft Fabric** with interactive (REPL) and command-line modes.
8+
9+
- **Install**: `pip install ms-fabric-cli`
10+
- **Python**: 3.10, 3.11, 3.12, 3.13
11+
- **Platforms**: Windows, Linux, macOS
12+
13+
## Core Design Pattern
14+
15+
Filesystem-like hierarchy with dot entity suffixes:
16+
17+
```
18+
/Workspace1.Workspace/Notebook1.Notebook
19+
/Workspace1.Workspace/FolderA.Folder/SemanticModel1.SemanticModel
20+
/Prod.Workspace/Lakehouse1.Lakehouse/Tables/customers
21+
```
22+
23+
## Hierarchy Structure
24+
25+
- **Tenant** → top-level container
26+
- **Workspace** → personal or team workspace
27+
- **Folder** → organizes items (up to ~10 levels)
28+
- **Item** → individual resource (Notebook, SemanticModel, Lakehouse, etc.)
29+
- **OneLakeItem** → storage within Lakehouse (Tables, Files)
30+
31+
## Modes
32+
33+
- **Interactive mode**: REPL environment, commands without `fab` prefix
34+
- **Command-line mode**: Single command execution, best for scripts
35+
36+
Switch: `fab config set mode interactive` or `fab config set mode cli`
37+
38+
## Common Commands
39+
40+
```bash
41+
# Authentication
42+
fab auth login # Interactive login
43+
fab auth status # Check auth status
44+
45+
# Navigation
46+
fab ls # List items in current location
47+
fab ls -a # Include hidden entities
48+
fab cd /Workspace1.Workspace # Change directory
49+
50+
# Item operations
51+
fab get MyNotebook.Notebook # Get item details
52+
fab cp source.Notebook dest.Notebook # Copy item
53+
fab rm OldItem.Report # Delete item
54+
55+
# Workspace operations
56+
fab ls / # List all workspaces
57+
fab mkdir /NewWorkspace.Workspace # Create workspace
58+
```
59+
60+
## Authentication
61+
62+
1. **Interactive user**: `fab auth login` (browser/WAM)
63+
2. **Service principal (secret)**:
64+
```bash
65+
export FAB_SPN_TENANT_ID="<tenant>"
66+
export FAB_SPN_CLIENT_ID="<client>"
67+
export FAB_SPN_CLIENT_SECRET="<secret>"
68+
fab auth login --service-principal
69+
```
70+
3. **Federated credential**: `FAB_SPN_FEDERATED_TOKEN` environment variable
71+
4. **Managed identity**: For Azure-hosted workloads
72+
73+
## Hidden Entities
74+
75+
Dot-prefixed, not shown by default. Use `ls -a` to view.
76+
77+
- **Tenant-level**: `.capacities`, `.gateways`, `.connections`, `.domains`
78+
- **Workspace-level**: `.managedidentities`, `.sparkpools`, `.externaldatashares`
79+
80+
## Common Item Types
81+
82+
| Suffix | Type |
83+
|--------|------|
84+
| `.Workspace` | Workspace |
85+
| `.Folder` | Folder |
86+
| `.Notebook` | Notebook |
87+
| `.SemanticModel` | Power BI dataset |
88+
| `.Report` | Power BI report |
89+
| `.Lakehouse` | Lakehouse |
90+
| `.DataPipeline` | Data pipeline |
91+
| `.Warehouse` | Data warehouse |
92+
| `.Eventhouse` | Eventhouse (real-time) |
93+
| `.KQLDatabase` | KQL Database |
94+
95+
## File Storage Locations
96+
97+
Config files in `~/.config/fab/`:
98+
- `cache.bin` - encrypted token cache
99+
- `config.json` - CLI settings
100+
- `auth.json` - auth info (non-sensitive)
101+
102+
Debug logs:
103+
- **Windows**: `%AppData%/fabcli_debug.log`
104+
- **macOS**: `~/Library/Logs/fabcli_debug.log`
105+
- **Linux**: `~/.local/state/fabcli_debug.log`
106+
107+
## Best Practices
108+
109+
1. Always verify paths before destructive operations
110+
2. Use `--dry-run` when available for preview
111+
3. Check auth status with `fab auth status` if commands fail
112+
4. Use relative paths when working within a workspace
113+
5. Prefer `fab get --output json` for scripting
114+
115+
## Getting Help
116+
117+
```bash
118+
fab --help # General help
119+
fab <command> --help # Command-specific help
120+
fab docs # Open documentation
121+
```

.ai-assets/context/README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Context Files
2+
3+
This folder contains context/instruction files for different AI coding assistants. Each file provides the same core project information, formatted for the specific tool.
4+
5+
## Available Files
6+
7+
| File | Target Tool | Usage |
8+
|------|-------------|-------|
9+
| `copilot-instructions.md` | GitHub Copilot | Copy to `.github/copilot-instructions.md` |
10+
| `CLAUDE.md` | Claude Code | Copy to repo root as `CLAUDE.md` or `.claude/CLAUDE.md` |
11+
| `cursorrules.md` | Cursor | Copy content to `.cursorrules` in repo root (no extension) |
12+
13+
## Setup Instructions
14+
15+
### GitHub Copilot
16+
17+
```bash
18+
# From repo root
19+
cp .ai-assets/context/copilot-instructions.md .github/copilot-instructions.md
20+
```
21+
22+
Copilot automatically loads `.github/copilot-instructions.md` for all chat and code generation requests.
23+
24+
### Claude Code
25+
26+
```bash
27+
# From repo root
28+
cp .ai-assets/context/CLAUDE.md ./CLAUDE.md
29+
# Or use .claude directory
30+
mkdir -p .claude && cp .ai-assets/context/CLAUDE.md .claude/CLAUDE.md
31+
```
32+
33+
Claude Code automatically loads `CLAUDE.md` at session start.
34+
35+
### Cursor
36+
37+
```bash
38+
# From repo root - note: no file extension
39+
cp .ai-assets/context/cursorrules.md .cursorrules
40+
```
41+
42+
Cursor automatically loads `.cursorrules` for all AI interactions.
43+
44+
## Content Differences
45+
46+
All files contain the same core information about:
47+
- Project overview and design patterns
48+
- Code structure and layout
49+
- Build/test commands
50+
- Error handling patterns
51+
- Code standards and security rules
52+
53+
The main differences are:
54+
- **Copilot**: Full detailed instructions optimized for chat and code review
55+
- **Claude Code**: Concise format optimized for Claude's memory system (first 200 lines loaded)
56+
- **Cursor**: Compact rules format for Cursor's context window
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# GitHub Copilot Instructions - Microsoft Fabric CLI
2+
3+
Context for GitHub Copilot helping users work with the Fabric CLI. Copy or symlink to `.github/copilot-instructions.md`.
4+
5+
---
6+
7+
## What is Fabric CLI?
8+
9+
**Fabric CLI** (`fab`) is a command-line tool for **Microsoft Fabric** with interactive (REPL) and command-line modes.
10+
11+
- **Install**: `pip install ms-fabric-cli`
12+
- **Python**: 3.10, 3.11, 3.12, 3.13
13+
- **Platforms**: Windows, Linux, macOS
14+
- **Shells**: PowerShell, Bash, Zsh, cmd
15+
16+
---
17+
18+
## Core Design Pattern
19+
20+
The CLI models Fabric as a **filesystem-like hierarchy** with **dot entity suffixes**:
21+
22+
```
23+
/Workspace1.Workspace/Notebook1.Notebook
24+
/Workspace1.Workspace/FolderA.Folder/SemanticModel1.SemanticModel
25+
/Prod.Workspace/Lakehouse1.Lakehouse/Tables/customers
26+
```
27+
28+
---
29+
30+
## Hierarchy Structure
31+
32+
- **Tenant** → top-level container
33+
- **Workspace** → personal or team workspace
34+
- **Folder** → organizes items (up to ~10 levels)
35+
- **Item** → individual resource (Notebook, SemanticModel, Lakehouse, etc.)
36+
- **OneLakeItem** → storage within Lakehouse (Tables, Files)
37+
38+
---
39+
40+
## Modes
41+
42+
- **Interactive mode**: REPL environment, commands without `fab` prefix
43+
- **Command-line mode**: Single command execution, best for scripts
44+
45+
Switch modes with `fab config set mode interactive` or `fab config set mode cli`.
46+
47+
---
48+
49+
## Common Commands
50+
51+
```bash
52+
# Authentication
53+
fab auth login # Interactive login
54+
fab auth status # Check auth status
55+
56+
# Navigation
57+
fab ls # List items in current location
58+
fab ls -a # Include hidden entities
59+
fab cd /Workspace1.Workspace # Change directory
60+
61+
# Item operations
62+
fab get MyNotebook.Notebook # Get item details
63+
fab cp source.Notebook dest.Notebook # Copy item
64+
fab rm OldItem.Report # Delete item
65+
66+
# Workspace operations
67+
fab ls / # List all workspaces
68+
fab mkdir /NewWorkspace.Workspace # Create workspace
69+
```
70+
71+
---
72+
73+
## Authentication
74+
75+
Supported patterns:
76+
77+
1. **Interactive user**: `fab auth login` (browser/WAM)
78+
2. **Service principal (secret)**:
79+
```bash
80+
export FAB_SPN_TENANT_ID="<tenant>"
81+
export FAB_SPN_CLIENT_ID="<client>"
82+
export FAB_SPN_CLIENT_SECRET="<secret>"
83+
fab auth login --service-principal
84+
```
85+
3. **Federated credential**: `FAB_SPN_FEDERATED_TOKEN` environment variable
86+
4. **Managed identity**: For Azure-hosted workloads
87+
88+
---
89+
90+
## Hidden Entities
91+
92+
Dot-prefixed entities not shown by default. Use `ls -a` to view.
93+
94+
- **Tenant-level**: `.capacities`, `.gateways`, `.connections`, `.domains`
95+
- **Workspace-level**: `.managedidentities`, `.sparkpools`, `.externaldatashares`
96+
97+
```bash
98+
fab ls .capacities
99+
fab ls ws1.Workspace/.sparkpools
100+
```
101+
102+
---
103+
104+
## Common Item Types
105+
106+
| Suffix | Type |
107+
|--------|------|
108+
| `.Workspace` | Workspace |
109+
| `.Folder` | Folder |
110+
| `.Notebook` | Notebook |
111+
| `.SemanticModel` | Power BI dataset |
112+
| `.Report` | Power BI report |
113+
| `.Lakehouse` | Lakehouse |
114+
| `.DataPipeline` | Data pipeline |
115+
| `.Warehouse` | Data warehouse |
116+
| `.Eventhouse` | Eventhouse (real-time) |
117+
| `.KQLDatabase` | KQL Database |
118+
119+
---
120+
121+
## File Storage Locations
122+
123+
Config files in `~/.config/fab/`:
124+
- `cache.bin` - encrypted token cache
125+
- `config.json` - CLI settings
126+
- `auth.json` - auth info (non-sensitive)
127+
128+
Debug logs:
129+
- **Windows**: `%AppData%/fabcli_debug.log`
130+
- **macOS**: `~/Library/Logs/fabcli_debug.log`
131+
- **Linux**: `~/.local/state/fabcli_debug.log`
132+
133+
---
134+
135+
## Best Practices
136+
137+
1. **Always verify paths** before destructive operations
138+
2. **Use `--dry-run`** when available for preview
139+
3. **Check auth status** with `fab auth status` if commands fail
140+
4. **Use relative paths** when working within a workspace
141+
5. **Prefer `fab get --output json`** for scripting
142+
143+
---
144+
145+
## Getting Help
146+
147+
```bash
148+
fab --help # General help
149+
fab <command> --help # Command-specific help
150+
fab docs # Open documentation
151+
```

0 commit comments

Comments
 (0)