madonctl

A CLI utility for Mastodon API

Synopsis

madonctl is a CLI tool for the Mastodon REST API.

You can use a configuration file to store common options. For example, create $HOME/.config/madonctl/madonctl.yaml with the following contents:

---
instance: "INSTANCE"
login: "USERNAME"
password: "USERPASSWORD"
...

The simplest way to generate a configuration file is to use the 'config dump' command.

(Configuration files in JSON are also accepted.)

If you want shell auto-completion (for bash or zsh), you can generate the completion scripts with "madonctl completion $SHELL". For example if you use bash:

madonctl completion bash > _bash_madonctl
source _bash_madonctl

Now you should have tab completion for subcommands and flags.

Note: Most examples assume the user's credentials are set in the configuration file.

Examples

  madonctl instance
  madonctl toot "Hello, World"
  madonctl toot --visibility direct "@McKael Hello, You"
  madonctl toot --visibility private --spoiler CW "The answer was 42"
  madonctl post --file image.jpg Selfie
  madonctl --instance INSTANCE --login USERNAME --password PASS timeline
  madonctl account notifications --list --clear
  madonctl account blocked
  madonctl account search Gargron
  madonctl search --resolve https://mastodon.social/@Gargron
  madonctl account follow 37
  madonctl account follow Gargron@mastodon.social
  madonctl account follow https://mastodon.social/@Gargron
  madonctl account --account-id 399 statuses
  madonctl status --status-id 416671 show
  madonctl status --status-id 416671 favourite
  madonctl status --status-id 416671 boost
  madonctl account show
  madonctl account show Gargron@mastodon.social
  madonctl account show -o yaml
  madonctl account --account-id 1 followers --template '{{.acct}}{{"\n"}}'
  madonctl config whoami
  madonctl timeline :mastodon

Options

      --color string           Color mode (auto|on|off; for output=template)
      --config string          config file (default is $HOME/.config/madonctl/madonctl.yaml)
  -h, --help                   help for madonctl
  -i, --instance string        Mastodon instance
  -L, --login string           Instance user login
  -o, --output string          Output format (plain|json|yaml|template|theme)
  -P, --password string        Instance user password
      --template string        Go template (for output=template)
      --template-file string   Go template file (for output=template)
      --theme string           Theme name (for output=theme)
  -t, --token string           User token
  -v, --verbose                Verbose mode

SEE ALSO

Auto generated by spf13/cobra on 21-Mar-2018