Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Fabric Notebook Toolkit (fntk)

Agent Runtime Interface for Microsoft Fabric Notebooks — session management, code execution, Spark monitoring, all via CLI with structured JSON output.

Install

# Install the public alpha release
pip install fabric-notebook-toolkit

Quick Start

# Authenticate
fab auth login

# Discover resources
fntk discover whoami --json
fntk discover list-workspaces --json
fntk discover list-notebooks --workspace-id <WS_ID> --json

# Start session + execute code
fntk notebook start-session --workspace-id <WS_ID> --artifact-id <ART_ID> --json
fntk code run --workspace-id <WS_ID> --artifact-id <ART_ID> --code "print('hello')" --json

# Monitor Spark
fntk monitor list-apps --workspace-id <WS_ID> --artifact-id <ART_ID> --livy-id <LID> --json
fntk monitor get-diagnostic --workspace-id <WS_ID> --artifact-id <ART_ID> --app-id <APP> --json

# Download logs
fntk logs get-driver --workspace-id <WS_ID> --artifact-id <ART_ID> --livy-id <LID> --app-id <APP> --json

CLI Commands

fntk help              # Human-readable overview
fntk help --json       # Machine-readable manifest (for agents)
Domain Commands Description
discover whoami, list-workspaces, list-notebooks, list-lakehouses, get-capacity, spark-settings Resource discovery
notebook create, delete, start-session, get-session, list-sessions, delete-session, restart-kernel, interrupt-kernel, set-lakehouse, get-lakehouse, list-livy-sessions Notebook + session lifecycle
code run, get-result, cancel, cancel-all, ping Code execution
cell list, get, update, append, insert, delete, get-output, set-language, set-parameter Cell CRUD
monitor list-apps, get-diagnostic, get-stages, get-progress, get-executors, get-environment, get-sql, get-resources, get-advice, ... Spark monitoring
logs get-driver, get-executor, list-executors, get-livy, get-cell Log download
resource list, get, put, mkdir, delete, usage Resource folder files
server start, stop, status Local daemon management
init [path] Bootstrap repo agent instructions for Fabric workspaces
skill list, get Inspect built-in skill content

Output Format

All commands with --json return a stable envelope:

{
  "status": "success",
  "stage": "completed",
  "progress": 1.0,
  "message": "Found 14 notebooks",
  "data": { ... },
  "next_actions": [
    {
      "type": "once",
      "command": "fntk notebook start-session --workspace-id <WS> --artifact-id <ART> --json",
      "description": "Start a session on a notebook"
    }
  ],
  "plan_hints": ["Start a session", "Execute code"],
  "logs": [],
  "context": {"workspace_id": "..."},
  "error": null,
  "trace_id": "fntk-a1b2c3d4e5f6",
  "elapsed_ms": 234
}

next_actions Types

Type Description Fields
once Execute exactly once command, description
poll Retry until condition met command, retry_after, max_retries, stop_condition
conditional Execute if condition met command, stop_condition

Feature Flags

Config file: ~/.fntk/config.json

Flag Default Description
log_level info Logging verbosity
server_port 19876 Daemon port

Auth

fab auth login     # Preferred (Fabric CLI MSAL cache)
az login           # Fallback

Local Daemon (optional)

For long-running WebSocket connections and async execution:

fntk server start --json     # Start daemon on 127.0.0.1:19876
fntk server status --json    # Check status
fntk server stop --json      # Stop daemon

The daemon uses per-user auth nonce (~/.fntk/server.<port>.auth), bound to localhost only. Request tokens are forwarded on every session/code call. If a request token is supplied, it is authoritative: invalid or external tokens never fall back to the daemon's local identity. Managed sessions are bound to the authenticated principal; a mismatch closes the local WebSocket and returns SESSION_CONTEXT_MISMATCH.

Agent Skill Init

fntk init installs the bundled fabric-notebook-workflow skill and configures the external Fabric Skills plugin for selected agent hosts. The bundled workflow skill uses project scope under the current directory by default; pass --global to install it in the user's home directory.

