rlsbl v0.92.0 /rlsbl.strictcli_detect
On this page

Detect whether a Python project uses strictcli by scanning pyproject.toml dependencies and extract its script entry point for schema dumping.

#rlsbl.strictcli_detect

#rlsbl.strictcli_detect

Detect whether a project uses strictcli and extract its entry point.

#detect_strictcli

python
def detect_strictcli(project_dir: str='.') -> tuple[str, str] | None

Check if a project uses strictcli and return its entry point info.

First checks Python (pyproject.toml). If not found, checks Go (go.mod).

For Python: if the project depends on strictcli and has a [project.scripts] entry, returns (entry_point_name, "python").

For Go: if go.mod requires github.com/smm-h/strictcli, detects the entry point (root main.go or cmd/*/main.go) and returns (package_path, "go").

Args:

  • project_dir: path to the project root (default: current directory).

Returns:

  • A tuple (entry_point, language) if strictcli is detected, else None.

#_detect_python_strictcli

python
def _detect_python_strictcli(project_dir: str) -> tuple[str, str] | None

Detect strictcli in a Python project via pyproject.toml.

#_go_mod_has_strictcli

python
def _go_mod_has_strictcli(project_dir: str) -> bool

Return True if go.mod requires a strictcli module.

#_go_file_imports_strictcli

python
def _go_file_imports_strictcli(filepath: str) -> bool

Return True if a Go source file imports a strictcli package.

Uses tree-sitter via lint/go_ast.scan_imports for accurate parsing.

#_detect_go_strictcli

python
def _detect_go_strictcli(project_dir: str) -> tuple[str, str] | None

Detect strictcli in a Go project via go.mod.

Detection order:

  1. Root main.go that imports strictcli -> return (".", "go")
  2. Single cmd/*/main.go -> return ("./cmd//", "go")
  3. Multiple cmd/*/main.go -> scan each for strictcli imports,

return the one that imports it