The mmctl tool is a remote CLI tool for Mattermost which is installed locally and uses the Mattermost API. Authentication
is done with either login credentials or an authentication token.

Being installed locally allows a System Admin to run CLI commands even in instances where there is no access to the
server (e.g., via SSH). This tool is currently in beta and can be used alongside the Mattermost CLI tool.
In the future, the Mattermost CLI tool will be deprecated.

This feature was developed to a large extent by community contributions and we’d like to extend our gratitude to the contributors who have
worked on this project. We are currently accepting pull requests for Help Wanted issues
in the mattermost-server repo. You can learn more about
the unit test coverage campaign for mmctl in the Unit testing mmctl commands blog post.

Notes

Parameters in CLI commands are order-specific.

If special characters (!, |, (, ), \, ', and ") are used, the entire argument needs to be surrounded by single quotes (e.g. -password'mypassword!', or the individual characters need to be escaped out (e.g. passwordmypassword\!).

Team name and channel name refer to the handles, not the display names. So in the URL https://community.mattermost.com/core/channels/town-square team name would be core and channel name would be town-square.

Options

--format string the format of the command output [plain, json](default "plain")
-h, --help helpfor mmctl
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

-a, --access-token string Access token to use instead of username/password
-h, --help help for login
-m, --mfa-token string MFA token for the credentials
-n, --name string Name for the credentials
--no-activate If present, it won't activate the credentials after login
-p, --password string Password for the credentials
-u, --username string Username for the credentials

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Authenticate to a server (e.g. >mmctl auth login https://test.mattermost.com), then enter your username and password
(and MFA token if MFA is enabled on the account).

--description string Optional. The description text for the new bot.
--display-name string Optional. The display name for the new bot.
-h, --help helpfor create

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Add users to a channel. If adding multiple users, use a space-separated list.

Format

mmctl channel add [channel][users][flags]

Examples

channel add myteam:mychannel user@example.com username

Options

-h, --help helpfor add

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Archive one or multiple channels along with all related information including posts from the database. Channels can be
specified by [team]:[channel] (i.e., myteam:mychannel) or by channel ID).

Format

mmctl channel archive [channels][flags]

Examples

channel archive myteam:mychannel

Options

-h, --help helpfor archive

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

List all public and archived channels on specified teams. Archived channels are appended with ‘(archived)’.

Format

mmctl channel list [teams][flags]

Examples

channel list myteam

Options

-h, --help helpfor list

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Set the type of a channel from public to private. Channel can be specified by [team]:[channel] (i.e., myteam:mychannel)
or by channel ID.

Format

mmctl channel make_private [channel][flags]

Examples

channel make_private myteam:mychannel

Options

-h, --help helpfor make_private

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

-h, --help helpfor modify
--private Convert the channel to a private channel
--public Convert the channel to a public channel

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Restore a previously deleted channel. Channels can be specified by [team]:[channel] (e.g., myteam:mychannel) or by channel ID.

Format

mmctl channel restore [channels][flags]

Examples

channel restore myteam:mychannel

Options

-h, --help helpfor restore

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Move a slash command to a different team. Commands can be specified by command ID.

Format

mmctl command move [team][commandID][flags]

Examples

command move newteam commandID

Options

-h, --help helpfor move

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Show a custom slash command. Commands can be specified by command ID. Returns command ID, team ID, trigger word, display name and creator username.

Format

mmctl command[commandID][flags]

Examples

command show commandID

Options

-h, --help helpfor show

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Opens the editor defined in the EDITOR environment variable to modify the server’s configuration and then uploads it.

Format

mmctl config edit [flags]

Examples

config edit

Options

-h, --help helpfor edit

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Sets the value of a config setting by its name in dot notation. Accepts multiple values for array settings.

Format

mmctl config set[flags]

Examples

config set SqlSettings.DriverName mysql

Options

-h, --help helpforset

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Add one or more permissions to an existing role (only available in E10 and E20).

Format

mmctl permissions add [role][permission...][flags]

Examples

permissions add system_user list_open_teams

Options

-h, --help helpfor add

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Remove one or more permissions from an existing role (only available in E10 and E20).

Format

mmctl permissions remove [role][permission...][flags]

Examples

permissions remove system_user list_open_teams

Options

-h, --help helpfor remove

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Disable plugins. Disabled plugins are immediately removed from the user interface and logged out of all sessions.

Format

mmctl plugin disable [plugins][flags]

Examples

plugin disable hovercardexample pluginexample

Options

-h, --help helpfor disable

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Gets the server busy state (high load) and timestamp corresponding to when the server busy flag will be automatically cleared.

Format

mmctl system getbusy [flags]

Examples

system getbusy

Options

-h, --help helpfor getbusy

Options Inherited from Parent Commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Set the busy state to true for the specified number of seconds, which disables non-critical services.

Format

mmctl system setbusy -s [seconds][flags]

Examples

system setbusy -s 3600

Options

-h, --help helpfor setbusy
-s, --seconds uint Number of seconds until server is automatically marked as not busy. (default 3600)

Options Inherited from Parent Commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows to use insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Archives a team along with all related information including posts from the database.

Format

mmctl team archive [teams][flags]

Examples

team archive myteam

Options

--confirm Confirm you really want to archive the team and a DB backup has been performed.
-h, --help helpfor archive

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--display_name string Team Display Name
--email string Administrator Email (anyone with this email is automatically a team admin)
-h, --help helpfor create
--name string Team Name
--private Create a private team

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Permanently deletes a team along with all related information including posts from the database.

Format

mmctl team delete [teams][flags]

Examples

team delete myteam

Options

--confirm Confirm you really want to delete the team and a DB backup has been performed
-h, --help helpfor delete

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--email string Required. The email address for the new user account
--firstname string Optional. The first name for the new user account
-h, --help helpfor create
--lastname string Optional. The last name for the new user account
--locale string Optional. The locale (ex: en, fr)for the new user account
--nickname string Optional. The nickname for the new user account
--password string Required. The password for the new user account
--system_admin Optional. If supplied, the new user will be a system administrator. Defaults to false
--username string Required. Username for the new user account

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Deactivate users. Deactivated users are immediately logged out of all sessions and are unable to log back in.

Format

mmctl user deactivate [emails, usernames, userIds][flags]

Examples

user deactivate user@example.com
user deactivate username

Options

-h, --help helpfor deactivate

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--all Fetch all users. --page flag will be ignore if provided
-h, --help helpfor list
--page int Page number to fetch for the list of users
--per-page int Number of users to be fetched (default 200)

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

Turn off multi-factor authentication for a user. If MFA enforcement is enabled, the
user will be forced to re-enable MFA as soon as they login.

Format

mmctl user resetmfa [users][flags]

Examples

user resetmfa user@example.com

Options

-h, --help helpfor resetmfa

Options inherited from parent commands

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one

--format string the format of the command output [plain, json](default "plain")
--insecure-sha1-intermediate allows the use of insecure TLS protocols, such as SHA-1
--strict will only run commands if the mmctl version matches the server one