Open
Conversation
…crumbs Every tools subcommand (show, create, update, trash, enable, disable, reposition) required --in <project> and fell back to interactive project selection when omitted. The project ID was never passed to any SDK call — the API is account-scoped — so this was unnecessary friction. - Remove ensureProject() from all tools subcommands - Extract resolveToolsProject() helper that optionally resolves a project for breadcrumb display without blocking the command - Explicit --in with a bad value still surfaces an error; config defaults that fail resolution are silently ignored (best-effort breadcrumbs) - Add tests for no-project, explicit-project-error, config-default, and transport-backed breadcrumb content assertions
There was a problem hiding this comment.
Pull request overview
This PR removes the hard requirement for specifying a project (--in/--project) across all tools subcommands by making project resolution optional and using it only to enrich breadcrumbs when available.
Changes:
- Introduces optional project resolution (
resolveToolsProject) used solely for breadcrumb generation, with “explicit flag” failures surfacing errors and config defaults treated as best-effort. - Updates
toolssubcommands (show/create/update/trash/enable/disable/reposition) to avoid interactive project selection when no project is provided. - Adds tests covering “no project required” behavior and breadcrumb rendering with/without an explicit project.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
internal/commands/tools.go |
Makes project resolution optional for tools commands and conditionally emits --in / “View project” breadcrumbs. |
internal/commands/tools_test.go |
Adds regression tests for running tools commands without --in and for breadcrumb output with/without a project. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…ions, transport-backed error test - Update --in flag help to say "Project ID or name" matching --project - Use strings.ToLower for case-insensitive project error assertions - Replace setupTestApp with mockToolProjectFailTransport in explicit project error test to prove tools API is never called when project resolution fails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
toolssubcommand (show, create, update, trash, enable, disable, reposition)required
--in <project>and fell back to interactive project selection when omitted.The project ID is never passed to any SDK call — the API is account-scoped — so this
was unnecessary friction.
--inis now optional. If provided, it's used for breadcrumb hints. If omitted,breadcrumbs skip
--inand the "View project" link. Config defaults still enrichbreadcrumbs on a best-effort basis.
--inwith a bad value still surfaces an error (not silently swallowed).Summary by cubic
--inis now optional for alltoolscommands. Commands no longer prompt for a project and only use the project for breadcrumbs and hints.resolveToolsProject()to optionally resolve projects for breadcrumbs; explicit bad--in/--projectstill errors, config defaults failing are ignored.ensureProject()) from alltoolssubcommands.--in <id>only when a project resolves and skip the "View project" link when none.--projectsays "Project ID or name (for breadcrumbs)";--insays "Project ID or name (alias for --project)".Written for commit 0c37474. Summary will update on new commits.