Honor --dry-run in project deletion - #1630
Conversation
|
The latest Agentuity deployment details.
View deployment logs with the Agentuity CLI: |
📝 WalkthroughWalkthroughChangesThe ChangesProject delete dry-run
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Canary Packages Publishedversion: PackagesInstallAdd to your {
"dependencies": {
"@agentuity/task": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-task-3.1.15-5067220.tgz",
"@agentuity/client": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-client-3.1.15-5067220.tgz",
"@agentuity/genesis": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-genesis-3.1.15-5067220.tgz",
"@agentuity/schema": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-schema-3.1.15-5067220.tgz",
"@agentuity/analytics": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-analytics-3.1.15-5067220.tgz",
"@agentuity/pi": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-pi-3.1.15-5067220.tgz",
"@agentuity/vector": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-vector-3.1.15-5067220.tgz",
"@agentuity/hono": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-hono-3.1.15-5067220.tgz",
"@agentuity/queue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-queue-3.1.15-5067220.tgz",
"@agentuity/webhook": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-webhook-3.1.15-5067220.tgz",
"@agentuity/adapter": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-adapter-3.1.15-5067220.tgz",
"@agentuity/telemetry": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-telemetry-3.1.15-5067220.tgz",
"@agentuity/sandbox": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-sandbox-3.1.15-5067220.tgz",
"@agentuity/config": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-config-3.1.15-5067220.tgz",
"@agentuity/api": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-api-3.1.15-5067220.tgz",
"@agentuity/skills": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-skills-3.1.15-5067220.tgz",
"@agentuity/opencode": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-opencode-3.1.15-5067220.tgz",
"@agentuity/migrate": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-migrate-3.1.15-5067220.tgz",
"@agentuity/core": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-core-3.1.15-5067220.tgz",
"@agentuity/runtime": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-runtime-3.1.15-5067220.tgz",
"@agentuity/email": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-email-3.1.15-5067220.tgz",
"@agentuity/stream": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-stream-3.1.15-5067220.tgz",
"@agentuity/drizzle": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-drizzle-3.1.15-5067220.tgz",
"@agentuity/vite": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-vite-3.1.15-5067220.tgz",
"@agentuity/db": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-db-3.1.15-5067220.tgz",
"@agentuity/storage": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-storage-3.1.15-5067220.tgz",
"@agentuity/server": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-server-3.1.15-5067220.tgz",
"@agentuity/claude-code": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-claude-code-3.1.15-5067220.tgz",
"@agentuity/keyvalue": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-keyvalue-3.1.15-5067220.tgz",
"@agentuity/schedule": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-schedule-3.1.15-5067220.tgz",
"@agentuity/coder-tui": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-coder-tui-3.1.15-5067220.tgz",
"create-agentuity": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/create-agentuity-3.1.15-5067220.tgz",
"@agentuity/postgres": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-postgres-3.1.15-5067220.tgz",
"@agentuity/aigateway": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-aigateway-3.1.15-5067220.tgz",
"@agentuity/cli": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-cli-3.1.15-5067220.tgz",
"@agentuity/coder": "https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-coder-3.1.15-5067220.tgz"
}
}Or install directly: bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-task-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-client-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-genesis-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-schema-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-analytics-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-pi-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-vector-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-hono-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-queue-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-webhook-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-adapter-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-telemetry-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-sandbox-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-config-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-api-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-skills-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-opencode-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-migrate-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-core-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-runtime-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-email-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-stream-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-drizzle-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-vite-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-db-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-storage-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-server-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-claude-code-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-keyvalue-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-schedule-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-coder-tui-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/create-agentuity-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-postgres-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-aigateway-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-cli-3.1.15-5067220.tgz
bun add https://agentuity-sdk-objects.t3.storageapi.dev/npm/3.1.15-5067220/agentuity-coder-3.1.15-5067220.tgz |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/cmd/project/delete.ts`:
- Line 143: Update the dry-run output guard in the delete command around the
options.json check to import isJSONMode from ../../output.ts and use
isJSONMode() instead, preserving the existing guard behavior while centralizing
JSON-mode detection.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 038d65cf-85c1-4877-b86d-363e57fd1777
📒 Files selected for processing (2)
packages/cli/src/cmd/project/delete.tspackages/cli/test/cmd/project/delete.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (17)
- GitHub Check: Bun version checks
- GitHub Check: Native install (macOS)
- GitHub Check: Installer scenarios
- GitHub Check: Native install (Linux)
- GitHub Check: Linux distro install smoke
- GitHub Check: Pack & Upload
- GitHub Check: Agentuity - docs-docs
- GitHub Check: Windows WSL CLI Smoke Test
- GitHub Check: Package Installation & Usage Test (node)
- GitHub Check: Queue CLI Tests (bun)
- GitHub Check: Package Installation & Usage Test (bun)
- GitHub Check: Postgres SSL Integration Test
- GitHub Check: Service Client Smoke Tests
- GitHub Check: Framework Demo Tests
- GitHub Check: Queue CLI Tests (node)
- GitHub Check: Migrate Chain (v1 → v2 → v3)
- GitHub Check: Build
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run
bun run formatusing Biome with tabs (width 3), single quotes, semicolons, lineWidth 100, and trailingCommas es5
Files:
packages/cli/src/cmd/project/delete.tspackages/cli/test/cmd/project/delete.test.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Use TypeScript in strict mode with ESNext target and bundler moduleResolution
UseStructuredErrorfrom@agentuity/corefor error handling
Files:
packages/cli/src/cmd/project/delete.tspackages/cli/test/cmd/project/delete.test.ts
packages/cli/src/**/*.ts
📄 CodeRabbit inference engine (packages/cli/AGENTS.md)
packages/cli/src/**/*.ts: Usetui.*helpers for formatted output (header,info,success,warning,error,table,progress)
Usectx.loggerfor logging;logger.fatal()logs and exits with code 1
Useawait readFile(p, 'utf-8')andawait writeFile(p, content)fromnode:fs/promisesfor file I/O
ImportpathExistsfromnode-compat/fsfor file existence checks instead of using Node's built-in
Do not use Bun globals (Bun.file,Bun.spawn,Bun.color,Bun.stringWidth, etc.) in production source code;tsconfig.jsontype checking enforces this
Imports must use explicit.tsextensions for relative paths (e.g.,from './foo.ts', notfrom './foo'); TypeScript'srewriteRelativeImportExtensionswill rewrite them to.jsin output
Always checkisJSONMode()for machine-readable output in command handlers
UserequireAuth(ctx)oroptionalAuth(ctx)for authenticated commands
Files:
packages/cli/src/cmd/project/delete.ts
**/packages/*/test/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/packages/*/test/**/*.{ts,tsx}: Place tests intest/folder parallel tosrc/directory, never insidesrc/or under__tests__/
Import from../src/in test files
Use@agentuity/test-utilsfor shared mocks in tests
Files:
packages/cli/test/cmd/project/delete.test.ts
🧠 Learnings (3)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.
Applied to files:
packages/cli/src/cmd/project/delete.tspackages/cli/test/cmd/project/delete.test.ts
📚 Learning: 2026-02-17T14:23:15.448Z
Learnt from: potofpie
Repo: agentuity/sdk PR: 974
File: packages/cli/src/cmd/git/account/list.ts:39-40
Timestamp: 2026-02-17T14:23:15.448Z
Learning: In the Agentuity CLI framework (packages/cli), when a subcommand declares requires: { auth: true }, the framework will automatically call requireAuth() before invoking the handler. Do not call requireAuth(ctx) manually inside command handlers. This applies to all TypeScript command files under packages/cli/src, including paths like packages/cli/src/cmd/git/account/list.ts.
Applied to files:
packages/cli/src/cmd/project/delete.ts
📚 Learning: 2026-02-21T02:05:57.982Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 1010
File: packages/drizzle/test/proxy.test.ts:594-603
Timestamp: 2026-02-21T02:05:57.982Z
Learning: Do not rely on StructuredError from agentuity/core in test files or simple error handling paths. In tests and straightforward error handling, use plain Error objects to represent failures, reserving StructuredError for more complex error scenarios in application logic.
Applied to files:
packages/cli/test/cmd/project/delete.test.ts
🔇 Additional comments (2)
packages/cli/src/cmd/project/delete.ts (1)
7-7: LGTM!Also applies to: 57-57
packages/cli/test/cmd/project/delete.test.ts (1)
1-124: LGTM!
--dry-run in project deletion
Summary
agentuity --dry-run project delete <id>now resolves the project, prints the exact target, and exits before confirmation orDELETE /cli/project.This PR:
--confirmWhy
The global
--dry-runoption reached the command throughctx.options, but the project delete handler never checked it. After its read-only project lookup, the handler continued into the non-interactive confirmation guard and, when--confirmwas present, called the deletion API.The dry-run guard belongs after target resolution, so the preview can name the project, and before confirmation and mutation, so both destructive paths are unreachable.
Flow
The normal command keeps its existing path:
Implementation
Guard the mutation boundary
The command uses the shared
isJSONMode()helper, preserving the existing JSON-output guard while centralizing mode detection.Test the CLI boundary
The test runs the real CLI entry point against a fake API and records every request. A dry run may resolve the target with
GET; it must never sendDELETE.Research and rationale
First-party CLI implementations use the same boundary:
--dry-run.--dry-runin the delete handler and returns before destructive work, with a regression test asserting the deletion path is not called.The common rule is explicit: resolve enough state to show an accurate plan, then return from the handler before confirmation or mutation.
Verification
bun test packages/cli/test/cmd/project/delete.test.ts: 2 passed, 0 failedbunx bun@1.3.11 run lint: passedbunx bun@1.3.11 run build: passedbunx bun@1.3.11 run typecheck:packages: passedbunx bun@1.3.11 run all: passed, including package tests, CLI tests, docs tests, install smokes, service builds, and standalone backend tests--confirmprinted the exact target and returned successfully; a follow-up lookup confirmed the project still existedDocumentation impact
No standalone documentation change is needed. The existing CLI docs already describe the global
--dry-runoption; this PR updates the command’s own help text to say: “Preview project deletion without making changes.”