Skip to content

Commit 1b383cd

Browse files
committed
feat: add user management
1 parent e168798 commit 1b383cd

File tree

6 files changed

+1831
-14
lines changed

6 files changed

+1831
-14
lines changed

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ SystemLink CLI (`slcli`) is a cross-platform Python CLI for SystemLink integrato
77
- **Secure Authentication**: Credential storage using [keyring](https://github.com/jaraco/keyring) with `login`/`logout` commands
88
- **Test Plan Templates**: Complete management (list, export, import, delete, init) with JSON and table output formats
99
- **Jupyter Notebooks**: Full lifecycle management (list, download, create, update, delete) with workspace filtering
10+
- **User Management**: Comprehensive user administration (list, get, create, update, delete) with Dynamic LINQ filtering and pagination
1011
- **Workflows**: Full workflow management (list, export, import, delete, init, update) with comprehensive state and action definitions
1112
- **Workspace Management**: Essential workspace administration (list, info, disable) with comprehensive resource details
1213
- **Cross-Platform**: Windows, macOS, and Linux support with standalone binaries
@@ -87,6 +88,12 @@ For development or if Homebrew isn't available:
8788

8889
# View notebooks
8990
slcli notebook list
91+
92+
# View users
93+
slcli user list
94+
95+
# View workspaces
96+
slcli workspace list
9097
```
9198

9299
3. **Initialize new resources:**
@@ -321,6 +328,84 @@ slcli notebook update --id <notebook_id> --metadata metadata.json --content myno
321328
slcli notebook delete --id <notebook_id>
322329
```
323330

331+
## User Management
332+
333+
SystemLink CLI provides comprehensive user management capabilities for administering users in your SystemLink environment through the User Service API.
334+
335+
### List users
336+
337+
```bash
338+
# List all users (table format, default)
339+
slcli user list
340+
341+
# JSON format for programmatic use
342+
slcli user list --format json
343+
344+
# Filter users with Dynamic LINQ queries
345+
slcli user list --filter 'firstName.StartsWith("John") && status == "active"'
346+
347+
# Sort by different fields
348+
slcli user list --sortby firstName --order descending
349+
350+
# Limit number of results
351+
slcli user list --take 25
352+
```
353+
354+
### Get user details
355+
356+
```bash
357+
# Get user details by ID (table format)
358+
slcli user get --id <user_id>
359+
360+
# Get user details by email (table format)
361+
slcli user get --email "john.doe@example.com"
362+
363+
# JSON output
364+
slcli user get --id <user_id> --format json
365+
slcli user get --email "jane.smith@example.com" --format json
366+
```
367+
368+
### Create a new user
369+
370+
```bash
371+
# Create a basic user
372+
slcli user create --first-name "John" --last-name "Doe" --email "john.doe@example.com"
373+
374+
# Create user with additional details
375+
slcli user create \
376+
--first-name "Jane" \
377+
--last-name "Smith" \
378+
--email "jane.smith@example.com" \
379+
--niua-id "jane.smith" \
380+
--accepted-tos \
381+
--policies "policy1,policy2" \
382+
--keywords "developer,qa" \
383+
--properties '{"department": "Engineering", "location": "Austin"}'
384+
```
385+
386+
### Update an existing user
387+
388+
```bash
389+
# Update user's name
390+
slcli user update --id <user_id> --first-name "Jane"
391+
392+
# Update multiple fields
393+
slcli user update --id <user_id> \
394+
--email "new.email@example.com" \
395+
--accepted-tos true \
396+
--policies "policy3,policy4"
397+
398+
# Update custom properties
399+
slcli user update --id <user_id> --properties '{"role": "Senior Developer"}'
400+
```
401+
402+
### Delete a user
403+
404+
```bash
405+
# Delete user (with confirmation prompt)
406+
slcli user delete --id <user_id>
407+
```
408+
324409
## Workspace Management
325410

326411
SystemLink CLI provides essential workspace management capabilities for viewing and administering workspaces in your SystemLink environment.

slcli/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from .notebook_click import register_notebook_commands
1111
from .templates_click import register_templates_commands
12+
from .user_click import register_user_commands
1213
from .workflows_click import register_workflows_commands
1314
from .workspace_click import register_workspace_commands
1415

@@ -101,5 +102,6 @@ def logout():
101102

102103
register_templates_commands(cli)
103104
register_notebook_commands(cli)
105+
register_user_commands(cli)
104106
register_workflows_commands(cli)
105107
register_workspace_commands(cli)

0 commit comments

Comments
 (0)