Code Monkey home page Code Monkey logo

mmctl's Introduction

mmctl CircleCI branch Go Report Card

A remote CLI tool for Mattermost: the Open Source, self-hosted Slack-alternative.

Install

To install the project in your $GOPATH, simply run:

go get -u github.com/mattermost/mmctl

Install shell completions

To install the shell completions for bash, add the following line to your ~/.bashrc or ~/.profile file:

source <(mmctl completion bash)

For zsh, add the following line to file ~/.zshrc:

source <(mmctl completion zsh)

Compile

First we have to install the dependencies of the project. mmctl depends on go version 1.13 or greater.

We can compile the binary with:

make build

Usage

For the usage of all the commands, use the --help flag or check the tool's documentation.

Mattermost offers workplace messaging across web, PC and phones with archiving, search and integration with your existing systems. Documentation available at https://docs.mattermost.com

Usage:
  mmctl [command]

Available Commands:
  auth        Manages the credentials of the remote Mattermost instances
  channel     Management of channels
  completion  Generates autocompletion scripts for bash and zsh
  group       Management of groups
  help        Help about any command
  license     Licensing commands
  logs        Display logs in a human-readable format
  permissions Management of permissions and roles
  plugin      Management of plugins
  post        Management of posts
  team        Management of teams
  user        Management of users
  websocket   Display websocket in a human-readable format

Flags:
  -h, --help   help for mmctl

Use "mmctl [command] --help" for more information about a command.

First we have to log into a mattermost instance:

$ mmctl auth login https://my-instance.example.com --name my-instance --username john.doe --password mysupersecret

  credentials for my-instance: john.doe@https://my-instance.example.com stored

We can check the currently stored credentials with:

$ mmctl auth list

    | Active |        Name | Username |                     InstanceUrl |
    |--------|-------------|----------|---------------------------------|
    |      * | my-instance | john.doe | https://my-instance.example.com |

And now we can run commands normally:

$ mmctl user search john.doe
id: qykfw3t933y38k57ubct77iu9c
username: john.doe
nickname:
position:
first_name: John
last_name: Doe
email: [email protected]
auth_service:

Login methods

Password

$ mmctl auth login https://community.mattermost.com --name community --username my-username --password mysupersecret

The login command can also work interactively, so if you leave any needed flag empty, mmctl will ask you for it interactively:

$ mmctl auth login https://community.mattermost.com
Connection name: community
Username: my-username
Password:

MFA

If you want to login with MFA, you just need to use the --mfa-token flag:

$ mmctl auth login https://community.mattermost.com --name community --username my-username --password mysupersecret --mfa-token 123456

Access tokens

Instead of using username and password to log in, you can generate and use a personal access token to authenticate with a server:

$ mmctl auth login https://community.mattermost.com --name community --access-token MY_ACCESS_TOKEN

mmctl's People

Contributors

3mard avatar cpanato avatar enoldev avatar hanzei avatar jespino avatar jfrerich avatar jimiolaniyan avatar larkox avatar mgdelacroix avatar pushkyn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.