install_skill#

ansys.mapdl.core.cli.skills.install_skill(skill_name, env, scope='local', skills_dir=None)#

Install a bundled skill into an AI coding environment.

All files in the skill directory, except evals/ and workspace/, are copied to the target location, and a reference is added to the main configuration file of the environment so that the AI tool discovers the skill. Running the function twice is safe: existing references are not duplicated.

Parameters:
skill_namestr

Skill identifier, as reported by list_skills().

envstr

AI coding environment. One of SUPPORTED_ENVS.

scopestr, default: “local”

Either "local" to install into the current working directory, or "global" to install into the home directory of the user.

skills_dirpathlib.Path, optional

Directory holding one sub-directory per skill. Defaults to the directory bundled with the package.

Returns:
list of str

Human-readable log of what has been written or skipped.

Raises:
UnknownSkillError

When skill_name is not bundled with PyMAPDL.

UnsupportedScopeError

When env does not support scope.

Return type:

List[str]

Examples

Install the pymapdl-cli skill for Claude in the current project:

>>> from ansys.mapdl.core.cli.skills import install_skill
>>> install_skill("pymapdl-cli", env="claude")
['  updated /home/user/project/CLAUDE.md']