credit.cli._common
==================

.. py:module:: credit.cli._common

.. autoapi-nested-parse::

   Shared helpers used across all CLI submodules.



Attributes
----------

.. autoapisummary::

   credit.cli._common.logger
   credit.cli._common._PBS_DEFAULTS
   credit.cli._common._AGENT_BASH_BLOCKLIST


Functions
---------

.. autoapisummary::

   credit.cli._common._prompt
   credit.cli._common._prompt_bool
   credit.cli._common._setup_logging
   credit.cli._common._repo_root
   credit.cli._common._find_torchrun
   credit.cli._common._is_ncar_system
   credit.cli._common._agent_read_file
   credit.cli._common._agent_list_files
   credit.cli._common._agent_bash
   credit.cli._common._dispatch_tool


Module Contents
---------------

.. py:data:: logger

.. py:data:: _PBS_DEFAULTS

.. py:function:: _prompt(prompt: str, default=None) -> str

   Print a prompt and return stripped input, or *default* if empty.


.. py:function:: _prompt_bool(prompt: str, default: bool = True) -> bool

.. py:function:: _setup_logging(level: int = logging.INFO) -> None

.. py:function:: _repo_root() -> str

   Absolute path to the miles-credit repo root.


.. py:function:: _find_torchrun() -> str

   Return the path to torchrun, preferring the active conda env.


.. py:function:: _is_ncar_system() -> bool

   Return True if running on a known NCAR HPC system (Casper or Derecho).


.. py:function:: _agent_read_file(path: str, tail: int = 400) -> str

.. py:function:: _agent_list_files(pattern: str) -> str

.. py:data:: _AGENT_BASH_BLOCKLIST
   :value: ('rm ', 'rmdir', 'mv ', 'cp ', '> ', '>>', 'tee ', 'dd ', 'mkfs', 'chmod', 'chown', 'curl',...


.. py:function:: _agent_bash(command: str) -> str

.. py:function:: _dispatch_tool(name: str, tool_input: dict) -> str

