Skip to content

Commit b586fe6

Browse files
authored
Document more mas-cli subcommands and standardise the format (#3988)
Added all the missing commands, and tried to standardise the formatting across the various pages.
2 parents b5ec07d + 1490e42 commit b586fe6

File tree

9 files changed

+155
-6
lines changed

9 files changed

+155
-6
lines changed

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
- [`database`](./reference/cli/database.md)
3434
- [`manage`](./reference/cli/manage.md)
3535
- [`server`](./reference/cli/server.md)
36+
- [`worker`](./reference/cli/worker.md)
3637
- [`templates`](./reference/cli/templates.md)
3738
- [`doctor`](./reference/cli/doctor.md)
3839

docs/reference/cli/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Valid levels from least to most verbose are `error`, `warn`, `info`, `debug` and
1515
Sets the configuration file to load.
1616
It can be repeated multiple times to merge multiple files together.
1717

18+
### `--help`
19+
20+
Print out help instructions.
21+
22+
### `--version`
23+
24+
Print the mas cli version.
25+
1826
---
1927

2028
```
@@ -33,4 +41,5 @@ Commands:
3341
Options:
3442
-c, --config <CONFIG> Path to the configuration file
3543
-h, --help Print help
44+
-V, --version Print version
3645
```

docs/reference/cli/config.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Helps to deal with the configuration
44

5+
Global options:
6+
- `--config <config>`: Path to the configuration file.
7+
- `--help`: Print help.
8+
59
## `config check`
610

711
Check the validity of configuration files.

docs/reference/cli/database.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
Run database-related operations
44

5+
Global options:
6+
- `--config <config>`: Path to the configuration file.
7+
- `--help`: Print help.
8+
59
## `database migrate`
610

7-
Run the pending database migrations
11+
Run the pending database migrations.
812

913
```
1014
$ mas-cli database migrate
11-
```
15+
```

docs/reference/cli/doctor.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# `doctor`
22

3+
Global options:
4+
- `--config <config>`: Path to the configuration file.
5+
- `--help`: Print help.
6+
7+
## `doctor`
8+
39
Run diagnostics on the live deployment.
410
This tool should help diagnose common issues with the service configuration and deployment.
511

612
When running this tool, make sure it runs from the same point-of-view as the service, with the same configuration file and environment variables.
713

814
```
915
$ mas-cli doctor
10-
```
16+
```

docs/reference/cli/manage.md

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,104 @@
11
# `manage`
22

3-
Includes admin-related subcommands.
43

5-
## `manage verify-email <username> <email>`
4+
The MAS CLI provides several subcommands for managing users and configurations
65

7-
Mark a user email address as verified
6+
Global options:
7+
- `--config <config>`: Path to the configuration file.
8+
- `--help`: Print help.
9+
10+
## `manage add-email`
11+
12+
Add an email address to the specified user.
13+
14+
```
15+
$ mas-cli manage add-email <username> <email>
16+
```
17+
18+
## `manage verify-email`
19+
20+
[DEPRECATED] Mark an email address as verified.
21+
22+
```
23+
$ mas-cli manage verify-email <username> <email>
24+
```
25+
26+
## `manage set-password`
27+
28+
Set a user password.
29+
30+
Options:
31+
- `--ignore-complexity`: Don't enforce that the password provided is above the minimum configured complexity.
32+
33+
```
34+
$ mas-cli manage set-password <username> <password> --ignore-complexity
35+
```
36+
37+
## `manage issue-compatibility-token`
38+
39+
Issue a compatibility token for a user.
40+
41+
Options:
42+
- `--device-id <device_id>`: Device ID to set in the token. If not specified, a random device ID will be generated.
43+
- `--yes-i-want-to-grant-synapse-admin-privileges`: Whether the token should be given admin privileges.
44+
45+
```
46+
$ mas-cli manage issue-compatibility-token <username> --device-id <device_id> --yes-i-want-to-grant-synapse-admin-privileges
47+
```
48+
49+
## `manage provision-all-users`
50+
51+
Trigger a provisioning job for all users.
52+
53+
```
54+
$ mas-cli manage provision-all-users
55+
```
56+
57+
## `manage kill-sessions`
58+
59+
Kill all sessions for a user.
60+
61+
Options:
62+
- `--dry-run`: Do a dry run, ie see which sessions would be killed.
63+
64+
```
65+
$ mas-cli manage kill-sessions <username> --dry-run
66+
```
67+
68+
## `manage lock-user`
69+
70+
Lock a user.
71+
72+
Options:
73+
- `--deactivate`: Whether to deactivate the user.
74+
75+
```
76+
$ mas-cli manage lock-user <username> --deactivate
77+
```
78+
79+
## `manage unlock-user`
80+
81+
Unlock a user.
82+
83+
```
84+
$ mas-cli manage unlock-user <username>
85+
```
86+
87+
## `manage register-user`
88+
89+
Register a user. This will interactively prompt for the user's attributes unless the `--yes` flag is set. It bypasses any policy check on the password, email, etc.
90+
91+
Options:
92+
- `--username <username>`: Username to register.
93+
- `--password <password>`: Password to set.
94+
- `--email <email>`: Email to add. Can be specified multiple times.
95+
- `--upstream-provider-mapping <UPSTREAM_PROVIDER_ID:SUBJECT>`: Upstream OAuth 2.0 provider mapping. Can be specified multiple times.
96+
- `--admin`: Make the user an admin.
97+
- `--no-admin`: Make the user not an admin.
98+
- `--yes`: Don't ask questions, just do it.
99+
- `--display-name <display_name>`: Set the user's display name.
100+
- `--ignore-password-complexity`: Don't enforce that the password provided is above the minimum configured complexity.
101+
102+
```
103+
$ mas-cli manage register-user
104+
```

docs/reference/cli/server.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# `server`
22

3+
Global options:
4+
- `--config <config>`: Path to the configuration file.
5+
- `--help`: Print help.
6+
7+
## `server`
8+
39
Runs the authentication service.
410

11+
Options:
12+
- `--no-migrate`: Do not apply pending database migrations on start.
13+
- `--no-worker`: Do not start the task worker.
14+
- `--no-sync`: Do not sync the configuration with the database.
15+
516
```
617
$ mas-cli server
718
INFO mas_cli::server: Starting task scheduler

docs/reference/cli/templates.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# `templates`
22

3+
Global options:
4+
- `--config <config>`: Path to the configuration file.
5+
- `--help`: Print help.
6+
37
## `templates check`
48

59
Check the validity of the templates loaded by the config.

docs/reference/cli/worker.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# `worker`
2+
3+
Global options:
4+
- `--config <config>`: Path to the configuration file.
5+
- `--help`: Print help.
6+
7+
## `worker`
8+
9+
Runs the authentication service worker.
10+
11+
```
12+
$ mas-cli worker
13+
```

0 commit comments

Comments
 (0)