Add --project-id and --organization-id flags to target command#44
Add --project-id and --organization-id flags to target command#44austin-denoble merged 6 commits intomainfrom
--project-id and --organization-id flags to target command#44Conversation
…her than global/root options
…gs alongside names, clean up code a bit
|
Claude finished @austin-denoble's task —— View job Code Review Complete ✅SummaryThis PR successfully adds ✅ Strengths1. Clean API Design
2. Good Error Handling & User Experience
3. Consistent Code Cleanup
4. Robust Implementation
|
|
Claude finished @austin-denoble's task —— View job Code Review Complete ✅SummaryThis PR successfully adds ✅ Strengths1. Clean API Design
2. Good Error Handling & User Experience
3. Consistent Code Cleanup
4. Robust Implementation
|
…er auth context where needed
|
Claude finished @austin-denoble's task —— View job Code Review Complete ✅SummaryThis PR successfully adds ✅ Strengths1. Clean API Design
2. Good Error Handling & User Experience
3. Consistent Code Cleanup
4. Robust Implementation
|
|
Claude finished @austin-denoble's task —— View job Code Review Complete ✅SummaryThis PR successfully adds ✅ Strengths1. Clean API Design
2. Good Error Handling & User Experience
3. Consistent Code Cleanup
4. Robust Implementation
|
|
Claude finished @austin-denoble's task —— View job Code Review Complete ✅SummaryThis PR successfully adds ✅ Strengths1. Clean API Design
2. Good Error Handling & User Experience
3. Consistent Code Cleanup
4. Robust Implementation
|
Problem
For projects and organizations we use ID values in all commands in the CLI except for
target. This command was originally written before finalizing the public API definitions, and went with an ease-of-use UX of using either--proj(for project name), or--org(for organization name) to target. This is convenient, but could be confusing given the usage of project and organization IDs elsewhere across the admin API.Solution
Align the
pc targetcommand around resource IDs rather than names. I've kept the ability to use names for now. You'll need to pass one or the other for organization or project.I also did a bit of cleanup of package level variables in this PR. We don't need to be exporting the struct defining command options from each package, so standardize that.
This PR also resolves bugs related to clearing default API key values. We were storing the key in two different places (
state, andsecrets) and using one or the other for the presentational layer. I've also made sure when you're clearing service account or default API key credentials, the auth context will resolve properly.Type of Change
Test Plan
Test that the
targetcommand still works as expected: