Admin CLI
The admin command line tool, python -m scripts.workspace_admin, manages organizations, users, data backends and widget plugins from a terminal. The script is backend-api/backend/scripts/workspace_admin.py. It runs inside the API container and works on the database directly, so it sends no request to the API and needs no session. The tool is therefore the way to administer a deployment before anyone can sign in.
Commands belong to a noun, such as user or plugin, and each command has its own arguments. The option --json prints the outcome of a command as JSON. A command that cannot do what was asked prints the reason and exits with status 1.
The sections below list the commands of each noun with their arguments. The page is generated from the parser that the script builds, through backend-api/backend/reference-data/admin_cli.json, which the backend's exporter writes.
entity
The entity commands manage organizations, which the tool calls entities.
python -m scripts.workspace_admin entity
Manage organization entities
python -m scripts.workspace_admin entitypython -m scripts.workspace_admin entity create
Create a new entity
python -m scripts.workspace_admin entity createArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--config, -cflagrequiredPath to JSON config file with entity details
python -m scripts.workspace_admin entity list
List all entities
python -m scripts.workspace_admin entity listArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--pageflagdefault1Page number (default: 1)
--sizeflagdefault100Items per page (default: 100)
--removedflagdefaultfalseList the removed entities instead
python -m scripts.workspace_admin entity sample
Print a sample entity config
python -m scripts.workspace_admin entity samplepython -m scripts.workspace_admin entity show
Show details of a specific entity
python -m scripts.workspace_admin entity showArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the entity
python -m scripts.workspace_admin entity update
Update an existing entity
python -m scripts.workspace_admin entity updateArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the entity
--config, -cflagPath to JSON file containing fields to update
--data, -dflagJSON string with fields to update (e.g. '{"sharing_enabled": true}')
python -m scripts.workspace_admin entity delete
Remove an entity that has no users; entity restore brings it back
python -m scripts.workspace_admin entity deleteArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the entity
python -m scripts.workspace_admin entity restore
Restore a removed entity
python -m scripts.workspace_admin entity restoreArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the removed entity
--nameflagName to give the entity (default: the name it had before)
user
The user commands manage users.
python -m scripts.workspace_admin user
Manage users within entities
python -m scripts.workspace_admin userpython -m scripts.workspace_admin user create
Create a user in an entity and print the link that sets their password
python -m scripts.workspace_admin user createArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the target entity
--emailflagrequiredUser's email address
--first-nameflagrequiredUser's first name
--last-nameflagrequiredUser's last name
--role"admin" | "developer" | "user"defaultuserUser type (default: user)
python -m scripts.workspace_admin user list
List users (globally or filtered)
python -m scripts.workspace_admin user listArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--pageflagdefault1Page number (default: 1)
--sizeflagdefault100Items per page (default: 100)
--emailflagOnly users whose email contains this
python -m scripts.workspace_admin user delete
Remove a user from their entity
python -m scripts.workspace_admin user deleteArguments
--jsonflagdefaultfalsePrint the outcome as JSON
emailargumentrequiredEmail address of the user to remove
python -m scripts.workspace_admin user reset-password
Reset a user's password and print the link that sets a new one
python -m scripts.workspace_admin user reset-passwordArguments
--jsonflagdefaultfalsePrint the outcome as JSON
emailargumentrequiredEmail address of the user
python -m scripts.workspace_admin user move
Move a user to another entity
python -m scripts.workspace_admin user moveArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--entity-uuidflagrequiredUUID of the target entity
--emailflagrequiredEmail address of the user to move
--role"admin" | "developer" | "user"defaultuserUser type in the new entity (default: user)
data-backend
The data-backend commands manage the data backends of an organization.
python -m scripts.workspace_admin data-backend
Manage entity data backends
python -m scripts.workspace_admin data-backendpython -m scripts.workspace_admin data-backend add
Add a data backend to an entity
python -m scripts.workspace_admin data-backend addArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the target entity
--nameflagrequiredName of the data backend
--urlflagrequiredURL of the data backend
--headerflagrepeatableEndpoint header as key:value or key:value:location (repeatable)
python -m scripts.workspace_admin data-backend delete
Remove a data backend from an entity
python -m scripts.workspace_admin data-backend deleteArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the target entity
--nameflagrequiredName of the data backend to remove
python -m scripts.workspace_admin data-backend list
List data backends for an entity
python -m scripts.workspace_admin data-backend listArguments
--jsonflagdefaultfalsePrint the outcome as JSON
entity_uuidargumentrequiredUUID of the target entity
provision
The provision commands set up an organization in bulk from one configuration file. A run creates the organization together with its administrators and its users. The commands check a file, apply it, and print a sample file.
python -m scripts.workspace_admin provision
Bulk provisioning
python -m scripts.workspace_admin provisionpython -m scripts.workspace_admin provision check
Validate a provisioning config file
python -m scripts.workspace_admin provision checkArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--config, -cflagrequiredPath to JSON config file
python -m scripts.workspace_admin provision sample
Print a sample provisioning config
python -m scripts.workspace_admin provision samplepython -m scripts.workspace_admin provision apply
Create the entity, admins and users of a config
python -m scripts.workspace_admin provision applyArguments
--jsonflagdefaultfalsePrint the outcome as JSON
--config, -cflagrequiredPath to JSON defining entity and users
plugin
The plugin commands review and administer widget plugins. Plugin lifecycle and administration explains the workflow.
python -m scripts.workspace_admin plugin
Review and enable widget plugins (packages are placed on the server, never installed from here)
python -m scripts.workspace_admin pluginpython -m scripts.workspace_admin plugin list
List discovered plugins and versions
python -m scripts.workspace_admin plugin listArguments
--jsonflagdefaultfalsePrint the outcome as JSON
python -m scripts.workspace_admin plugin rescan
Read the plugins directory again
python -m scripts.workspace_admin plugin rescanArguments
--jsonflagdefaultfalsePrint the outcome as JSON
python -m scripts.workspace_admin plugin show
Show a plugin: versions, what approving accepts, policy, organizations, events
python -m scripts.workspace_admin plugin showArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin approve
Review a version and make it the active one
python -m scripts.workspace_admin plugin approveArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
versionargumentrequiredThe version to approve
--acknowledgeflagdefaultfalseAccept every added request the review lists (without it, only the review is shown)
--digestflagThe version digest you checked with plugin_check; approval stops if the server's differs
python -m scripts.workspace_admin plugin revoke
Stop a plugin everywhere (kill switch)
python -m scripts.workspace_admin plugin revokeArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin restore
Undo a revoke
python -m scripts.workspace_admin plugin restoreArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin enable
Enable the plugin for an organization, or for all
python -m scripts.workspace_admin plugin enableArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
--entityflagUUID of the organization (entity)
--allflagEvery organization
python -m scripts.workspace_admin plugin disable
Disable the plugin for an organization, or for all
python -m scripts.workspace_admin plugin disableArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
--entityflagUUID of the organization (entity)
--allflagEvery organization
python -m scripts.workspace_admin plugin grant
Grant a role a plugin's widgets: roles are the only way to a plugin
python -m scripts.workspace_admin plugin grantArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
--roleflagrequiredUUID of the role
--widgetflagdefault*One widget id (default: every widget)
python -m scripts.workspace_admin plugin ungrant
Take a grant away from a role
python -m scripts.workspace_admin plugin ungrantArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
--roleflagrequiredUUID of the role
--widgetflagdefault*One widget id (default: every widget)
python -m scripts.workspace_admin plugin override
Replace the superuser's overrides: the CSP by directive and the server network
python -m scripts.workspace_admin plugin overrideArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
--csp-fileflagJSON file of directive to sources, e.g. {"connect-src": ["https://<host>"]}
--server-networkflagrepeatableAn https origin the server may call for the plugin's proxies, replacing the hosts it declares (repeatable)
--clearflagdefaultfalseRemove the overrides
--confirm"insecure-scheme" | "private-host" | "remote-script"repeatableConfirm a dangerous source the overrides add (repeatable); private-host with --server-network also lets those hosts resolve to private addresses
python -m scripts.workspace_admin plugin secret
Set or clear the value of a secret the plugin declares
python -m scripts.workspace_admin plugin secretpython -m scripts.workspace_admin plugin secret set
Set the value: read without echo, or from standard input, never an argument
python -m scripts.workspace_admin plugin secret setArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
nameargumentrequiredThe secret's name, as the plugin declares it
python -m scripts.workspace_admin plugin secret clear
Remove the value a superuser set
python -m scripts.workspace_admin plugin secret clearArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
nameargumentrequiredThe secret's name, as the plugin declares it
python -m scripts.workspace_admin plugin check-backend
Ask the plugin's backend for its identity now (the deployer runs and lists it)
python -m scripts.workspace_admin plugin check-backendArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin events
List the plugin's events
python -m scripts.workspace_admin plugin eventsArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin reports
List requests the plugin's policy blocked
python -m scripts.workspace_admin plugin reportsArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id
python -m scripts.workspace_admin plugin forget
Forget a plugin whose files are gone, with its decisions, grants and secrets
python -m scripts.workspace_admin plugin forgetArguments
--jsonflagdefaultfalsePrint the outcome as JSON
plugin_idargumentrequiredThe plugin's id