Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 63 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,41 @@ All notable changes are recorded here. The format follows

## [Unreleased]

## [0.2.0] - 2026-11-16

### Added
- A new home screen. Bare `kdev` in a terminal is a live menu that is usable
at once: the box and every account's quota fill in while it is on screen, a
running box counts down in place, and the active account's quota bar shows
what the next box would use. Every action has a key (`1`-`4`, `s` status, `a`
accounts, `d` doctor, `q` quits), arrows and `j`/`k` move, and the
highlighted item shows the exact command it runs. Read-only picks return to
the menu.
- Every list prompt is numbered; a digit picks its row at once, `j`/`k` move.
- `kdev up` draws its progress as a rail, with a clock per step and how long
that step usually takes on this machine.
- `status` and the ready card show the time left as a draining bar that turns
yellow at 30 minutes and red at 10.
- `kdev --help` ends with worked examples and uses kdev's palette. Usage
mistakes are reported in the same voice as every other error, with the
`--help` of the command being typed, and a near-miss setting or `--gpu`
value gets a "Did you mean".
- `kdev account` (and `--json`, as `quota_resets`) and the home screen say
when the weekly quota refills. Choosing a session length shows what each
choice leaves of this week's quota.
- Every prompt, spinner and card sits on the same two-column gutter; a
spinner shows its elapsed time once a wait passes three seconds. In a
short terminal the home screen drops the logo and folds its secondary
actions onto one line.
- `kdev workspace files` summarises each top-level folder; `--all` lists every
file. `kdev backup --force` overrides the new restore guard (see Fixed).
- A project website at https://kdev-cli.pages.dev: the docs with search, an
interactive architecture explorer and the changelog. The README, PyPI page and
citation now link to it.
- Colour terminals show a five-line pixel kdev header with the command and
version beside the terminal symbol, once per invocation, including setup and menu
actions. Narrow terminals use the compact terminal badge;
ASCII terminals and `NO_COLOR` use plain titles. The wordmark adapts to light
and dark backgrounds. Piped output, JSON, logs and SSH command output stay clean.
- Colour terminals show a five-line pixel kdev header on the home screen and in
setup; every other command gets one line, `›_ kdev › status`, with its
context on the right. ASCII terminals and `NO_COLOR` use plain titles.
Piped output, JSON, logs and SSH command output stay clean.
- CI reports test coverage from one Linux matrix job and includes the coverage
table in each pull request's job summary.
- `uv run basedpyright` type-checks `src` and `tests` in basic mode; it runs on
Expand All @@ -31,8 +57,8 @@ All notable changes are recorded here. The format follows

### Changed
- The terminal UI uses a geometric KDEV wordmark and terminal badge, consistent rounded
workspace and result cards, clearer account quotas, framed progress with
elapsed times, and grouped command help. Tables and next actions adapt to
workspace and result cards, clearer account quotas, and grouped command
help. Tables and next actions adapt to
narrow terminals without dropping values. Light/dark terminal colors,
ASCII and monochrome prompts remain usable; live refresh is limited to 8 Hz.

Expand All @@ -48,6 +74,36 @@ All notable changes are recorded here. The format follows
preventing repeated warnings on `kdev up`.
- `kdev logs` hides the kernel's debugger start-up warnings; `--all` still
shows them.
- `kdev status` took 13s on a large workspace: reading one version's state paged
through its whole file listing. It now stops after the first page (5.5s), and
Kaggle and ssh are asked at once. `history` reads versions in parallel and
remembers ended ones (61s, then 1.2s on a repeat run). `doctor` checks
accounts in parallel.
- Every command minted a new Kaggle access token, often several, and wrote it
into `~/.kaggle/credentials.json` -- the official CLI's own login. Tokens are
now reused until near expiry and only ever written to kdev's own files.
- Offline, every networked command died with "unexpected error"; accounts now
show "could not reach Kaggle", and `doctor` reports it as a check.
- A transient Kaggle error while reading the notebook could make `kdev up`
replace the notebook's own code; only a missing notebook counts as empty now.
- `workspace share` added a second binding for a group already on the notebook.
- Non-interactive ssh and VS Code's server lost the notebook's PATH (`/opt/bin`,
CUDA) to pam_env; the box now gives pam_env the same PATH (verified on a box).
- Changing `ssh-alias` or `tunnel-hostname` left a stale `~/.ssh/config` block,
and the block was appended after any `Host *`, whose settings then won.
- `kdev backup` could replace the local copy with a box that never finished
restoring; it now refuses unless `--force`.
- Piped output was wrapped at 80 columns; tables are now tab-separated and
nothing wraps. `kdev logs | head` no longer fails; `status --json` exits 1
when the state is unknown; `logs` on a stopped box says which run it shows.
- ASCII-only terminals crashed on `×` and `·`; they get ASCII stand-ins.
- Rate limiting (HTTP 429) is waited out, honouring Retry-After.
- The `up` progress clocks and spinner froze between log lines during a long
silent step; an interrupted step was drawn as done.
- Piped hints and next steps went to stdout between data rows; they now go
to stderr, and tables are real tab-separated values.
- Some ssh calls had no timeout and could hang `up`, `restore` or `down`.
- The tests no longer download cloudflared or touch the network or `$HOME`.

## [0.1.4] - 2026-09-24

