Which commands need which key
The CLI does not decide who may do what. The API does, on every call, from the key. A command that the key may not run is refused with403, and the CLI exits with 3: the same answer you would get from an SDK or from curl. The CLI only makes what your key may already do easy to find, and each command’s help says what it needs.
API keys explains what makes a key a partner key. To check which one you hold from the CLI,
widgetic auth status says what the key is and where it works, and widgetic api partners get-my-partners answers only a key that acts as a partner: an organisation key gets 403, which is exit code 3.
Which workspace a change goes to
A key works in one workspace, the one it was made for, and nowhere else. It does not follow the workspace you have open on widgetic.com. A person with several workspaces makes a key in each of them (Settings → API keys, with that workspace chosen), and keeps a profile for each. To see where a key works:widgetic auth loginandwidgetic auth statussay which workspace the key works in.widgetic doctorsays it with the plan, on itsWorkspaceline.widgetic mcp get-profilereturns it asworkspace: the name and the plan.
Hold a change to a workspace
Of thewidgetic mcp commands, 13 take --expected-workspace <name>: the ones that start a widget (create-widget, create-widget-batch) and the ones that change a workflow, an A/B test or a translation. widgetic schema mcp <command> says whether a command takes it.
--expected-workspace never picks or switches a workspace. It says where the change is meant for. When the key works anywhere else, the server refuses the call and changes nothing, and the command exits with 5.
A script can say it once for every change it makes, so that it cannot forget:
- A flag, or an
expected_workspacekey in--input, wins overWIDGETIC_WORKSPACEfor that call. - A read is not held, and neither is a command that takes no workspace.
- A hold that cannot be made is not a change that goes through. With the variable set, the CLI stops a change with exit code
2, and sends nothing, when the variable is empty, when this version of the CLI was built from a tool contract that cannot hold a change (runwidgetic update), or when the command is one the CLI does not know (widgetic mcp call <tool>) and--inputhas noexpected_workspace. - Only
widgetic mcpcommands are held. Thewidgetic apicommands are not.
--yes or --json nothing is asked and nothing is added, so a script gives --expected-workspace or sets the variable.
When the workspace has no plan
A key is a credential for a paying workspace. A workspace in its free trial, or one without a plan (the trial ended, the plan was cancelled, the payment ended), is not served, and the CLI is held to the same rule as the key everywhere else (Keys and your workspace plan).- A
widgetic apicommand exits with3and prints the server’s own words and code, with the request id:WORKSPACE_LOCKEDwhen the workspace has no plan,AUTHZ_PLAN_RESTRICTIONfor a free trial or a payment that is overdue. With--jsonthe same fields are inerror. Nothing is retried, and the CLI does not tell you to log in again, because the key is genuine. widgetic auth logindoes not save such a key, and says why.widgetic auth statusreports the key as not accepted, with the code, and keeps the key you saved, so the same key works again as soon as the workspace has a plan.- A free trial is refused at the MCP endpoint itself, so every
widgetic mcpcommand exits with3. A workspace without a plan is let through to the tools, which refuse what starts work in the plan’s own words, and the command exits with5(a tool answered with an error).get_profile, and following or cancelling a build that was already started, still answer.