summaryrefslogtreecommitdiff
path: root/docs/admin/cli.md
blob: 8072a5d7a1872dcebaa8cc3a5c9ee2d9a129824a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# GtS CLI Tool

GoToSocial compiles to an executable binary.

The standard way of using this binary is to run a server with the `gotosocial server start` command.

However, this binary can also be used as an admin tool.

Here's the full output of `gotosocial --help`, without the big list of global config options.

```text
NAME:
   gotosocial - a fediverse social media server

USAGE:
   gotosocial [global options] command [command options] [arguments...]

VERSION:
   0.1.0-SNAPSHOT a940a52

COMMANDS:
   server   gotosocial server-related tasks
   admin    gotosocial admin-related tasks
   testrig  gotosocial testrig tasks
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   [a huge list of global options -- too much to show here]
```

Under `COMMANDS`, you can see the standard `server` command. But there are also commands doing admin and testing etc, which will be explained in this document.

**Please note -- for all of these commands, you will still need to set the global options correctly so that the CLI tool knows how eg., how to connect to your database, which database to use, which host and account domain to use etc.**

You can set these global options using environment variables, passing them as CLI variables after the `gotosocial` part of the command (eg., `gotosocial --host example.org [commands]`), or by just pointing the CLI tool towards your config file (eg., `gotosocial --config-path ./config.yaml [commands]`).

## gotosocial admin

Contains `account` subcommands.

### gotosocial admin account create

This command can be used to create a new account on your instance.

`gotosocial admin account create --help`:

```text
NAME:
   gotosocial admin account create - create a new account

USAGE:
   gotosocial admin account create [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --email value     the email address of this account
   --password value  the password to set for this account
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account create \
   --username some_username \
   --email someuser@example.org \
   --password 'somelongandcomplicatedpassword'
```

### gotosocial admin account confirm

This command can be used to confirm a user+account on your instance, allowing them to log in and use the account.

`gotosocial admin account confirm --help`:

```text
NAME:
   gotosocial admin account confirm - confirm an existing account manually, thereby skipping email confirmation

USAGE:
   gotosocial admin account confirm [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account confirm --username some_username
```

### gotosocial admin account promote

This command can be used to promote a user to admin.

`gotosocial admin account promote --help`:

```text
NAME:
   gotosocial admin account promote - promote an account to admin

USAGE:
   gotosocial admin account promote [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account promote --username some_username
```

### gotosocial admin account demote

This command can be used to demote a user from admin to normal user.

`gotosocial admin account demote --help`:

```text
NAME:
   gotosocial admin account demote - demote an account from admin to normal user

USAGE:
   gotosocial admin account demote [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account demote --username some_username
```

### gotosocial admin account disable

This command can be used to disable an account: prevent it from signing in or doing anything, without deleting data.

`gotosocial admin account disable --help`:

```text
NAME:
   gotosocial admin account disable - prevent an account from signing in or posting etc, but don't delete anything

USAGE:
   gotosocial admin account disable [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account disable --username some_username
```

### gotosocial admin account suspend

This command can be used to completely remove an account's media/posts/etc and prevent it from logging in.

In other words, this 'deletes' the account (without actually removing the account entry, meaning the username cannot be used again).

`gotosocial admin account suspend --help`:

```text
NAME:
   gotosocial admin account suspend - completely remove an account and all of its posts, media, etc

USAGE:
   gotosocial admin account suspend [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account suspend --username some_username
```

### gotosocial admin account password

This command can be used to set a new password on the given account.

`gotosocial admin account password --help`:

```text
NAME:
   gotosocial admin account password - set a new password for the given account

USAGE:
   gotosocial admin account password [command options] [arguments...]

OPTIONS:
   --username value  the username to create/delete/etc
   --password value  the password to set for this account
   --help, -h        show help (default: false)
```

Example:

```bash
gotosocial admin account password --username some_username --pasword some_really_good_password
```