Skip to content

shepsci/kaggle-skill / skills/kaggle

kaggle

Flagged

Unified Kaggle skill. Use when the user explicitly mentions Kaggle, kaggle.com, a Kaggle URL, Kaggle competitions, Kaggle datasets/models/notebooks, Kaggle forums/discussions/writeups, Kaggle benchmarks, hackathons hosted on Kaggle, Kaggle badges, or Kaggle account setup. Do not use for generic ML, GPU/TPU, notebook, dataset, benchmark, or data-science tasks unless the user clearly ties them to Kaggle.

FileKindSize
SKILL.mdskill md10.3 KB
modules/README.mdmarkdown2.3 KB
modules/badges/README.mdmarkdown1.6 KB
modules/badges/references/badge-catalog.mdmarkdown6.6 KB
modules/badges/scripts/badge_registry.pyscript8.5 KB
modules/badges/scripts/badge_tracker.pyscript4.1 KB
modules/badges/scripts/orchestrator.pyscript5.3 KB
modules/badges/scripts/phase_1_instant_api.pyscript24.0 KB
modules/badges/scripts/phase_2_competition.pyscript13.5 KB
modules/badges/scripts/phase_3_pipeline.pyscript11.7 KB
modules/badges/scripts/phase_4_browser.pyscript2.2 KB
modules/badges/scripts/phase_5_streaks.pyscript5.6 KB
modules/badges/scripts/templates/README_dataset.mdmarkdown573 B
modules/badges/scripts/templates/dataset-metadata.jsonconfig871 B
modules/badges/scripts/templates/kernel-metadata.jsonconfig412 B
modules/badges/scripts/templates/model-instance-metadata.jsonconfig253 B
modules/badges/scripts/templates/model-metadata.jsonconfig355 B
modules/badges/scripts/templates/python_notebook.ipynbother1.3 KB
modules/badges/scripts/templates/r_notebook.ipynbother1.1 KB
modules/badges/scripts/templates/submission_titanic.csvother2.8 KB
modules/badges/scripts/templates/utility_script.pyscript802 B
modules/badges/scripts/utils.pyscript3.9 KB
modules/benchmarks/README.mdmarkdown1.2 KB
modules/benchmarks/references/benchmark-endpoints.mdmarkdown1.6 KB
modules/benchmarks/references/benchmarks-cli.mdmarkdown4.4 KB
modules/competitions/README.mdmarkdown5.8 KB
modules/competitions/hackathons/README.mdmarkdown2.9 KB
modules/competitions/hackathons/references/episode-endpoints.mdmarkdown2.2 KB
modules/competitions/hackathons/references/hackathon-endpoints.mdmarkdown4.6 KB
modules/competitions/hackathons/scripts/fetch_writeup.pyexecutablescript10.5 KB
modules/competitions/hackathons/scripts/hackathon_overview.pyexecutablescript1.5 KB
modules/competitions/hackathons/scripts/list_writeups.pyexecutablescript9.9 KB
modules/competitions/references/competition-categories.mdmarkdown2.1 KB
modules/competitions/references/competition-operations.mdmarkdown5.7 KB
modules/competitions/references/competition-overview.mdmarkdown3.9 KB
modules/competitions/references/competition-research.mdmarkdown3.0 KB
modules/competitions/scripts/competition_brief.pyscript5.4 KB
modules/competitions/scripts/competition_details.pyscript8.2 KB
modules/competitions/scripts/competition_download.pyscript5.1 KB
modules/competitions/scripts/competition_episodes.pyscript9.2 KB
modules/competitions/scripts/competition_leaderboard.pyscript12.3 KB
modules/competitions/scripts/competition_ledger.pyscript3.3 KB
modules/competitions/scripts/competition_pages.pyexecutablescript1.7 KB
modules/competitions/scripts/competition_status.pyscript9.0 KB
modules/competitions/scripts/competition_submit.pyscript8.9 KB
modules/competitions/scripts/competition_validate.pyscript14.2 KB
modules/competitions/scripts/competition_watch.pyscript5.9 KB
modules/competitions/scripts/list_competitions.pyscript13.3 KB
modules/datasets/README.mdmarkdown2.1 KB
modules/datasets/references/kagglehub-datasets.mdmarkdown2.6 KB
modules/datasets/scripts/dataset_download.pyscript4.1 KB
modules/datasets/scripts/dataset_publish.pyscript5.5 KB
modules/discussions/README.mdmarkdown2.1 KB
modules/discussions/references/writeups.mdmarkdown5.8 KB
modules/discussions/scripts/forums.pyscript22.0 KB
modules/discussions/scripts/leaderboard_writeups.pyscript24.8 KB
modules/models/README.mdmarkdown2.6 KB
modules/models/references/kagglehub-models.mdmarkdown1.7 KB
modules/models/scripts/model_download.pyscript4.5 KB
modules/models/scripts/model_publish.pyscript8.7 KB
modules/notebooks/README.mdmarkdown2.6 KB
modules/notebooks/scripts/notebook_push.pyscript5.7 KB
modules/notebooks/scripts/notebook_run.pyscript2.8 KB
modules/notebooks/scripts/notebook_wait.pyscript3.7 KB
modules/references/README.mdmarkdown454 B
modules/references/cli-reference.mdmarkdown13.4 KB
modules/references/kaggle-knowledge.mdmarkdown7.6 KB
modules/references/mcp-reference.mdmarkdown18.9 KB
modules/setup/README.mdmarkdown3.0 KB
modules/setup/references/kaggle-setup.mdmarkdown6.7 KB
modules/setup/scripts/check_all_credentials.pyscript5.7 KB
modules/setup/scripts/doctor.pyscript10.2 KB
modules/setup/scripts/save_credentials.pyscript3.9 KB
scripts/kaggle_skill.pyscript11.5 KB
shared/__init__.pyscript0 B
shared/competition.pyscript20.0 KB
shared/credentials.pyscript9.6 KB
shared/hub.pyscript2.9 KB
shared/kaggle_cli.pyscript20.7 KB
shared/ledger.pyscript3.6 KB
shared/mcp_client.pyscript11.6 KB
shared/net.pyscript6.9 KB
shared/notebook.pyscript4.4 KB
shared/preflight.pyscript5.1 KB
shared/safe_extract.pyscript2.7 KB
shared/script.pyscript11.2 KB
shared/text.pyscript10.5 KB
shared/untrusted.pyscript7.6 KB

modules/setup/references/kaggle-setup.md

View on GitHub
# Kaggle Account and Credential Setup

How to create a Kaggle account, get a credential, and check that it works.
An API token serves the Kaggle CLI, `kagglehub`, and the MCP server. An OAuth
login serves the CLI and the MCP server, not `kagglehub`. A legacy key serves
the CLI and `kagglehub`, not the MCP server.

## 1. Create an account

1. Go to https://www.kaggle.com/account/login and choose **Register**, or
   sign in with Google.
2. Pick a username. It becomes your handle in every dataset, model, and
   notebook address.
3. Confirm your email from the message Kaggle sends.

### Phone verification

Kaggle asks for a phone number before it lets an account use GPU, TPU, or
internet access in notebooks. Do it at https://www.kaggle.com/settings under
**Phone Verification**. Some competitions also ask for identity verification
on the website before submissions or prizes. Neither step has an API.

## 2. Choose a credential

Public competitions pages, datasets, models, and notebooks can be read with no
credential. You need one for private data, submissions, publishing, and your
own account data.

| Credential | Good for | How to get it |
|---|---|---|
| OAuth login | Interactive use on your own machine | `kaggle auth login` |
| API token | Scripts, servers, MCP clients | **Generate New Token** at https://www.kaggle.com/settings |
| Legacy key | Old tools only | **Create Legacy API Key** at the same page |

### OAuth login

```bash
kaggle auth login
```

A browser opens, you approve, and the CLI stores the login in
`~/.kaggle/credentials.json`. Use `--no-launch-browser` on a machine without
one.

### API token

1. Go to https://www.kaggle.com/settings and find the **API** section.
2. Choose **Generate New Token**, name it, and copy the value. It starts with
   `KGAT_`.
3. Store it in a file only you can read. This form keeps the token out of your
   shell history: run it, paste the token, press Enter, then Ctrl-D.

```bash
mkdir -p ~/.kaggle && chmod 700 ~/.kaggle
(umask 077 && cat > ~/.kaggle/access_token)
```

Or export it from your shell profile:

```bash
export KAGGLE_API_TOKEN="paste-the-token-here"
```

Creating a new token does not cancel your other tokens. Make one per tool so
that you can revoke them one at a time.

### Legacy key

`kaggle.json` holds a username and a 32-character key for the older API.
Creating a new legacy key cancels the previous one.

```bash
mkdir -p ~/.kaggle && chmod 700 ~/.kaggle
mv ~/Downloads/kaggle.json ~/.kaggle/kaggle.json
chmod 600 ~/.kaggle/kaggle.json
```

