Skip to content

feat(cli): show workspace id in workspaces list default table#4463

Merged
saddlepaddle merged 1 commit into
mainfrom
workspace-open-by-name
May 12, 2026
Merged

feat(cli): show workspace id in workspaces list default table#4463
saddlepaddle merged 1 commit into
mainfrom
workspace-open-by-name

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented May 12, 2026

Summary

  • superset workspaces open requires a UUID, but the default workspaces list table didn't include the ID — forcing users through --json to copy it.
  • Add ID as the trailing column, matching the convention used by projects list, agents list, and hosts list.

Test plan

  • superset workspaces list shows the ID column
  • superset workspaces list --json output is unchanged
  • Copy an ID from the list and run superset workspaces open <id>

Summary by cubic

Add the workspace ID as the trailing column in the default superset workspaces list output. This makes it easy to copy the UUID for superset workspaces open <id> and matches projects list, agents list, and hosts list.

Written for commit 18c0a67. Summary will update on new commits.

Summary by CodeRabbit

  • New Features
    • The workspace list command now displays the workspace ID column in the output table, positioned alongside the existing name, branch, project name, and hostname columns. This provides users with a complete view of workspace identifiers when listing workspaces.

Review Change Stack

`superset workspaces open` requires a UUID, but the default table omitted
it — forcing users through `--json` to copy the id. Add ID as the
trailing column, matching the convention used by `projects list`,
`agents list`, and `hosts list`.
@capy-ai
Copy link
Copy Markdown

capy-ai Bot commented May 12, 2026

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

The CLI workspace listing command adds a workspace id column to its table output. The selected fields and corresponding column headers in the table helper are updated to include id alongside existing columns (name, branch, projectName, hostName).

Changes

CLI Workspace List Display

Layer / File(s) Summary
Add workspace ID column to table output
packages/cli/src/commands/workspaces/list/command.ts
The table configuration's selected fields and column headers are updated to include the workspace id field in the CLI workspace list output.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A workspace ID now glows bright,
In columns of text, a welcome sight!
One little field, so simple and small,
Makes listing complete, that's all! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding workspace ID to the default table output in the workspaces list command.
Description check ✅ Passed The description provides context, rationale, and a clear test plan, though it deviates from the template structure with custom sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch workspace-open-by-name

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 12, 2026

Greptile Summary

Adds the ID column to the default workspaces list table output so users can copy a workspace UUID directly, without resorting to --json. The two-line change mirrors the trailing-id convention already used by projects list, agents list, and hosts list.

  • Appends \"id\" / \"ID\" to the table() key/header arrays in packages/cli/src/commands/workspaces/list/command.ts.
  • No change to the underlying data: id is already present on each workspace object via the ...workspace spread.

Confidence Score: 5/5

Safe to merge — the change is a two-line addition of the id column to an existing table display, with no logic or data-flow changes.

The workspace objects already include id via ...workspace spread, so the new column will always be populated. The change is consistent with the same pattern used in every other comparable list command in the codebase.

No files require special attention.

Important Files Changed

Filename Overview
packages/cli/src/commands/workspaces/list/command.ts Adds id/ID as the trailing column in the workspaces list table, consistent with projects, agents, and hosts list commands. The workspace objects already carry id via ...workspace spread, so no data wiring is needed.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as superset CLI
    participant API as v2Workspace API
    participant HostAPI as host API

    User->>CLI: superset workspaces list
    CLI->>API: v2Workspace.list.query(organizationId, filters)
    CLI->>HostAPI: host.list.query(organizationId)
    API-->>CLI: workspaces[]
    HostAPI-->>CLI: hosts[]
    CLI->>CLI: map hostId → hostName
    CLI->>User: table(name, branch, project, host, id)
Loading

Reviews (1): Last reviewed commit: "feat(cli): show workspace id in `workspa..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/commands/workspaces/list/command.ts`:
- Around line 21-23: The table's maxColWidth is set too small (30) causing
36-char UUIDs in the "id" column to be truncated; update the table() call that
builds the workspace list (the one using columns
["name","branch","projectName","hostName","id"] and headers
["NAME","BRANCH","PROJECT","HOST","ID"]) to use a larger maxColWidth (at least
36, preferably 40) so full UUIDs are displayed and copyable.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: aebf6037-a989-4898-a06c-90b563ed7661

📥 Commits

Reviewing files that changed from the base of the PR and between c0f2454 and 18c0a67.

📒 Files selected for processing (1)
  • packages/cli/src/commands/workspaces/list/command.ts