Local Git repository discovery, Fabric workspace scanning, workspace lookup, and agent instruction generation are temporarily unavailable from fntk init. When the selected host already has the global fabric-skills plugin, init reports it as found and does not register a marketplace or run a plugin installation. If a selected host CLI cannot be found, init completes its other stages and reports an actionable Fabric Skills warning in both text and JSON output.

In an interactive run, init installs the bundled fabric-notebook-workflow skill first and lets you choose project or global scope. It then configures Fabric Skills for each selected host that does not already have it: Copilot and Codex offer global installation or skip; Claude Code offers project, global, or skip. Non-interactive runs preserve the default installation behavior.

# Install skills for GitHub Copilot CLI in the current project
fntk init

# Non-interactive JSON mode with all enabled agent targets
fntk init --agent copilot codex claude -y --json

# Install the bundled workflow skill globally
fntk init --global -y

# Refresh previously installed skills/plugins
fntk init --update-skills -y

Flags:

Flag Default Description
--agent NAME [NAME ...] GitHub Copilot CLI Agent hosts to configure; enabled values are copilot codex claude
-g, --global off Install the bundled workflow skill user-globally instead of in the current project
-y, --yes off Skip interactive prompts; use defaults
--skip-fntk-skill off Do not install the bundled fabric-notebook-workflow skill
--skip-fabric-skills off Do not install the external fabric-skills plugin
--update-skills off Refresh previously installed bundled skills and Fabric Skills plugins
--output {text,json} text Output format; JSON mode also skips prompts
--json off Shorthand for --output json

Interactive terminal output uses color for headings, success, warnings, and errors. Set NO_COLOR=1 (or use redirected/JSON output) for plain text.

Upgrade flow: after installing a newer fntk, run fntk init --update-skills -y to refresh installed workflow skills and Fabric Skills plugins.

Each invocation emits one aggregate init.summary metric with selected agent types, skill/plugin outcomes, completed stage, and error code. It does not include project paths, prompt input, or free-form error messages.

Bundled skill content remains inspectable with fntk skill list and fntk skill get <skill-id>.

For AI Agents

Agents can discover all capabilities via:

fntk help --json    # Returns full manifest: domains, commands, workflows, schemas

The manifest includes state machine definitions, output schema, and recommended workflows. See AGENTS.md for detailed agent integration guide.

Client attribution for integrations

Agent hosts should attach self-asserted caller metadata to each top-level FNTK invocation. fntk init generates the appropriate canonical client name for GitHub Copilot CLI, Claude Code, and Codex; terminal users do not configure it.

fntk code run ... --client-name github-copilot-cli --client-version 1.0.0

Operational commands accept --client-name, optional --client-version, --invocation-id UUIDv4, and --client-attribution {auto,explicit-only,off} at either the root or leaf position.

MCP hosts may declare connection metadata through initialize.params.clientInfo. A tools/call may override it using params._meta keys io.microsoft.fntk/client-name, io.microsoft.fntk/client-version, and io.microsoft.fntk/invocation-id.

Attribution is self-asserted telemetry metadata. Names are normalized to a fixed low-cardinality set, versions are bounded, and localhost caller headers are not forwarded to Fabric or WebSocket services. Disable attribution for one invocation with --client-attribution off.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fabric_notebook_toolkit-0.0.1a6-py3-none-any.whl (253.0 kB view details)

Uploaded Python 3

File details

Details for the file fabric_notebook_toolkit-0.0.1a6-py3-none-any.whl.

File metadata

File hashes

Hashes for fabric_notebook_toolkit-0.0.1a6-py3-none-any.whl
Algorithm Hash digest
SHA256 61602c98d309320fa89e6cb7a35482b0bacc7399ef978b4e957286b29e3f7bb6
MD5 0a44df2d5cd36eb3e9d231cdb11b6fe3
BLAKE2b-256 d10b030baaa0cf973fec5b07f46791d00dfa4d17e6fd797813666defab83c975

See more details on using hashes here.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page