Gentics Mesh CLI

Gentics Mesh CLI

Description

Gentics Mesh has an API for all your administration tasks. But sometimes, having a command line tool at hand makes your life even easier - that’s why we created the Mesh CLI!

It gives a lovely user experience geared toward the command-line pro with over 30 commands and subcommands. Need a few examples?

$ mesh server backup
Backup invoked. Backup will be written to server backup directory.
$ mesh search sync
The index sync process was started.
$ mesh profile list
┌───────────────────┬───────────────────┬───────────────────┬──────────────────┐
│Name               │Project            │URL                │Active            │
╞═══════════════════╪═══════════════════╪═══════════════════╪══════════════════╡
│portal-php-referenc│Test               │http://localhost:80│                  │
│e                  │                   │81/api/v2          │                  │
├───────────────────┼───────────────────┼───────────────────┼──────────────────┤
│Website            │Website            │http://localhost:80│Yes               │
│                   │                   │80/api/v2          │                  │
└───────────────────┴───────────────────┴───────────────────┴──────────────────┘
$ mesh server readonly true
┌──────────────────────────────────────────────────────────────────────────────┐
│Read Only                                                                     │
╞══════════════════════════════════════════════════════════════════════════════╡
│true                                                                          │
└──────────────────────────────────────────────────────────────────────────────┘

We’re sure that your admins will love it!

Documentation

Mesh CLI

The Gentics Mesh CLI can be used to interact with the Mesh Server.

It can be used to:

  • Invoke backup

  • Deploy plugins

  • Issue / Reset API keys

  • Invoke schema / microschema migrations

  • Fetch cluster status

Usage

Usage: mesh-cli [-hVv] [--color <colorMode>] [-f <format>] [-k <apiKey>] [-p
                <profile>] [-u <apiUrl>] [COMMAND]
Gentics Mesh CLI
      --color <colorMode>   Colorize the output.
                            Options: [always,never]
                            (default: always)
  -f, --format <format>     Format for the output.
                            auto: use preconfigured format for the command
                            table: use table output format
                            json: use JSON output format
                            minimal: use minimal output format
                            (default: auto)
  -h, --help                Show this help message and exit.
  -k, --apikey <apiKey>     API Key.
  -p, --profile <profile>   Profile to be used.
  -u, --url <apiUrl>        Server url to be used.
  -v                        Specify multiple -v options to increase verbosity.
                            For example, `-v -v -v` or `-vvv`
  -V, --version             Print version information and exit.
Commands:
  profile      Manage your profiles
  server, s    Server commands
  user, u      User commands
  job, j       Job commands
  search       Search commands
  plugin, p    Plugin commands
  key          Keystore related commands
  schema       Schema commands
  microschema  Microschema commands

Profile Handling

The profile command can be used to manage profiles. A profile contains information about the mesh server to which the CLI can connect to.

Usage: mesh-cli profile [COMMAND]
Manage your profiles
Commands:
  add, a   Add a new profile
  list, l  List profiles
  del      Delete the profile
  set, s   Set the default profile

Env Handling

  • MESH_CLI_PROFILE - Override the active profile

  • MESH_CLI_API_URL - Override the API URL option

  • MESH_CLI_API_KEY - Override the API Key option

  • MESH_CLI_PROJECT_NAME - Override the project name option

  • COLUMNS - Specify the table width

Plugin Details

The CLI will be shipped as a JAR file and thus requires a Java runtime environment on the machine where you want to execute it (this must not be the same machine that runs Gentics Mesh).

Interested?

Version

1.0.2

License

commercial

Authors

Gentics