runPromptShield()
runPromptShield(options): Promise<void>
Defined in: main.ts:305
Execute the PromptShield CLI workflow.
Execution Model
- Merge configuration layers
- Initialize logger
- If
checkmode:- Resolve files
- Skip binary files
- Run core scan
- Apply inline ignore filtering
- Exit early on first threat
- Otherwise:
- Route to sanitize OR
- Stream workspace scan/fix
- Aggregate and format results
- Optionally emit JSON or Markdown report
Key Behaviors
- Streaming execution for scalability
- Concurrency based on available CPU cores
- Workspace-level caching (delegated)
- Inline ignore evaluation via @promptshield/ignore
- Detection performed via @promptshield/core
This function does NOT:
- Implement detection rules
- Implement ignore parsing
- Implement caching mechanics
- Perform direct file traversal logic
Those responsibilities are delegated to:
- @promptshield/core
- @promptshield/ignore
- @promptshield/workspace
This layer remains strictly orchestration and output formatting.
Parameters
options
Returns
Promise<void>