datalore-notebook
Skill1 starsChanged 6 months agoMITView on GitHub
Work with Datalore notebooks through the bundled CLI. Read, write, and execute notebook cells to perform data analysis, build visualizations, query databases, and manage notebook files. Use when user shares a Datalore notebook URL, asks to "analyze data in Datalore", "run a notebook", "explore a dataset", "write SQL against attached databases", or "create notebook cells". Requires uv.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
Create/edit cells using stdin for multi-line source.
- Distinctive: line 94
Run, inspect, and recover.
- Very specific: line 135
No credentials or 401: Run /absolute/path/to/datalore-notebook/scripts/datalore init <notebook-url> from the task workspace.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Datalore Notebook Agent
Use the bundled scripts/datalore CLI for notebook work. It is a uv run --script CLI with pinned inline Python dependencies, wraps the public Notebook API, stores notebook identity in .datalore-session, and authenticates with DATALORE_API_TOKEN first, otherwise system keychain credentials saved per notebook path. When no valid credential is available, init starts OAuth PKCE browser login and saves the resulting notebook credentials.
Available scripts
scripts/datalore- CLI for Datalore notebook cells, files, databases, kernel, and worksheet operations. Run notebook commands through this script. For setup, run the absolute path toscripts/datalore init <notebook-url>from the task workspace so.datalore-sessionis created there. To remove local access for the current notebook, runscripts/datalore logout; to remove credentials for another notebook, runscripts/datalore logout <notebook-url>.
Setup
Initialize from the workspace where the agent will work on this notebook. The CLI writes .datalore-session to the current directory, so do not run init from the installed skill directory unless that is intentionally the session workspace.
# keychain-free setups; CLI will not read/write keychain when this is set
export DATALORE_API_TOKEN="<token>"
cd <task-workspace>
# Assuming the skill is installed in ~/.agents. Adjust the absolute path according to your setup.
~/.agents/skills/datalore-notebook/scripts/datalore init <notebook-url>If DATALORE_API_TOKEN is not set, init starts OAuth PKCE browser login and saves the resulting token in the keychain under the notebook path. Run init yourself from the task workspace and relay the printed browser URL if the browser does not open automatically. Do not ask the user to paste tokens into chat.
If a valid command fails for authentication, run init yourself FROM THE CURRENT DIRECTORY. Do not continue with token discovery. Ask the user to run init manually only if the CLI cannot start OAuth, the OAuth callback times out, keychain access fails, or the user needs to complete browser authorization outside the agent environment.
Put --json before the command for machine-readable responses. This applies to API commands that return structured data; file read and file download always stream raw file bytes to stdout, so do not use --json with them. Prefer the CLI over raw API calls; use references/api-reference.md only for schema details.
Workflow
- Orient first, treating authentication as a hard gate.
If no
.datalore-sessionexists or authentication fails, runinitFROM THE CURRENT DIRECTORY.initcan start OAuth PKCE browser login and prints an authorization URL before waiting for the callback, so do not stop just because the environment is non-interactive. Stop and ask the user to runinitmanually only after the automaticinitattempt fails in a way the agent cannot complete.
scripts/datalore cells --full
scripts/datalore --json cells --include-outputs- Discover data before coding. Do not guess file formats, table names, or columns.
scripts/datalore files --directory data/notebook_files
scripts/datalore databases
scripts/datalore db condensed <databaseId>
scripts/datalore db schema <databaseId> --depth 1
scripts/datalore db search <databaseId> <query>- Create/edit cells using stdin for multi-line source.
scripts/datalore cell create --type CODE --after <cell-id> --wait << 'EOF'
print("hello")
EOF
scripts/datalore cell edit <cell-id> --wait << 'EOF'
print("updated")
EOFFor SQL cells:
scripts/datalore cell create --type SQL --database-id <databaseId> --variable result_df --wait << 'EOF'
select *
from public.orders
limit 10
EOFFor markdown:
scripts/datalore cell create --type MARKDOWN --before <first-cell-id> << 'EOF'
# Analysis
EOF- Run, inspect, and recover.
scripts/datalore cell run <cell-id> --wait
scripts/datalore cell outputs <cell-id>
scripts/datalore kernel status
scripts/datalore kernel interruptTreat VALID and WARNING as success. For ERROR, inspect traceback/stdout/stderr, fix, and rerun. For TIMEOUT, the cell may still be running; use --wait for single-cell commands when you need longer polling, and for cells run inspect outputs or interrupt before continuing. In non-obvious cases, when using --json for commands that execute cells, check the returned execution status rather than relying only on process exit code. After errors, assume kernel state may be partially mutated.
- Clean up before finishing. Only delete cells or files created during the current task.
scripts/datalore cells --full
scripts/datalore cell delete <cell-id>
scripts/datalore file delete <path>Commands
scripts/datalore --json <command> ...
scripts/datalore logout [notebook-url]
scripts/datalore cell get <cell-id>
scripts/datalore cells run <cell-id>...
scripts/datalore files --directory data/notebook_files
scripts/datalore file text <path> --max-lines 20
scripts/datalore file read <path> # raw bytes; no --json
scripts/datalore file upload <local-path> --directory data/notebook_files
scripts/datalore cell create --type CONTROL --control-json '{"controlType":"TEXT_INPUT","label":"Name","variable":"name","value":"Alice","multiline":false}' --wait
scripts/datalore cell update-control <cell-id> --control-json '{"controlType":"TEXT_INPUT","label":"Name","variable":"name","value":"Bob","multiline":false}' --wait
scripts/datalore worksheet create --name "Analysis"worksheet create is persistent; use it only when a new tab is intended.
CONTROL cells are executable in single-cell commands (cell create --type CONTROL --wait, cell run, and cell update-control --wait) because running them assigns the configured value to the kernel variable. Batch cells run is limited to CODE and SQL cells.
Troubleshooting
- No credentials or 401: Run
/absolute/path/to/datalore-notebook/scripts/datalore init <notebook-url>from the task workspace. If OAuth PKCE prints an authorization URL, relay it to the user. Ask the user to run the command manually only if the agent-runinitcannot complete. - Empty/unhelpful output: retry with
--jsonor--verbose. - File endpoints fail before computation starts: run
scripts/datalore cell create --type CODE --wait --source "print('ready')"and retry. - Insert at top: use
--before <first-cell-id>. Omitting--before/--afterappends.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

