feat(cli): add projects support with --project flag and name resolution#147
feat(cli): add projects support with --project flag and name resolution#147hiroTamada wants to merge 7 commits intomainfrom
Conversation
Add global --project flag (and KERNEL_PROJECT_ID env var) that injects X-Kernel-Project-Id header to scope all API requests to a project. The flag accepts either a project ID or a project name — names are resolved via the projects list endpoint (case-insensitive). Also adds `kernel projects` subcommands: list, create, get, delete, get-limits, set-limits. Upgrades kernel-go-sdk to v0.48.0 for project endpoint support. Made-with: Cursor
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies CLI functionality (packages/cli) and SDK dependencies, not kernel API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal). To monitor this PR anyway, reply with |
Made-with: Cursor
- looksLikeCUID: require first character to be a letter (cuid2 spec) - FakeProxyService.CheckFunc: update type signature and delegation to include body parameter Made-with: Cursor
Reuse cuidRegex from browsers.go in looksLikeCUID and update the regex to require the first character to be a letter (matching the cuid2 spec). Made-with: Cursor
Previously negative values were silently discarded, reporting success without sending the value to the API. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e55a6c3. Configure here.
get, delete, get-limits, and set-limits now accept either a project ID or name. Names are resolved via the projects list endpoint, reusing the same resolveProjectByName helper as the --project global flag. Made-with: Cursor
The default page size could miss projects beyond the first page. Request a large limit to cover typical org sizes. Made-with: Cursor

Summary
--projectpersistent flag (andKERNEL_PROJECT_IDenv var) that injects theX-Kernel-Project-Idheader to scope all API requests to a specific projectkernel projectssubcommands:list,create,get,delete,get-limits,set-limitskernel-go-sdkto v0.48.0 for project endpoint support (also fixesProxyService.Checksignature change)How it works
When
--projectis provided:GET /projectsto list all projects, finds a case-insensitive name match, and injects the resolved IDTest plan
Tested against staging with a project-scoped API key:
--project "cli-test-project"(by name) — resolves correctly--project "CLI-TEST-PROJECT"(case-insensitive) — resolves correctly--project "g9vcya6unur84k70n0u8s9p9"(by ID) — works directly--project "nonexistent-project"— clear error messageKERNEL_PROJECT_ID="cli-test-project"env var with name — resolves correctly--projectwith scoped API key — auto-scopes via server middlewarekernel projects list/create/get/delete/get-limits/set-limits— all functionalMade with Cursor
Note
Medium Risk
Adds a new global
--project/KERNEL_PROJECT_IDrequest-scoping mechanism and project-name resolution in the auth/bootstrap path, which can affect all API calls if mis-resolved. Also upgrades the Kernel SDK and adjusts proxy check calls/signatures to match the new API.Overview
Adds a new top-level
projectscommand with subcommands tolist,create,get,delete, and manage limit overrides (get-limits/set-limits).Introduces a global persistent
--projectflag (orKERNEL_PROJECT_ID) that scopes all authenticated requests via theX-Kernel-Project-Idheader, including case-insensitive project name resolution when a non-CUID value is provided.Updates CUID detection to require a leading letter, upgrades
github.com/kernel/kernel-go-sdktov0.48.0, and adapts proxy health check calls/tests to the SDK’s updatedChecksignature.Reviewed by Cursor Bugbot for commit 8d3fa6a. Bugbot is set up for automated code reviews on this repo. Configure here.