Skip to content
tushar-mahalyaPublic

About

A Kaggle notebook as your remote dev box: SSH and VS Code in, files that persist across sessions, accounts and machines.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

kdev

A Kaggle notebook as your remote dev box.
Start it with one command, work in it from VS Code or a shell, and leave whenever you like.
Your files are there next time — on any account in your Kaggle group, from any machine.

CI PyPI Python versions Latest release MIT license OpenSSF Scorecard Website PRs welcome

Website · Docs · How it works · Commands · Changelog

Why kdev

Kaggle gives every account free GPU hours, but only inside a notebook. kdev turns that notebook into a machine you can ssh into or open in VS Code.

  • One box, pooled quota. Every account in your Kaggle group runs the same shared notebook on its own weekly GPU hours. When one runs short, kdev up asks which account takes over.
  • Files that persist. Whatever is in /kaggle/working when a session ends comes back at the next start, however it ended: kdev down, a timeout, a crash, your wifi dropping.
  • A real server. A stable hostname over Cloudflare Tunnel, public-key SSH, and your notebook's full environment (CUDA, Python, Kaggle variables). No port is opened on the box.

Install

Needs Python 3.11+, ssh, and a Kaggle account in a Kaggle group.

uv tool install kdev-cli      # or: pipx install kdev-cli

The package is kdev-cli; the command it installs is kdev. Upgrade with uv tool upgrade kdev-cli.

Quick start

kdev setup      # once per machine: SSH key, cloudflared, Kaggle sign-in, workspace, tunnel
kdev up         # start the box, or connect to the one already running
ssh kaggle      # or VS Code → Remote-SSH → kaggle
kdev down       # optional: stop early and hand the quota back

kdev setup only does what is missing, so it is safe to run again. Two parts of it you may want to run on their own:

  • The tunnel. With a domain on Cloudflare, kdev tunnel setup creates a named tunnel with a hostname that never changes. Without one, kdev setup offers a free quick tunnel, on a new hostname each session.
  • The workspace. One account owns the notebook and shares it with the group: kdev workspace create --group <your-group-slug>, once. Everyone else runs kdev workspace join.

Leaving needs no ceremony: close the laptop and walk away. The box runs to the end of its session and saves as it stops.

Everyday commands

command what it does
kdev the home screen: the box and every account's quota, live; one key per action
kdev up start the box, or connect to the running one
kdev down stop the box; files are saved however it stops
kdev ssh open a shell on the box
kdev status running? who started it? when does it end? files back?
kdev forward PORT reach a service on the box through localhost (9000:8888 remaps)
kdev logs stream the session's log
kdev history past saved sessions, who ran them and how they ended
kdev restore finish or repeat the restore of your saved files
kdev backup copy the running box's files to this machine
kdev account accounts and their GPU/TPU hours left (add, use, remove)
kdev workspace the shared notebook (files, join, use, create, share)
kdev doctor check everything kdev depends on

Run bare kdev and press a key: 1 starts the box, s shows its status, q quits. The highlighted item always shows the command it runs, so everything the menu does you can also type or script.

Useful flags on kdev up: --gpu none|t4|p100|tpu, --hours N, --account NAME, --open code|shell|none, --no-restore, --replace, -y. Add -v to any command to log each Kaggle API call. status, history, account and workspace files take --json for scripts. See the full command reference.

Settings

Pick once with kdev config set, and kdev up stops asking:

kdev config set gpu t4      # none, t4, p100, tpu (and l4, a100, h100 where available)
kdev config set hours 9     # Kaggle's limit: 12h, 9h on TPU
kdev config                 # list every setting; secrets are never shown

Other settings cover a git remote that the box clones at boot and pushes every 15 minutes, your SSH key and alias, and the tunnel. They are stored in ~/.config/kdev/config.json (mode 0600). All of them: Settings.

Troubleshooting

kdev doctor        # every dependency, account token, the workspace and the tunnel's DNS
kdev -v status     # the same command, with each Kaggle API call logged
kdev logs          # what the box itself is saying

Most messages name the command that fixes them. Common ones are listed in Troubleshooting.

Documentation

Contributing

Bug reports, fixes, docs and features are welcome. For anything bigger than a fix, open an issue first. Questions go to Discussions. How to set up, test without spending GPU quota, and send a pull request: CONTRIBUTING.md.

Security

Access is public-key SSH only. Kaggle has no API for notebook Secrets, so the tunnel credentials sit in the private notebook's source, readable by anyone with Can Edit. Kaggle allows one account per person and restricts tunnelling out of notebooks; know the rules you are working under. Details are in Security and limits. Report a vulnerability privately, as SECURITY.md describes.

License

MIT. kdev is an independent project, not affiliated with Kaggle, Google or Cloudflare.

About

A Kaggle notebook as your remote dev box: SSH and VS Code in, files that persist across sessions, accounts and machines.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages