Skip to content

feat: support stack name as alternative to ID in all commands#42

Merged
omattsson merged 1 commit intomainfrom
feat/name-based-stack-resolution
Apr 22, 2026
Merged

feat: support stack name as alternative to ID in all commands#42
omattsson merged 1 commit intomainfrom
feat/name-based-stack-resolution

Conversation

@omattsson
Copy link
Copy Markdown
Owner

@omattsson omattsson commented Apr 22, 2026

Summary

  • Add resolveStackID helper that detects UUIDs/numeric IDs (passthrough) vs names (API lookup via ?name=)
  • Update all 13 stack commands and 9 override commands to accept <name|id>
  • Refactor deleteByID to accept a resolver function (stack uses resolveStackID, definition uses passthroughID)
  • Defensive name-match verification guards against backends ignoring the filter
  • Disambiguation: multiple matches produce a clear error listing IDs, owners, and statuses

Context

Closes #40. Depends on backend PR: omattsson/k8s-stack-manager#178 (adds ?name= query param).

Follow-up issue for bulk commands: #41.

Test plan

  • go test ./... passes (all packages)
  • Unit tests: UUID/numeric passthrough, name resolution (single/none/multiple), API error, name mismatch, whitespace
  • Integration tests: GetByName, GetByNameAmbiguous, GetByNameNotFound
  • E2E tests pass (numeric IDs still work via looksLikeID)
  • Manual: stackctl stack get <name> resolves and returns details

🤖 Generated with Claude Code

Add name-based resolution so users can run e.g. `stackctl stack get my-stack`
instead of looking up UUIDs. When a non-UUID/non-numeric argument is given,
the CLI queries ?name= on the backend and resolves to an ID. Ambiguous
names produce a clear error listing all matches.

Updates all stack and override commands (Use strings, examples, help text).
Includes defensive name-match verification and comprehensive test coverage.

Closes #40

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@omattsson omattsson merged commit daaa054 into main Apr 22, 2026
6 checks passed
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.

feat: support stack name as alternative to stack ID in commands

1 participant