### A `.env` file

The skill reads a `.env` file only when you name it, and only its
`KAGGLE_API_TOKEN`, `KAGGLE_USERNAME`, `KAGGLE_KEY`, `KAGGLE_CONFIG_DIR`, and
`KAGGLE_MCP_TOKEN` lines:

```bash
export KAGGLE_ENV_FILE="$HOME/.config/kaggle.env"
```

A `.env` in the working directory is not read. Keep such a file out of version
control and out of any folder you publish as a dataset or model.

## 3. Check the setup

```bash
python3 scripts/kaggle_skill.py doctor --verify
```

`doctor` reports the packages, the Kaggle CLI, the credential, and whether
Kaggle can be reached, and ends with what works now. For the credentials
alone:

```bash
python3 scripts/kaggle_skill.py credentials --verify
```

Sample output:

```
[OK] API token: found (from ~/.kaggle/access_token)
[OK] OAuth login: found (from ~/.kaggle/credentials.json, user: your_username)

The Kaggle CLI will try the API token from ~/.kaggle/access_token first.
[OK] Verified: Kaggle accepted the credential as your_username.
```

Without `--verify` the checker only lists what it finds. A credential that was
revoked still shows as found, so use `--verify` when something fails. The
checker never writes a file and never prints a credential. `--json` prints the
same report for a program to read.

To check by hand:

```bash
kaggle config view
kaggle quota
```

`kaggle config view` prints the account name. For a legacy key or an OAuth
login it does not contact Kaggle, so it also passes for a revoked key.
`kaggle quota` needs a signed-in account: it fails with "Authentication
required" when Kaggle no longer accepts the credential.

## 4. Order of use

When more than one credential is present, the Kaggle CLI uses the first that
works:

| Order | Source |
|---|---|
| 1 | `KAGGLE_API_TOKEN` (the token, or the path of a file that holds it) |
| 2 | `~/.kaggle/access_token` |
| 3 | `KAGGLE_USERNAME` + `KAGGLE_KEY` |
| 4 | `kaggle.json` in `KAGGLE_CONFIG_DIR` or `~/.kaggle` |
| 5 | OAuth login in `~/.kaggle/credentials.json` |

For the MCP server the skill's commands send `KAGGLE_MCP_TOKEN` if it is
set, then the API token, then the OAuth access token, and a legacy key last.
The server does not take a legacy key, so the commands that read your account
through it (`status`, `leaderboard`, `competitions`, `details`, `watch`,
`episodes`, `writeups`) need a token or a login.

## 5. Saving environment credentials to disk

```bash
python3 scripts/kaggle_skill.py save-credentials          # dry run
python3 scripts/kaggle_skill.py save-credentials --yes
```

This writes `KAGGLE_API_TOKEN` to `~/.kaggle/access_token`, or
`KAGGLE_USERNAME` and `KAGGLE_KEY` to `~/.kaggle/kaggle.json`, readable only
by you. It never replaces a file that exists and never prints the value.
Without `--yes` it only says what it would write. Nothing runs it
automatically.

## 6. Common problems

| Problem | What to do |
|---|---|
| `kaggle: command not found`, or exit status 127 | `python3 -m pip install "kaggle>=2.2.4" "kagglehub>=1.0.2"` for the `python3` the agent uses, then open a new shell. Public reads work without them |
| A certificate error from Python | On macOS with a python.org install, run "Install Certificates.command", or `python3 -m pip install certifi` |
| "The credential is a legacy API key" | Create an API token ("Generate New Token") or run `kaggle auth login` |
| `KAGGLE_TOKEN` is set | No Kaggle tool reads it. Use `KAGGLE_API_TOKEN` |
| Credential found but calls fail | Run the checker with `--verify`; the credential may be revoked |
| 401 or `Unauthenticated` | No credential reached the server. For MCP, sign in from the client or send an API token |
| 403 on a competition | Accept the competition's rules on kaggle.com |
| 403 on a model | Accept the model's license on kaggle.com |
| Permission warning on `kaggle.json` | `chmod 600 ~/.kaggle/kaggle.json` |
| 429 Too Many Requests | Wait a few minutes and retry with fewer calls |
| Token appears in output | A variable named `VERBOSE` or `VERBOSE_OUTPUT` is set. Unset it and make a new token |

## 7. If a credential leaks

Revoke it at https://www.kaggle.com/settings (or `kaggle auth revoke` for an
OAuth login), create a new one, and check recent activity on the account.
Never paste a credential into a chat, an issue, or a notebook.
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall