Skip to content

Add projects update command#173

Open
IlyaasK wants to merge 1 commit into
codex/normalize-api-key-displayfrom
codex/projects-update-cli
Open

Add projects update command#173
IlyaasK wants to merge 1 commit into
codex/normalize-api-key-displayfrom
codex/projects-update-cli

Conversation

@IlyaasK
Copy link
Copy Markdown
Contributor

@IlyaasK IlyaasK commented May 29, 2026

Summary

Adds kernel projects update <id-or-name> --name <name> to close the projects CRUD parity gap in the CLI.

What Changed

  • Wires ProjectsService.Update to the generated Go SDK Projects.Update method.
  • Adds ProjectsUpdateInput and ProjectsCmd.Update with the existing <id-or-name> resolver.
  • Adds --name as the required update field.
  • Adds --output json, matching the existing project read/update-style commands that return SDK objects.
  • Registers the new projects update Cobra command.
  • Adds focused tests for:
    • successful name update
    • JSON output
    • resolving a project by name before update
    • missing --name
    • invalid --output

Why

projects create, projects get, projects list, and projects delete already existed, and the SDK already exposes project update. This PR keeps the CLI change surgical by adding name update only, leaving browser telemetry parity for a separate UX/API-design PR.

Verification

  • env GOCACHE=/private/tmp/kernel-cli-go-cache go test ./cmd -run 'TestProjects(Update|List|Get|Limits|Resolve)'
  • env GOCACHE=/private/tmp/kernel-cli-go-cache go test ./cmd ./pkg/util
    • First sandbox run hit the known httptest local-port restriction; rerun outside the sandbox passed.
  • make test
  • make build
  • ./bin/kernel projects update --help

Production smoke against https://api.onkernel.com:

  • Created a disposable project.
  • Renamed it via kernel projects update <old-name> --name <new-name> --output json.
  • Verified the renamed project via kernel projects get <new-name> --output json.
  • Deleted the disposable project and confirmed cleanup.

Localhost smoke:

  • Attempted against http://localhost:3001, but the local API key available in this thread is no longer valid for the current local server state, so the smoke stopped before creating any resource.

Note

Low Risk
CLI-only addition mirroring existing project commands; scope is limited to renaming via the SDK with unit test coverage.

Overview
Adds kernel projects update <id-or-name> --name <name> so the CLI can rename projects and complete basic projects CRUD alongside create/get/list/delete.

The command reuses the existing id-or-name resolver and optional --output json, calls the SDK Projects.Update with only the name field, and prints a success line otherwise. Tests cover happy path, JSON output, name resolution, missing --name, and invalid output.

Reviewed by Cursor Bugbot for commit 7ff4c5c. Bugbot is set up for automated code reviews on this repo. Configure here.

@firetiger-agent
Copy link
Copy Markdown

Monitoring Plan: Add projects update CLI Command

What this PR does: Lets CLI users rename a project via kernel projects update <id-or-name> --name <new-name>.

Intended effect:

  • PATCH /projects/{id} traffic: baseline ~3 calls/24h (near-zero); confirmed if new calls appear with status_code=200 post-deploy.
  • PATCH /projects/{id} 5xx errors: baseline 0; confirmed if rate stays at 0% after deploy.

Risks:

  • PATCH endpoint errors — monitor PATCH /projects/{id} span status.code; alert if any 5xx appears (baseline: 0).
  • Name resolution slowdown — if resolveProjectArg list call degrades, GET /projects p95 could spike; alert if p95 > 400ms (baseline: 142–147ms).
  • Overall API regression — overall HTTP 5xx rate; alert if > 0.5% sustained for any hour (baseline: 0.057–0.167%).

Status updates will be posted automatically on this PR as monitoring progresses.

View monitor

@IlyaasK IlyaasK requested a review from hiroTamada May 30, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant