ansys.dyna.core.__main__#

CLI for PyDyna.

Usage:

python -m ansys.dyna.core agent –env cursor python -m ansys.dyna.core agent –env vscode –copy python -m ansys.dyna.core agent –env vscode –pointer python -m ansys.dyna.core agent –print

Attributes#

Functions#

find_workspace_root(→ pathlib.Path | None)

Find workspace root by walking up from cwd.

get_package_dir(→ pathlib.Path)

Get the package directory containing agent instructions.

get_instructions_path(→ pathlib.Path)

Get path to agent instructions file.

get_extended_docs_dir(→ pathlib.Path)

Get path to extended agent documentation directory.

get_instructions_content(→ str)

Read the agent instructions from installed package.

rewrite_links_for_copy(→ str)

Rewrite relative links in content to work from copied location.

format_for_cursor(→ str)

Wrap content in Cursor rules MDC format.

ensure_gitignore(→ None)

Add .agent/ to .gitignore.

load_manifest(→ dict)

Load the manifest.json file, or return empty manifest.

save_manifest(→ None)

Save the manifest.json file.

update_manifest_entry(→ dict)

Add or update a package entry in the manifest.

generate_readme(→ None)

Generate README.md from manifest.

copy_all_instructions(→ tuple[pathlib.Path, list[str]])

Copy all agent instruction files to workspace with working links.

register_pointer_in_manifest(→ None)

Register a pointer-mode entry in the manifest.

update_copilot_instructions(→ pathlib.Path)

Update .github/copilot-instructions.md with a pointer.

update_claude_instructions(→ pathlib.Path)

Update CLAUDE.md with a pointer.

cmd_agent_copy(→ int)

Handle --copy mode: copy all files with working links.

cmd_agent_pointer(→ int)

Handle --pointer mode: just add pointer to installed package.

cmd_agent(→ int)

Handle 'agent' subcommand.

main(→ int)

Main entry point for CLI.

Module Contents#

ansys.dyna.core.__main__.PACKAGE_NAMESPACE = 'ansys.dyna.core'[source]#
ansys.dyna.core.__main__.PACKAGE_NAME = 'ansys-dyna-core'[source]#
ansys.dyna.core.__main__.PACKAGE_ECOSYSTEM = 'pypi'[source]#
ansys.dyna.core.__main__.find_workspace_root() pathlib.Path | None[source]#

Find workspace root by walking up from cwd.

ansys.dyna.core.__main__.get_package_dir() pathlib.Path[source]#

Get the package directory containing agent instructions.

ansys.dyna.core.__main__.get_instructions_path() pathlib.Path[source]#

Get path to agent instructions file.

ansys.dyna.core.__main__.get_extended_docs_dir() pathlib.Path[source]#

Get path to extended agent documentation directory.

ansys.dyna.core.__main__.get_instructions_content() str[source]#

Read the agent instructions from installed package.

Rewrite relative links in content to work from copied location.

ansys.dyna.core.__main__.format_for_cursor(content: str, source_path: pathlib.Path) str[source]#

Wrap content in Cursor rules MDC format.

ansys.dyna.core.__main__.ensure_gitignore(workspace: pathlib.Path) None[source]#

Add .agent/ to .gitignore.

ansys.dyna.core.__main__.load_manifest(agent_dir: pathlib.Path) dict[source]#

Load the manifest.json file, or return empty manifest.

ansys.dyna.core.__main__.save_manifest(agent_dir: pathlib.Path, manifest: dict) None[source]#

Save the manifest.json file.

ansys.dyna.core.__main__.update_manifest_entry(manifest: dict, namespace: str, ecosystem: str, package_name: str, entry_file: str, extended_docs: list[str], mode: str, source_path: str) dict[source]#

Add or update a package entry in the manifest.

ansys.dyna.core.__main__.generate_readme(agent_dir: pathlib.Path, manifest: dict) None[source]#

Generate README.md from manifest.

ansys.dyna.core.__main__.copy_all_instructions(workspace: pathlib.Path, mode: str = 'copy') tuple[pathlib.Path, list[str]][source]#

Copy all agent instruction files to workspace with working links.

Returns:
tuple[Path, list[str]]

Main file path and list of extended doc relative paths.

ansys.dyna.core.__main__.register_pointer_in_manifest(workspace: pathlib.Path, mode: str = 'pointer') None[source]#

Register a pointer-mode entry in the manifest.

ansys.dyna.core.__main__.update_copilot_instructions(workspace: pathlib.Path, pydyna_path: pathlib.Path, mode: str, extended_docs: list[str] | None = None) pathlib.Path[source]#

Update .github/copilot-instructions.md with a pointer.

ansys.dyna.core.__main__.update_claude_instructions(workspace: pathlib.Path, pydyna_path: pathlib.Path, mode: str, extended_docs: list[str] | None = None) pathlib.Path[source]#

Update CLAUDE.md with a pointer.

ansys.dyna.core.__main__.cmd_agent_copy(args: argparse.Namespace, workspace: pathlib.Path) int[source]#

Handle –copy mode: copy all files with working links.

ansys.dyna.core.__main__.cmd_agent_pointer(args: argparse.Namespace, workspace: pathlib.Path) int[source]#

Handle –pointer mode: just add pointer to installed package.

ansys.dyna.core.__main__.cmd_agent(args: argparse.Namespace) int[source]#

Handle ‘agent’ subcommand.

ansys.dyna.core.__main__.main() int[source]#

Main entry point for CLI.