Skip to content

feat(cli): add namespace enumeration capabilites#6132

Open
geovannewashington wants to merge 2 commits intomasterfrom
feature/namespace-enumeration
Open

feat(cli): add namespace enumeration capabilites#6132
geovannewashington wants to merge 2 commits intomasterfrom
feature/namespace-enumeration

Conversation

@geovannewashington
Copy link
Copy Markdown
Contributor

What changed

Adds namespace enumeration capabilities to the CLI, introducing the namespace list command with support for quiet mode and field selection. Also introduces the namespace inspect command, designed to integrate naturally with the listing workflow by enabling deeper inspection of individual entries.

The inspect functionality is inspired by tools like the Docker CLI, following the pattern of separating resource listing from detailed inspection.

Why

Managing namespaces requires both quick visibility and detailed introspection. The list command provides fast enumeration, while inspect enables deeper analysis of a specific namespace when needed. This improves usability and aligns the CLI with familiar patterns used in other tools.

How to test

  1. Start the environment with make start
  2. Run ./bin/cli namespace list or ./bin/cli namespace ls to verify table output
  3. Run ./bin/cli namespace ls -q or --quiet to verify quiet mode
  4. Run ./bin/cli namespace ls -q tenant-id to verify field selection
  5. Pick a namespace and run ./bin/cli namespace inspect <name> to verify detailed output
  6. Test command substitution:
    • ./bin/cli namespace inspect $(./bin/cli namespace ls -q | sed -n '1p')
  7. Test tenant ID inspection:
    • ./bin/cli namespace inspect --tenant-id $(./bin/cli namespace ls -q tenant-id | sed -n '1p')

@geovannewashington geovannewashington self-assigned this Apr 7, 2026
@geovannewashington geovannewashington requested a review from a team as a code owner April 7, 2026 19:17
@geovannewashington geovannewashington added kind/feature New feature or request area/cli labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Claude finished @geovannewashington's task in 5m 38s —— View job


Code Review Complete

Reviewed 7 files across code quality, security, testing, Go patterns, and architecture — no issues found. The code looks good as-is.

Highlights:

  • Clean separation between service layer (NamespaceList, NamespaceResolve, UserResolve) and command layer (namespaceList, namespaceInspect)
  • Error handling and store interactions follow established codebase patterns
  • Good test coverage for all new service methods with table-driven tests
  • No cross-repo impact on the cloud/enterprise layer
  • Input validation (field whitelist, mutually exclusive flags) is solid

If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.


This command lists all namespaces in the system and supports an
optional quiet mode (-q). In quiet mode, it outputs a single field,
making it convenient for shell operations such as command
substitution.

The command allows selecting either the 'name' or 'tenant-id' field.
When quiet mode is not used, it formats the output neatly in a table.
@geovannewashington geovannewashington force-pushed the feature/namespace-enumeration branch 3 times, most recently from 148da01 to 971b03f Compare April 7, 2026 20:16
This change introduces a new 'namespace inspect' command to the CLI,
allowing users to retrieve detailed information about a specific
namespace in a structured and human-readable format.

This addition complements the 'namespace list' functionality by
enabling deeper inspection of individual entries, improving overall
usability of the CLI when managing namespaces.
@geovannewashington geovannewashington force-pushed the feature/namespace-enumeration branch from 971b03f to 2b2d8f3 Compare April 7, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cli kind/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant