Skip to content

Commit

Permalink
Improve CLI docs page (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
melroy89 authored Dec 11, 2024
1 parent c60b446 commit bd51d35
Showing 1 changed file with 63 additions and 20 deletions.
83 changes: 63 additions & 20 deletions docs/02-admin/04-running-mbin/05-cli.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,36 @@
# CLI

When you are the server administrator of the Mbin instance and you have access to the terminal / shell (via SSH for example), Mbin provides you several console commands.

> [!WARNING]
> We assume you are in the root directory of the Mbin instance (eg. `/var/www/mbin`),
> this is the directory location where you want to execute console commands listed below.
> [!WARNING]
> Run the commands as the correct user. In case you used the `mbin` user during setup,
> switch to the mbin user fist via: `sudo -u mbin bash`
> (or if you used the `www-data` user during setup: `sudo -u www-data bash`).
> This prevent potential unwanted file permission issues.
## Getting started

List all available console commands, execute:

```bash
php bin/console
```

In the next chapters the focus is on the `mbin` section of the `bin/console` console commands and go into more detail.

## User Management

### User-Create

This command allows you to create user, optionally granting administrator or global moderator privileges.

Usage:
```shell

```bash
php bin/console mbin:user:create [-r|--remove] [--admin] [--moderator] <username> <email> <password>
```

Expand All @@ -26,7 +50,8 @@ Options:
This command allows you to grant administrator privileges to the user.

Usage:
```shell

```bash
php bin/console mbin:user:admin [-r|--remove] <username>
```

Expand All @@ -41,7 +66,8 @@ This command will delete the supplied user and notify the fediverse about it. Th
so you will not see the change immediately.

Usage:
```shell

```bash
php bin/console mbin:user:delete <user>
```

Expand All @@ -52,7 +78,8 @@ Arguments:
This command allows you to grant global moderator privileges to the user.

Usage:
```shell

```bash
php bin/console mbin:user:moderator [-r|--remove] <username>
```

Expand All @@ -66,7 +93,8 @@ Options:
This command allows you to manually set or reset a users' password.

Usage:
```shell

```bash
php bin/console mbin:user:password <username> <password>
```

Expand All @@ -78,7 +106,8 @@ Arguments:
This command allows you to manually activate or deactivate a user, bypassing email verification requirement.

Usage:
```shell

```bash
php bin/console mbin:user:verify [-a|--activate] [-d|--deactivate] <username>
```

Expand All @@ -100,7 +129,8 @@ Options:
Removes all followers from a user.

Usage:
```shell

```bash
php bin/console mbin:user:unsub <username>
```

Expand All @@ -114,7 +144,8 @@ Arguments:
This command allows you to create, delete and purge magazines.

Usage:
```shell

```bash
php bin/console mbin:magazine:create [-o|--owner OWNER] [-r|--remove] [--purge] [--restricted] [-t|--title TITLE] [-d|--description DESCRIPTION] <name>
```

Expand All @@ -136,7 +167,8 @@ Options:
This command allows to subscribe a user to a magazine.

Usage:
```shell

```bash
php bin/console mbin:magazine:sub [-u|--unsub] <magazine> <username>
```

Expand All @@ -152,7 +184,8 @@ Options:
Remove all the subscribers from a magazine.

Usage:
```shell

```bash
php bin/console mbin:magazine:unsub <magazine>
```

Expand All @@ -169,7 +202,8 @@ Arguments:
This command allows you to move entries to a new magazine based on their tag.

Usage:
```shell

```bash
php bin/console mbin:entries:move <magazine> <tag>
```

Expand All @@ -185,7 +219,8 @@ Arguments:
This command allows you to move posts to a new magazine based on their tag.

Usage:
```shell

```bash
php bin/console mbin:posts:move <magazine> <tag>
```

Expand All @@ -201,7 +236,8 @@ Arguments:
This command will assign magazines to posts based on their tags.

Usage:
```shell

```bash
php bin/console mbin:posts:magazines
```

Expand All @@ -215,7 +251,8 @@ php bin/console mbin:posts:magazines
This command will allow you to update remote actor (user/magazine) info.

Usage:
```shell

```bash
php bin/console mbin:actor:update [--users] [--magazines] [--force] [<user>]
```

Expand All @@ -234,7 +271,8 @@ Options:
This command allows you to import an AP resource.

Usage:
```shell

```bash
php bin/console mbin:ap:import <url>
```

Expand All @@ -252,7 +290,8 @@ It executes the `liip:imagine:cache:resolve` command for every user- and magazin
> This command will trigger **a lot** of processing if you execute it on a long-running server.
Usage:
```shell

```bash
php bin/console mbin:cache:build
```

Expand All @@ -264,7 +303,8 @@ php bin/console mbin:cache:build
Removes all accounts that are marked for deletion today or in the past.

Usage:
```shell

```bash
php bin/console mbin:users:remove-marked-for-deletion
```

Expand All @@ -276,7 +316,8 @@ php bin/console mbin:users:remove-marked-for-deletion
This command removes all failed messages from the failed queue (database).

Usage:
```shell

```bash
php bin/console mbin:messenger:failed:remove_all
```

Expand All @@ -288,7 +329,8 @@ php bin/console mbin:messenger:failed:remove_all
This command removes all dead messages from the dead queue (database).

Usage:
```shell

```bash
php bin/console mbin:messenger:dead:remove_all
```

Expand All @@ -300,6 +342,7 @@ This command removes post and user duplicates by their ActivityPub ID.
> We've had a unique index on the ActivityPub ID for a while, hence this command should not do anything
Usage:
```shell

```bash
php bin/console mbin:user:create [-r|--remove] [--admin] [--moderator] [--] <username> <email> <password>
```

0 comments on commit bd51d35

Please sign in to comment.