feat(cli): show workspace id in workspaces list default table#4463
Conversation
`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 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. |
📝 WalkthroughWalkthroughThe CLI workspace listing command adds a workspace ChangesCLI Workspace List Display
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryAdds the
Confidence Score: 5/5Safe to merge — the change is a two-line addition of the The workspace objects already include No files require special attention.
|
| 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)
Reviews (1): Last reviewed commit: "feat(cli): show workspace id in `workspa..." | Re-trigger Greptile
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
packages/cli/src/commands/workspaces/list/command.ts
| ["name", "branch", "projectName", "hostName", "id"], | ||
| ["NAME", "BRANCH", "PROJECT", "HOST", "ID"], | ||
| 30, |
There was a problem hiding this comment.
🧩 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' -nRepository: superset-sh/superset
Length of output: 50377
🏁 Script executed:
# Get the full table function implementation
head -100 packages/cli-framework/src/output.ts | tail -40Repository: 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.tsRepository: 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 -10Repository: 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
doneRepository: 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 -60Repository: 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.
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
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.
Summary
superset workspaces openrequires a UUID, but the defaultworkspaces listtable didn't include the ID — forcing users through--jsonto copy it.IDas the trailing column, matching the convention used byprojects list,agents list, andhosts list.Test plan
superset workspaces listshows theIDcolumnsuperset workspaces list --jsonoutput is unchangedIDfrom the list and runsuperset workspaces open <id>Summary by cubic
Add the workspace ID as the trailing column in the default
superset workspaces listoutput. This makes it easy to copy the UUID forsuperset workspaces open <id>and matchesprojects list,agents list, andhosts list.Written for commit 18c0a67. Summary will update on new commits.
Summary by CodeRabbit