Comment on lines +21 to 23
["name", "branch", "projectName", "hostName", "id"],
["NAME", "BRANCH", "PROJECT", "HOST", "ID"],
30,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify how table width is applied and whether truncation occurs.
set -euo pipefail

echo "== Locate table helper implementation =="
fd -i "table" packages | sed -n '1,120p'
rg -n -C3 'export .*table|function table|const table\s*=' packages

echo
echo "== Find truncation/padding logic near table helper =="
rg -n -C4 'truncate|slice|ellipsis|width|maxWidth|pad' packages

echo
echo "== Find other list commands that print IDs and their width settings =="
rg -n -C2 'table\(' packages/cli/src/commands | rg -n 'ID|id|projects list|agents list|hosts list|workspaces list' -n

Repository: superset-sh/superset

Length of output: 50377


🏁 Script executed:

# Get the full table function implementation
head -100 packages/cli-framework/src/output.ts | tail -40

Repository: superset-sh/superset

Length of output: 1102


🏁 Script executed:

# Search for the complete table function to understand width parameter semantics
sed -n '67,150p' packages/cli-framework/src/output.ts

Repository: superset-sh/superset

Length of output: 1284


🏁 Script executed:

# Find other list commands that display IDs and check their width settings
find packages/cli/src/commands -name "*.ts" -type f -exec grep -l "table(" {} \; | head -10

Repository: superset-sh/superset

Length of output: 596


🏁 Script executed:

# Check how other list commands handle ID columns
for file in packages/cli/src/commands/*/list/command.ts packages/cli/src/commands/*/*/list/command.ts; do
  if [ -f "$file" ]; then
    echo "=== $file ==="
    grep -A 5 "table(" "$file" | head -20
  fi
done

Repository: superset-sh/superset

Length of output: 2089


🏁 Script executed:

# Specifically check the hosts list command since it might have IDs
cat packages/cli/src/commands/hosts/list/command.ts | head -60

Repository: superset-sh/superset

Length of output: 769


UUID truncation in the ID column will break the intended workflow

The table() function truncates individual cells when they exceed the maxColWidth parameter (line 23 sets this to 30). UUIDs are 36 characters, so they will be truncated to 29 characters plus an ellipsis, making them non-copyable. This defeats the PR's goal of enabling workspaces open <id> workflows.

Workspace list is the only command using an explicit maxColWidth below the default (60); all other list commands that display IDs use the default. Increase the width to at least 36 (or 40 for safety).

Suggested fix
  display: (data) =>
    table(
      data as Record<string, unknown>[],
      ["name", "branch", "projectName", "hostName", "id"],
      ["NAME", "BRANCH", "PROJECT", "HOST", "ID"],
-     30,
+     40,
    ),
🤖 Prompt for 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.

In `@packages/cli/src/commands/workspaces/list/command.ts` around lines 21 - 23,
The table's maxColWidth is set too small (30) causing 36-char UUIDs in the "id"
column to be truncated; update the table() call that builds the workspace list
(the one using columns ["name","branch","projectName","hostName","id"] and
headers ["NAME","BRANCH","PROJECT","HOST","ID"]) to use a larger maxColWidth (at
least 36, preferably 40) so full UUIDs are displayed and copyable.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@saddlepaddle saddlepaddle merged commit 1a0454c into main May 12, 2026
16 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

🚀 Preview Deployment

🔗 Preview Links

Service Status Link
Neon Database (Neon) View Branch
Vercel API (Vercel) Open Preview
Vercel Web (Vercel) Open Preview
Vercel Marketing (Vercel) Open Preview
Vercel Admin (Vercel) Open Preview
Vercel Docs (Vercel) Open Preview

Preview updates automatically with new commits

@saddlepaddle saddlepaddle mentioned this pull request May 13, 2026
3 tasks
saddlepaddle added a commit that referenced this pull request May 13, 2026
Changes since v0.2.15:

- workspaces: `superset workspaces list` table now shows the workspace
  ID column. (#4463)
- docs: VHS demo walkthrough recording added under `packages/cli/demo/`.
  (#4461)
- auth: `superset auth login --api-key sk_live_…` stores an API key at
  `~/.superset/config.json` instead of running the OAuth flow; `whoami`
  and `logout` updated to recognize stored keys. (#4472)
- hosts: `superset hosts list` shows `local` for the host machine you're
  invoking from, distinct from `online`/`no`. (#4476)
- automations: `--agent` is now the host agent instance/preset id (e.g.
  `claude`, `codex`, `superset`) and is resolved live from the host on
  every run. The `--agent-config-file` flag is removed; create/update
  rename `agentConfig` -> `agent` end-to-end. (#4481)

Push cli-v0.2.16 after this lands to fire the release pipeline.
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.

1 participant