AGENT SKILL

cube-admin

Administer a Cube tenant — users, groups, user attributes, access policies, tenant settings, API keys, SCIM provisioning and OIDC — using the Cube CLI. Use whenever someone wants to manage who can access what: add or remove a user, grant or revoke a user's or group's access to a deployment or resource, set user attributes for row-level security, configure SSO, rotate an API key, or audit current permissions. Triggers on "add someone to", "give access to", "who can see", "remove this user", "set up SSO", "create an API key", "what are this user's permissions", "audit access". To manage deployments themselves use cube-deploy; for embedded end-user access use cube-embed.

License 许可
Apache-2.0
最近更新
2026-10-01
Stars
★ 4
Forks
0

01 前言 Front Matter

name
cube-admin
license
Apache-2.0
description
Administer a Cube tenant — users, groups, user attributes, access policies, tenant settings, API keys, SCIM provisioning and OIDC — using the Cube CLI. Use whenever someone wants to manage who can access what: add or remove a user, grant or revoke a user's or group's access to a deployment or resource, set user attributes for row-level security, configure SSO, rotate an API key, or audit current permissions. Triggers on "add someone to", "give access to", "who can see", "remove this user", "set up SSO", "create an API key", "what are this user's permissions", "audit access". To manage deployments themselves use cube-deploy; for embedded end-user access use cube-embed.
compatibility
Needs the Cube CLI, installed and logged in, and network access to Cube Cloud.

03 SKILL.md 正文

Administer a Cube tenant

The widest surface in this plugin, and the one where mistakes affect other people. Everything here is real: removing a user removes their access.

CLI-only. The Cube MCP tools do not administer users, groups or access. Without a terminal and the Cube CLI, say so, and point the user to Admin in the Cube console.

Preflight

command -v cube >/dev/null || echo "Cube CLI not installed: curl -fsSL https://raw.githubusercontent.com/cube-js/cube/master/install-cli.sh | sh"
cube whoami || echo "Not authenticated. Interactive: cube login. Headless: set CUBE_API_URL + CUBE_API_KEY."
cube context list   # the wrong tenant here changes the wrong company's access

Read before you write

Access questions are answered by reading, and most requests are questions even when phrased as instructions. Establish the current state first:

cube users list
cube users me
cube groups list
cube policies get --resource-type <type> --resource-id <id>
cube attributes list

Report what you find before changing it. "Alice is already in the analysts group" resolves a lot of requests without a write.

Users and groups

cube users create --data '<user>'
cube users update <user> --data '<changes>'
cube users delete <user>

cube groups list
cube groups delete <group>

The CLI cannot create a group or change who is in one. When groups come from an identity provider over SCIM, membership belongs there — say so. Otherwise go through SCIM, reading the group first:

cube scim groups get <group>
cube scim groups patch <group> --data '<SCIM PatchOp JSON>'
cube scim groups create --data '<SCIM group JSON>'

Access policies

cube policies get --resource-type <type> --resource-id <id>
cube policies set-group --resource-type <type> --resource-id <id> --group <group> --action <action>
cube policies set-user --resource-type <type> --resource-id <id> --user <user> --action <action>

Always pass --action. Without it, set-group and set-user clear the policy — the command meant to grant access removes it. Actions are named per resource, such as WorkbookRead; policies get shows the ones in use. Resource types are Global, Deployment, Report, ReportFolder, Agent, AgentSpace, Workbook, Dashboard, Folder and ChatThread.

Prefer set-group over set-user. Per-user grants are invisible at review time — nobody audits them, and they outlive the person's reason for having them. If a request is "give Alice access to X", the better answer is usually "which group should Alice be in".

User attributes and row-level security

cube attributes list
cube attributes create --name <name> --type string|number|boolean|string_array|number_array --display-name "<label>"
cube attributes values get <user>

To set a user's value, call the API directly — cube attributes values set has no way to pass a value, so do not use it:

cube api POST /api/v1/user-attribute-values/ -d '{"userId":"<user-id>","userAttributeId":"<attribute-id>","value":<value>}'
cube attributes values get <user>    # confirm it took

Attributes feed the security context, which is what row-level security in the model reads. Changing an attribute value changes what that user sees in every query and every saved report — including scheduled ones that will send new numbers to the same recipients. Say that when you change one.

Tenant settings, SSO, keys

cube tenant settings
cube tenant update --data '<TenantSettingsInput JSON>'   # read settings first

cube oidc list / get / create / update / delete
cube scim users|groups list / get / create / patch / replace / delete   # SCIM JSON via --data
cube scim service-provider-config
cube api-keys list
cube api-keys create --name <name>     # prints the secret once — never echo it
cube api-keys delete <key>             # revokes it immediately
cube integrations list / get / create / update / delete
cube integrations tokens list / get / revoke / initiate

SCIM and OIDC changes affect how everyone authenticates. Read the current config and state what will change before touching either.

When an operation has no command, cube spec <text> finds the API endpoint and its request schema, and cube api <METHOD> <path> -d '<json>' calls it.

Auditing