Expand Down
117 changes: 105 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,110 @@
# Contributing to kdev

Thanks for helping. The full guide lives in the README, under
[Contributing](README.md#contributing): how to set up, how to try a change
against real Kaggle without spending GPU quota, how the code is laid out, and
what a pull request needs.
Contributions are welcome — bug reports, fixes, docs and features alike. kdev
is small and opinionated, so for anything bigger than a fix, open an issue
first and say what you want to change and why. It saves you writing code that
goes a different way than the project.

The short version:

- For anything bigger than a fix, open an issue first.
- `uv sync && uv run pre-commit install`, then `uv run pytest`.
- A bug fix comes with a test that fails without it.
- Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/).
- Note what users will notice under `## [Unreleased]` in `CHANGELOG.md`.
- Security issues go through [SECURITY.md](SECURITY.md), never a public issue.
Before you change the box, the tunnel or the restore, read
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): how the pieces fit, what
`kdev up` does step by step, how files persist, and how the code is laid out.

By taking part you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).

## Ways to help

- **Ask a question** in [Discussions](https://github.com/tushar-mahalya/kdev/discussions):
how to do something, or whether what you see is expected.
- **Report a bug.** Open an issue with what you ran, what you expected and
what happened. The output of the same command with `-v` (`kdev -v up …`)
helps most. It logs every Kaggle API call; check it for anything you would
rather not share before you paste it.
- **Fix something.** Issues labelled
[`good first issue`](https://github.com/tushar-mahalya/kdev/labels/good%20first%20issue)
are small and well described; [`help wanted`](https://github.com/tushar-mahalya/kdev/labels/help%20wanted)
ones are bigger. Say in the issue that you are on it, so two people don't
fix the same thing.
- **Improve the docs.** If something was unclear when you set up, it will
be unclear to the next person too. The user docs live in
[`website/src/content/docs/`](website/src/content/docs/).
- **Report a vulnerability** privately, as [SECURITY.md](SECURITY.md)
describes, never in a public issue.

## Set up

You need Python 3.11+ and [uv](https://docs.astral.sh/uv/).

```bash
git clone https://github.com/tushar-mahalya/kdev && cd kdev
uv sync
uv run pre-commit install # hooks on commit, tests on push
uv run basedpyright # basic-mode type check, also on every commit
uv run pytest # unit and regression tests, no network needed
uv run pytest --cov # the same suite with a local coverage report
uv run kdev -v … # the working tree, with API logging
```

Every commit runs formatting, lint, type-checking (`basedpyright`), a secrets scan
(`detect-secrets`, private-key detection), config validation and a lockfile
check; every push runs the tests. CI runs the same hooks, the tests on Python
3.11–3.13, a build-and-install check, and `gitleaks` over the full history.

## Trying a change against real Kaggle

The test suite needs no Kaggle account, and most changes need nothing more.
When yours touches the box, the tunnel or the restore, try it for real:

- Use **your own** workspace (`kdev workspace create --group <slug>`), not a
shared one someone else works in.
- Start **CPU boxes**: `uv run kdev up --gpu none --hours 1`. They cost no GPU
quota. A GPU run spends the quota of whichever account starts it.
- `kdev down` when you are done, and `kdev workspace files` to see exactly
what was saved.

## How the code is laid out

The full picture, with a diagram, is in
[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#how-the-code-is-laid-out). In short:

| layer | rule |
|---|---|
| `commands/` | parse arguments, call logic, render with `ui`; no API calls of their own beyond reads |
| `session`, `persistence`, `quota`, `notebook` | the behaviour; testable without a terminal |
| `kdev_box.py` | standard library only; it's shipped into the container and runs there |
| `ui.py` | every visual element, with its tokens and rules written down at the top |
| `errors.KdevError` | every failure a user can act on: a message and the command that fixes it |

Tests are split by module. `tests/test_cli.py` runs every command through
the real entry point against a fake Kaggle. `tests/test_kdev_box.py` runs the
on-box restore against a temporary directory.

## Pull requests

- **One change per pull request**, with a description of the problem it
solves and how you checked it.
- **A bug fix comes with a test** that fails without the fix. New behaviour
comes with the smallest test that would catch it breaking. Tests stay
offline: use the fake Kaggle in `tests/test_cli.py`.
- **Match the code around you.** `kdev_box.py` stays standard-library only.
Everything the user sees goes through `ui.py`. A failure the user can act on
is a `KdevError` with the command that fixes it.
- **Commit messages** follow [Conventional Commits](https://www.conventionalcommits.org/)
(`fix:`, `feat:`, `docs:`, `test:`, `ci:`, `refactor:`), with the *why* in
the body.
- **Record what users will notice** under `## [Unreleased]` in
[CHANGELOG.md](CHANGELOG.md). If a command or its behaviour changes, update
the [README](README.md), the [website docs](website/src/content/docs/) and,
for how things work inside, [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).

## Releasing

For maintainers: bump `version` in `pyproject.toml`, move the `Unreleased`
notes in `CHANGELOG.md` under the new version, then
`git tag vX.Y.Z && git push origin vX.Y.Z`. The release workflow checks that
the tag matches the version, runs the tests, and publishes a GitHub release
with the wheel and sdist attached.

## License

kdev is [MIT licensed](LICENSE). By contributing, you agree that your
contributions are licensed under the same terms.
Loading
Loading