The Prowler Studio CLI is a command-line tool for generating security checks and fixers for Prowler using AI. It supports multiple LLM providers (Gemini and OpenAI), and can be run via Docker or directly from source. The CLI is built on top of the Prowler Studio Core, providing a user-friendly interface for check and fixer generation, RAG knowledge base managing and compliance requirements updates.
Requirements:
gitdocker
git clone git@github.com:prowler-cloud/prowler-studio.git
cd prowler-studio
docker build -f ./cli/Dockerfile -t prowler-studio-cli:latest .Run the CLI:
cp .env.template .env # Fill in your API keys
docker run --rm -it --env-file .env prowler-studio-cliTo persist generated checks:
docker run --rm -it --env-file .env -v $(pwd)/generated_checks:/home/prowler_studio/prowler_studio/_cli/generated_checks prowler-studio-cliWarning
If you have problems with the permissions of the generated checks folder add write permissions to write in the folder by other users.
You can do it with the following command: chmod o+w $(pwd)/generated_checks.
Requirements:
gituv(installation guide)- Python 3.12+
git clone git@github.com:prowler-cloud/prowler-studio.git
cd prowler-studio
uv sync
uv tool install -e ./cli/
cp .env.template .envFill in .env with your API keys (see below).
The LLM to use can be selected in a interactive way by the CLI, using command especific flags or by editing the cli/prowler_studio/_cli/config.yaml file.
An example of the cli/prowler_studio/_cli/config.yaml file is the following:
models:
llm_provider: "openai" # or "gemini"
llm_reference: "gpt-4o" # or "models/gemini-1.5-flash"
embedding_model_provider: "gemini"
embedding_model_reference: "text-embedding-004"GOOGLE_API_KEY: Must be always set, because it is used for the semantic search in the check knowledge base. You can get one for free from here.OPENAI_API_KEY: LLM provider API key. This is only used in the case that in the check creation you want to use the OpenAI model supported by the Studio. See Supported LLM Providers and Models for a list of available models.
- Linux, macOS (Python 3.12+)
All commands are implemented as Typer subcommands in cli/prowler_studio/_cli/commands/. For help, run:
prowler-studio --helpGenerate a new Prowler check from a natural language prompt.
Usage:
prowler-studio create-check "<your prompt>" [OPTIONS]Options:
--model-provider TEXTThe model provider to use (overrides config)--model-reference TEXTThe specific model reference to use--llm-api-key TEXTLLM API key (env: LLM_API_KEY)--embedding-model-api-key TEXTEmbedding model API key (env: EMBEDDING_MODEL_API_KEY)--log-level TEXTLog level (default: INFO)--output-directory PATHDirectory to save the check (default: ./generated_checks)--save-checkSave the generated check in the output directory
References:
- Uses the Check Creation Workflow from the core module.
- See also: CheckMetadataVectorStore
Build or update the RAG (Retrieval-Augmented Generation) dataset from the Prowler codebase.
Usage:
prowler-studio build-check-rag <path-to-prowler-directory> [OPTIONS]Options:
--embedding-model-provider TEXTEmbedding model provider--embedding-model-reference TEXTEmbedding model reference--embedding-model-api-key TEXTEmbedding model API key--overwriteOverwrite the RAG dataset if it exists
References:
Update compliance requirements using the latest checks and semantic search.
Usage:
prowler-studio update-compliance <compliance.json> [OPTIONS]Options:
--max-check-number-per-requirement, -m INTEGERMax checks per requirement (default: 5)--confidence-threshold, -c FLOATConfidence threshold (default: 0.6)
References:
- Uses the Compliance Updater Workflow
Generate an automated fixer for an existing Prowler check using AI.
Usage:
prowler-studio create-fixer <provider> <check-id> [OPTIONS]Options:
--prowler-provider TEXTThe Prowler provider to use (overrides config)--model-provider TEXTThe LLM provider to use (overrides config)--model-reference TEXTThe specific LLM model reference to use--llm-api-key TEXTLLM API key (env: LLM_API_KEY)--output-directory PATHDirectory to save the fixer (default: ./generated_fixers)--save-fixerSave the generated fixer in the output directory
References:
- Uses the Fixer Creation Workflow from the core module.
prowler-studio create-check "Create a new AWS check to ensure EC2 security groups with inbound rules allowing unrestricted ICMP access are not present."
prowler-studio build-check-rag /path/to/prowler
prowler-studio update-compliance --max-check-number-per-requirement 5 --confidence-threshold 0.6 compliance_test.json
prowler-studio create-fixer ec2_instance_imdsv2_enabled --prowler-provider aws- Add new commands in
cli/prowler_studio/_cli/commands/as Typer functions. - Register them in
cli/prowler_studio/_cli/__main__.py. - Use utility functions from
cli/prowler_studio/_cli/utils/for config, file I/O, and logging. - For output formatting and prompts, see
cli/prowler_studio/_cli/views/. - Reference Typer documentation for advanced CLI patterns.
- Config file not found: Ensure
cli/prowler_studio/_cli/config.yamlexists and is readable. - API key errors: Set the correct environment variables. See Environment Variables.
- Docker volume issues: Use absolute paths for
-vwhen mounting volumes.
- The CLI is built with Typer and organized by command in
cli/prowler_studio/_cli/commands/. - Configuration is loaded from
cli/prowler_studio/_cli/config.yaml(see Configuration). - Utility modules in
cli/prowler_studio/_cli/utils/handle config, file I/O, and logging. - Output formatting and user prompts are in
cli/prowler_studio/_cli/views/. - The CLI interfaces with the Prowler Studio Core for workflows, RAG, and compliance logic. See core.md for details on:
- Workflow classes and orchestration
- RAG dataset and vector store
- Model/provider abstraction
- The CLI is distributed as a Python package (
prowler-studio-cli) with an entrypoint defined inpyproject.toml. - The Docker image is defined in
cli/Dockerfileand uses the CLI as its entrypoint.
- Follow PEP8 and use pre-commit hooks (
uv tool install pre-commit && pre-commit install). - Extend commands in
cli/prowler_studio/_cli/commands/. - Configuration in
cli/prowler_studio/_cli/config.yaml. - Tests and further development should be added in future releases.
- For core logic, see core.md.