To answer "who can see X", combine:

  1. cube policies get for the resource.
  2. cube groups list and the user records for who that resolves to.
  3. cube attributes values get for any row-level filtering on top.

An access answer that skips step 3 is incomplete — two users with identical policies can see different rows.

Conventions

  • Report ids, not just names. Names collide; ids are what you act on.
  • Say what changed, for whom, in plain terms. "Removed Alice from analysts; she loses access to deployments 1 and 4" is the useful form.
  • Never rotate or revoke a credential as a side effect of another task.

When something fails

Symptom Cause
403 The account is not an admin on this tenant — report it, do not work around it
User not found Often the wrong tenant; check cube context list
Policy set but access unchanged Group membership or an attribute is overriding it — audit all three layers
SCIM write rejected Provisioning is managed by the IdP; changes belong there, not here
API keys returns the web app instead of JSON That endpoint is unavailable on this tenant, often because the server is older — report it as unavailable, not as an empty list
OIDC returns not available OIDC is disabled or unsupported on this tenant — do not treat the 404 as an empty configuration

04 同仓库更多 Skills

cube-js
cube-js/cube-agent-skills

cube-run-query

Run queries against a Cube deployment's semantic layer and interpret the results — through the Cube MCP tools when they are connected, or the Cube CLI from a terminal. Use whenever someone wants numbers out of Cube — pull a metric, check a total, compare periods, verify that a measure returns what it should, sanity-check a model change. Triggers on "how many", "what's the total", "show me revenue by month", "did that measure work", "what's our MoM growth", "pull the numbers for", and any request to verify a model change against real data. To find out what is queryable first use cube-explore-model; to change the model use cube-build-model; to save a result as a report or dashboard use cube-build-content.

★ 4
cube-js
cube-js/cube-agent-skills

cube-explore-model

Search and inspect a Cube semantic model — cubes, views, measures, dimensions, joins, and the files they live in — through the Cube MCP tools or the Cube CLI. Use whenever someone wants to know what data is available in Cube, where a metric is defined, which cube a field belongs to, how two cubes join, or what a change would affect. Triggers on "what can I query", "what measures do we have", "where is revenue defined", "show me the data model", "what's in this deployment", "which cube has customer email", and impact questions like "what breaks if I rename this". Read the model with this skill before changing it. To edit the model use cube-build-model; to run a query and get numbers back use cube-run-query; to browse workbooks, dashboards and reports use cube-explore-content.

★ 4
cube-js
cube-js/cube-agent-skills

cube-explore-content

Find and inspect saved content in a Cube workspace — workbooks, dashboards, reports, folders and scheduled notifications — using the Cube CLI, or the Cube MCP tools for content you already have a link to. Use whenever someone wants to know what already exists rather than build something new: locate a dashboard, list reports, see what a report queries, find who a notification goes to, or check what saved content references a model field before renaming it. Triggers on "what dashboards do we have", "find the revenue report", "where is that workbook", "what's in this folder", "who gets this scheduled report", "is anything using this field". To create or edit content use cube-build-content; to inspect the semantic model itself use cube-explore-model.

★ 4
cube-js
cube-js/cube-agent-skills

cube-embed

Set up and debug Cube embedded analytics — embed sessions, embed tokens, embeddable dashboards and embed tenants — using the Cube CLI. Use whenever someone is shipping Cube analytics inside their own product: mint a session for an end user, enable a dashboard for embedding, set up multi-tenant isolation so each customer sees only their data, or debug why an embedded view is empty or unauthorized. Triggers on "embed this dashboard", "embedded analytics", "our customers need to see", "multi-tenant analytics", "the iframe is blank", "embed token", "sign the embed URL", "customer-facing dashboard". For internal access control use cube-admin; for the dashboards themselves use cube-build-content.

★ 4
cube-js
cube-js/cube-agent-skills

cube-deploy

Manage Cube deployments and their lifecycle — create deployments, deploy a project, check build status, manage environments and environment variables, connect a GitHub repo, and tail logs — using the Cube CLI. Use whenever someone wants to ship, configure or debug a deployment rather than change the model inside one. Triggers on "deploy this", "did the build pass", "why did the build fail", "set an environment variable", "create a deployment", "connect our repo", "show me the logs", "what regions are available", "the deployment is down". To change model files use cube-build-model; for users and access use cube-admin.

★ 4
cube-js
cube-js/cube-agent-skills

cube-configure-agent

Inspect and tune Cube's in-product AI agent — its rules, certified queries and Agent Skills — by authoring markdown in the semantic model, through the Cube MCP tools or the Cube CLI. Use whenever someone wants the Cube agent to answer better: teach it a business definition, stop it making a recurring mistake, certify a trusted query, capture a repeatable workflow as a skill, or find out why it answered the way it did. Triggers on "the agent keeps getting X wrong", "teach the agent that", "make the agent always", "add a certified query", "create an agent skill", "why did the agent say that", "what rules does the agent have". To change the underlying model use cube-build-model; to explore what is queryable use cube-explore-model.

★ 4