API Guide > Maya Python Plug-in Learning Path >

# Command Plug-in Basics

## What is a Command Plug-in?

Command plug-ins define new custom MEL commands, and correspondingly add functions to the maya.cmds Python module for use in scripting. OpenMayaMPx.MPxCommand is the base class from which your custom Commands will derive. A trivial example of a command plug-in is presented in Your First Maya Python Plug-in, which creates the spHelloWorld command. This command is invoked in the Maya Script Editor in one of two ways:

- MEL - simply run the new MEL command by its name.

      spHelloWorld

- Python - use the maya.cmds Python module to invoke the new command as a function.

      import maya.cmds as cmds
      cmds.spHelloWorld()

Running this command prints "Hello World" to the Script Editor output. More useful commands can be defined to query the scene, and to automate the manipulation of various scene elements. Command plug-ins can also be paired with dependency graph plug-ins to facilitate the creation and connection of custom node types.

#### Topics in this section

- Command Plug-ins
- Command Arguments and Flags
- Querying the Scene Graph
- Creating and Manipulating Objects
- Example: Creating a Scene
- Example: Creating an IK Joint Chain