tg-create-user
Create a user in the caller’s workspace.
Synopsis
tg-create-user --username USER [options]
Description
Creates a new user in the caller’s workspace. The new user’s ID is printed to stdout on success. A password is prompted interactively if not provided on the command line. Roles default to reader if not specified. The --must-change-password flag can be set to force the user to change their password on first login.
Options
Required Arguments
| Option | Description |
|---|---|
--username USERNAME | Username for the new user |
Optional Arguments
| Option | Default | Description |
|---|---|---|
-u, --api-url URL | $TRUSTGRAPH_URL or http://localhost:8088/ | TrustGraph API URL |
-t, --token TOKEN | $TRUSTGRAPH_TOKEN | Authentication token |
--password PASSWORD | Prompted interactively | Password for the new user |
--name NAME | None | Display name |
--email EMAIL | None | Email address |
--roles ROLE [ROLE ...] | reader | Roles to assign |
--must-change-password | false | Force password change on first login |
-w, --workspace WORKSPACE | Caller’s workspace | Target workspace |
Examples
# Create a user with default role (reader)
tg-create-user --username alice
# Create a user with full details
tg-create-user --username bob --name "Bob Smith" --email bob@example.com \
--roles reader writer --password secret123
# Create a user who must change their password on first login
tg-create-user --username charlie --must-change-password
# Create a user in a specific workspace
tg-create-user --username dave -w research-team
Environment Variables
TRUSTGRAPH_URL: Default API URLTRUSTGRAPH_TOKEN: Authentication token
Related Commands
tg-list-users- List users in the workspacetg-update-user- Update user profile fieldstg-disable-user- Disable a usertg-enable-user- Re-enable a disabled usertg-delete-user- Delete a user permanentlytg-reset-password- Reset another user’s password