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.
When isolated telemetry is enabled, 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.
Isolated telemetry (opt-in)
Set FNTK_TELEMETRY_RUNTIME=isolated before starting FNTK to move remote
telemetry and local file persistence into a private, low-priority worker process.
The rollout default is off while platform and performance gates are outstanding.
off disables both telemetry sinks, not console output or CLI JSON responses.
FNTK_TELEMETRY_DISABLED=1 disables only remote telemetry in isolated mode.
Capture never synchronously falls back to HTTP, authentication, file writes, or waiting for a telemetry queue. Full/busy mailboxes reject the current event. The worker is not the Notebook daemon and does not restart or replay data after failure. Local logs and metrics are best-effort and eventually consistent. Explicit process shutdown has one total three-second telemetry budget.
Embedded callers must call notebook_cli.telemetry.initialize_runtime() before
constructing clients and shutdown_runtime() on exit. Preserve the original
route handle with telemetry.operation_scope(handle) across threads or asynchronous
operations; caller attribution is not authorization.
Use fntk telemetry status --json to inspect the running Notebook daemon's cached
telemetry snapshot without starting a daemon. If unavailable, it reports only the
current CLI runtime's status. Check snapshot age and unknown outcomes rather than
treating missing telemetry as zero failures.
Metadata
Release files for fabric-notebook-toolkit 0.0.1a7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fabric_notebook_toolkit-0.0.1a7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / fabric_notebook_toolkit-0.0.1a7-py3-none-any.whl
| Download URL | fabric_notebook_toolkit-0.0.1a7-py3-none-any.whl |
|---|---|
| Size | 300.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f72103c1e5be7bfcdf81c2de7d83d04e217af8ce4977092771d7c658b9e3b2a6
|
|
BLAKE2b-256 checksum How to use checksums |
4511a02d1d64333f7a18191734d324601f1e08a20aead841352b3afc60588272
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
RestSharp/106.13.0.0
|