Command line interface#

Every pymapdl sub-command is a thin Click wrapper (<name>_cli) around a plain function (<name>) that lives in the same module, for example ansys.mapdl.core.cli.start.start(). Import the plain function to get the behavior of a command from Python, without going through a shell.

The plain functions return data and raise exceptions, they never print or exit the interpreter. For an introduction with examples, see Use the commands from Python.

Note

stop() is the one exception: it lives in ansys.mapdl.core.launcher.connection instead of ansys.mapdl.core.cli.stop, because it is also used internally by close_all_local_instances(). It is still re-exported as ansys.mapdl.core.cli.stop.stop and ansys.mapdl.core.launcher.stop for convenience, and the pymapdl stop command wraps it the same way as every other sub-command. For consistency with launch_mapdl(), it is also exposed at the top level of the package as stop_mapdl().

Manage instances#

ansys.mapdl.core.cli.start.start([...])

Launch an MAPDL instance without connecting a client to it.

ansys.mapdl.core.launcher.connection.stop([...])

Stop MAPDL instances running on a given port or with a given process ID.

ansys.mapdl.core.cli.list_instances.list_instances([...])

Render a table with the MAPDL processes running on this machine.

ansys.mapdl.core.cli.check.check([ip, port, ...])

Collect diagnostic information from a running MAPDL instance.

ansys.mapdl.core.cli.exec.exec_commands([...])

Send APDL commands to a running MAPDL instance and return its output.

Convert and document APDL code#

ansys.mapdl.core.cli.convert.convert(...[, ...])

Convert an APDL script to PyMAPDL code.

ansys.mapdl.core.cli.help.help_command(command)

Render the PyMAPDL docstring of a MAPDL command for a terminal.

Manage the bundled skills#

ansys.mapdl.core.cli.skills.list_skills([...])

List the skills bundled with this PyMAPDL installation.

ansys.mapdl.core.cli.skills.show_skill(...)

Return the full SKILL.md content of a bundled skill.

ansys.mapdl.core.cli.skills.plan_skill_install(...)

Resolve the file operations needed to install a skill.

ansys.mapdl.core.cli.skills.apply_skill_install(plan)

Perform the installation described by plan.

ansys.mapdl.core.cli.skills.install_skill(...)

Install a bundled skill into an AI coding environment.

Helpers#

ansys.mapdl.core.cli.check.format_info(data)

Render the output of check() as a human-readable report.

ansys.mapdl.core.cli.exec.resolve_command_block([...])

Build the APDL command block from the available command sources.

ansys.mapdl.core.cli.convert.resolve_graphics_backend(...)

Coerce a graphics backend name to a GraphicsBackend member.

ansys.mapdl.core.cli.helpers.connect_to_instance([...])

Connect to an already running MAPDL instance.

ansys.mapdl.core.cli.helpers.get_mapdl_instances()

Get list of MAPDL instances with minimal data.

ansys.mapdl.core.cli.helpers.silence_logging()

Silence the PyMAPDL logger so that only command output reaches stdout.