Public: anyone can read this; the crew can change it.

Terminal: list and set the account quota keys (repositories, apps, previews, runs, checks) #2192

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

An admin can now list and set the account quotas from the terminal. It covers only `repositories` and `apps`, because `QUOTA_KEYS` in `src/settings/quotas.ts` holds only those two on this branch. The issue names five, but `previews`, `runs` and `checks` don't exist yet, probably because pull #2184 isn't merged. The new screen loops over `QUOTA_KEYS`, so any key added there appears with no change t…

shipped production is serving it deploy 206648f

opened this

An admin can now list and set the account quotas from the terminal. It covers only repositories and apps, because QUOTA_KEYS in src/settings/quotas.ts holds only those two on this branch. The issue names five, but previews, runs and checks don't exist yet, probably because pull #2184 isn't merged. The new screen loops over QUOTA_KEYS, so any key added there appears with no change to the screen.

The new "Account quotas" command in the palette (ctrl+k) opens a screen in src/tui/screens/quotas.ts. Each key shows its limit ("no limit" when unset) and its last change (when, from → to, who). The header line shows the newest change overall.

  • Keys: enter sets the highlighted key, with an empty value meaning no limit. x clears it.
  • Validation: both go through changeQuotas, which runs parseQuota and records the change, so the page, API, MCP tool and terminal share one rule. A bad value keeps the prompt open with the reason and changes nothing.
  • Access: the command shows only for an admin who isn't an agent. readQuotas and changeQuotas refuse anyone else. Driving the screen directly as a non-admin or an admin agent reads and writes nothing.

test/tui-quotas.test.ts covers listing, setting with its history, clearing, a refused 0, no command for a non-admin or an agent, and a direct drive of the screen. I ran it with tui-flags (9 tests pass) and tsc --noEmit is clean. I did not run the whole suite, and the forge's check will run it on this push. I added one sentence to the README paragraph on quotas.

I did not show more history than the newest change per key. The page lists the last 20 changes, and the terminal does not.

To try it, SSH in, press ctrl+k, pick Account quotas, then press enter on repositories and type 5. The row should read 5, and the header should say "no limit → 5" with your name.

🤖 Generated with Claude Code

Closes #2191

Approved

Approved. The terminal now has Account quotas (ctrl+k). It lists every QUOTA_KEYS entry with its limit and last change, enter sets one, x clears it. Reads and writes go through readQuotas/changeQuotas, so the gate is the page's: an admin who is a person. Guests, non-admins and admin agents get no command and an inert screen, and the test drives that screen directly. Values are checked by parseQuota and each change is kept with its actor. The README says how to use it. I did not run the preview, and I did not check the screenshots, because this is a TUI-only change with no new page. Next: (1) the title names previews, runs and checks, but QUOTA_KEYS holds only repositories and apps, so open an issue for those keys if they are wanted; the screen will list them once they exist. (2) A bad value reads "A quota is a positive whole number, or empty for no limit." Consider also showing the rejected input.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs