MySQL Shell exposes much of its functionality through an API
command-line integration using a syntax that provides access to
objects and their functions without opening the interactive
interface. This enables you easily integrate
mysqlsh with other tools. For example if you
want to automate how you create an InnoDB Cluster using a
bash script, you could use the command-line
integration to call AdminAPI operations. This functionality is
similar to using the --execute
option, but the command-line integration uses a simplified
argument syntax which reduces the quoting and escaping that can be
required by terminals. Unlike batch mode, the command-line
integration is stateless. This means that operations which return
an object to be used by further operations are not possible. The
command-line integration calls operations, or global object's
functions, and returns.