Develop#10
Conversation
* initial setup for basi cli * fix issue in basi cli
* change desing of CLI * fix: address CodeRabbit review comments * fix: check brd file is docx in the flag option * fix: output path issue
* feat: add windows exe build pipeline and fix bundled template path * fix: get_base_path method
* release: merge develop into main (CLI + UX + Windows exe support) (#4) * developed cli for auditgen (#1) * initial setup for basi cli * fix issue in basi cli * feat: improve CLI UX, prompts, and generate workflow * change desing of CLI * fix: address CodeRabbit review comments * fix: check brd file is docx in the flag option * fix: output path issue * feat: add windows exe build pipeline and fix bundled template path (#3) * feat: add windows exe build pipeline and fix bundled template path * fix: get_base_path method * fix: resolve exe crash due to lazy import handling (#5) * fix: lazy import not catch by PyInstaller * fix: add debug in the cli to check what issue it crash (#6)
* release: merge develop into main (CLI + UX + Windows exe support) (#4) * developed cli for auditgen (#1) * initial setup for basi cli * fix issue in basi cli * feat: improve CLI UX, prompts, and generate workflow * change desing of CLI * fix: address CodeRabbit review comments * fix: check brd file is docx in the flag option * fix: output path issue * feat: add windows exe build pipeline and fix bundled template path (#3) * feat: add windows exe build pipeline and fix bundled template path * fix: get_base_path method * fix: resolve exe crash due to lazy import handling (#5) * fix: lazy import not catch by PyInstaller * fix: add debug in the cli to check what issue it crash (#6)
📝 WalkthroughWalkthroughThis PR introduces a complete CLI application framework for AudiGen with persistent configuration management, interactive prompts, input validation, and GitHub Actions CI/CD to build and release a Windows executable. It adds configuration persistence, user-interactive generation workflows, and infrastructure to distribute the tool as a standalone Windows binary. ChangesAudiGen CLI with CI/CD Distribution
Sequence DiagramsequenceDiagram
participant User
participant CLI as cli.py<br/>(generate command)
participant Config as config.py
participant Validation as utils.py
participant Extractor as extractor.py
participant LLM as llm_client.py
participant ExcelWriter as excelWriter.py
User->>CLI: auditgen generate [flags/interactive]
CLI->>CLI: Print banner
CLI->>Config: load_config() & check API key
alt API key missing
CLI->>User: Error & Exit
end
CLI->>Validation: Resolve BRD path, ticket, dates
CLI->>Validation: Validate date format & range
CLI->>Validation: Prompt for missing values
CLI->>Validation: resolve_output_dir(ticket_id, output_arg)
CLI->>Extractor: extractDoc(brd_path)
Extractor->>Extractor: Parse .docx, sanitize content
Extractor-->>CLI: sanitized_text
CLI->>CLI: Set GEMINI_API_KEY env var
CLI->>LLM: callLLM(sanitized_text)
LLM->>LLM: Call Gemini API
LLM-->>CLI: llm_generateTestCase (structured output)
CLI->>ExcelWriter: startExcelChange(llm_result, dates, ticket, user, approver, out_dir)
ExcelWriter->>ExcelWriter: Load templates from _get_base_path()
ExcelWriter->>ExcelWriter: Update Impact Analysis, Code Checklist, Revision History
ExcelWriter->>ExcelWriter: Write 3 Excel files to out_dir/ticket_id/
ExcelWriter-->>CLI: Success
CLI->>User: Print completion summary
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
⚔️ Resolve merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
Actionable comments posted: 12
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/build.yml:
- Around line 60-64: The "Create Github Release" step (uses:
softprops/action-gh-release@v2) runs on manual workflow_dispatch and tag pushes
causing failures when no tag exists; add a conditional like if:
startsWith(github.ref, 'refs/tags/') to the step to ensure the release action
(files: dist/auditgen.exe, generate_release_notes: true) only executes for
tag-created workflows.
- Around line 3-4: The workflow currently sets the compatibility env var
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 to force Node 24 for older actions; either
keep that env var as-is for compatibility or upgrade the referenced actions to
versions that natively support Node.js 24 (replace checkout@v4 → checkout@v5+,
setup-python@v5 → setup-python@v6+, upload-artifact@v4 → upload-artifact@v6+,
action-gh-release@v2 → action-gh-release@v3+) and then remove the
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 line; update the workflow action references
accordingly and run the workflow to confirm no deprecation warnings.
In `@audigen_cli/banner.py`:
- Around line 1-5: The file imports Console twice; remove the duplicate import
statement so only a single "from rich.console import Console" remains; edit
audigen_cli/banner.py to delete the redundant Console import (the duplicate
line) and keep the other imports (Text, Panel, Align) unchanged to avoid unused
or duplicate import warnings.
In `@audigen_cli/cli.py`:
- Line 61: The string passed to questionary.confirm in the create assignment is
using an unnecessary f-string (causing Ruff F541); update the call in the
expression create = _ask(questionary.confirm(f"Folder does not exist. Create
it?", style=custom_style)) to use a plain string without the f prefix — e.g.
questionary.confirm("Folder does not exist. Create it?", style=custom_style) —
leaving the surrounding _ask helper and variable name create unchanged.
- Around line 264-273: The current crash handler inside the if __name__ ==
"__main__" block never runs for the installed entrypoint because the entrypoint
calls audigen_cli.cli:cli directly; fix by adding a new top-level main()
function in audigen_cli.cli that wraps the existing cli() call with the
try/except crash-logging logic (move the traceback import, log_path creation,
file write, print, and SystemExit into main), keep cli() unchanged, and update
pyproject.toml entrypoint to point to audigen_cli.cli:main so the installed
command runs the crash-handling wrapper.
- Around line 114-117: The checkbox prompt in config_setup calls
questionary.checkbox(...).ask() directly so Ctrl+C returns None and triggers the
wrong message; instead build the Question object with questionary.checkbox(...)
and pass it to the existing _ask(...) wrapper (i.e., replace
questionary.checkbox(...).ask() with _ask(questionary.checkbox(...))) so that
Ctrl+C is handled consistently and the "Aborted." message is shown; update the
assignment to selected_keys = _ask(questionary.checkbox(...)) and keep the
existing if not selected_keys: logic unchanged.
- Around line 202-204: The interactive fallback prompts hardcode choices for
complexity and priority, causing drift from the Click constants; update the
generate() logic (the lines setting complexity and priority using _ask and
questionary.select) to reuse the raw choice lists derived from
COMPLEXITY_CHOICES and PRIORITY_CHOICES (or their underlying values) instead of
hardcoding ["LOW","MEDIUM","HIGH"] and ["P1","P2","P3"], so the
questionary.select calls reference the same shared choice definitions as the
click.Choice constants; keep use of _ask, questionary.select and custom_style
intact while pulling the choices from those constants.
In `@audigen_cli/config.py`:
- Around line 25-28: The save_config function currently writes CONFIG_FILE with
default umask-permissions making the stored api_key world-readable; after the
json.dump finishes in save_config, call os.chmod(CONFIG_FILE, 0o600) to restrict
file permissions to owner read/write only (and add an import os if missing);
keep the existing _ensure_config_dir() and write flow but ensure chmod runs
after closing the file to apply the secure mode.
- Around line 17-22: The load_config function should guard against a corrupted
JSON file: wrap the json.load(CONFIG_FILE) call (inside load_config) in a
try/except that catches json.JSONDecodeError; when caught, log or print a
warning (include CONFIG_FILE name), move/rename the corrupted file to a backup
(so it’s not lost), and return a safe configuration (e.g., dict(DEFAULTS) or
{**DEFAULTS}); optionally write DEFAULTS back to CONFIG_FILE after ensuring the
directory via _ensure_config_dir(). Ensure you reference load_config,
CONFIG_FILE, DEFAULTS and _ensure_config_dir when updating the code.
In `@CHANGELOG.md`:
- Line 3: The release date in the changelog header "## [v0.1.0] - 2025-04-26" is
incorrect; update that line to the correct release/tag date (for example change
2025-04-26 to 2025-05-04 or the actual planned release date) while preserving
the existing header format "## [v0.1.0] - YYYY-MM-DD" so the version heading
remains consistent.
- Around line 1-11: The Markdown headings in the changelog (e.g., "# Changelog",
"## [v0.1.0] - 2025-04-26", and "### Added") need blank lines before and after
each heading and the file must end with a trailing newline to satisfy
MD022/MD047; update CHANGELOG.md to insert a blank line above "## [v0.1.0] -
2025-04-26" and above "### Added" (and ensure a blank line between each heading
and the list that follows), and add a final newline at EOF.
In `@README.md`:
- Around line 1-45: The README has Markdown spacing and minor grammar issues:
add a blank line before and after each heading (e.g., "# AudiGen CLI", "##
Requirements", "## Installation", "## First-Time Setup", "## Usage", "##
Output", "## Built With") and ensure fenced code blocks use blank lines above
and below the ```cmd blocks (both the single-line `auditgen config setup` and
the multi-line usage example). Replace the heading text "First Time Setup" with
"First-Time Setup" to hyphenate the adjective, ensure the file ends with a
trailing newline (MD047), and remove any stray or duplicate punctuation/spacing
in the "Built With" list (e.g., ensure "Rich + Questionary — terminal UI"
appears once).
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7480a2b9-be8c-4fd3-af45-a6abd8cc2c2a
⛔ Files ignored due to path filters (2)
poetry.lockis excluded by!**/*.locktemplate/Vendor initiation date and time should be captured in the checklevel report.docxis excluded by!**/*.docx
📒 Files selected for processing (12)
.github/workflows/build.ymlCHANGELOG.mdREADME.mdaudigen_cli/banner.pyaudigen_cli/cli.pyaudigen_cli/config.pyaudigen_cli/excelWriter.pyaudigen_cli/extractor.pyaudigen_cli/llm_client.pyaudigen_cli/ui.pyaudigen_cli/utils.pypyproject.toml
💤 Files with no reviewable changes (1)
- audigen_cli/llm_client.py
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the Node.js compatibility of the GitHub Actions used in this workflow
echo "=== Checking Node.js compatibility for GitHub Actions ==="
echo ""
echo "Actions used in workflow:"
echo "- actions/checkout@v4"
echo "- actions/setup-python@v5"
echo "- actions/upload-artifact@v4"
echo "- softprops/action-gh-release@v2"
echo ""
echo "Checking if these actions support Node.js 24 by default..."
# Check each action's latest release/docs for Node.js compatibility
for action in "actions/checkout" "actions/setup-python" "actions/upload-artifact" "softprops/action-gh-release"; do
echo ""
echo "--- $action ---"
gh api repos/$action/releases/latest --jq '.name, .published_at' 2>/dev/null || echo "Could not fetch release info"
doneRepository: ThiruNithish28/audiGen-cli
Length of output: 563
🌐 Web query:
Do GitHub Actions checkout@v4, setup-python@v5, upload-artifact@v4, and action-gh-release@v2 natively support Node.js 24?
💡 Result:
No, GitHub Actions checkout@v4, setup-python@v5, upload-artifact@v4, and action-gh-release@v2 do not natively support Node.js 24. They run on Node.js 20 by default and trigger deprecation warnings. Newer versions are required for native Node.js 24 support (e.g., checkout@v5+, setup-python@v6+, upload-artifact@v6+, action-gh-release@v3+).
Citations:
- 1: Bump actions/checkout from 4 to 6 actions/github-script#684
- 2: actions/checkout@v4...v6
- 3: https://github.com/actions/checkout
- 4: chore: update GitHub Actions to support Node.js 24 before June 2026 deadline msarson/Clarion-Extension#57
- 5: CI: Update GitHub Actions to support Node.js 24 (deprecate Node.js 20) mandiant/capa#2983
- 6: actions/setup-python@e797f83
- 7: https://github.com/actions/setup-python/releases/tag/v5.0.0
- 8: https://github.com/actions/setup-python
- 9: https://github.com/actions/upload-artifact/releases/tag/v6.0.0
- 10: Upload Artifact Node 24 support actions/upload-artifact#719
- 11: [feat req] Update to Node.js 24 actions/upload-artifact#780
- 12: release: cut v3.0.0 for Node 24 upgrade softprops/action-gh-release#670
- 13: Upgrade to node 24 softprops/action-gh-release#654
- 14: https://github.com/actions/checkout/blob/v4/action.yml
- 15: https://github.com/actions/setup-python/blob/main/action.yml
Update GitHub Actions to versions that natively support Node.js 24, or keep FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 as a compatibility measure.
The current actions (checkout@v4, setup-python@v5, upload-artifact@v4, action-gh-release@v2) do not natively support Node.js 24 and default to Node.js 20, triggering deprecation warnings. The FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 variable is necessary for your current setup.
For long-term maintenance, consider upgrading to action versions that natively support Node.js 24: checkout@v5+, setup-python@v6+, upload-artifact@v6+, action-gh-release@v3+. This would allow removing the environment variable.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/build.yml around lines 3 - 4, The workflow currently sets
the compatibility env var FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 to force Node 24
for older actions; either keep that env var as-is for compatibility or upgrade
the referenced actions to versions that natively support Node.js 24 (replace
checkout@v4 → checkout@v5+, setup-python@v5 → setup-python@v6+,
upload-artifact@v4 → upload-artifact@v6+, action-gh-release@v2 →
action-gh-release@v3+) and then remove the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24
line; update the workflow action references accordingly and run the workflow to
confirm no deprecation warnings.
| - name: Create Github Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: dist/auditgen.exe | ||
| generate_release_notes: true |
There was a problem hiding this comment.
Add condition to prevent release step failure on manual triggers.
The release creation step will run on both tag pushes and manual workflow_dispatch triggers. When triggered manually without a tag context, this step will likely fail or produce unexpected results.
🔧 Proposed fix to conditionally run release only on tags
- name: Create Github Release
uses: softprops/action-gh-release@v2
+ if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/auditgen.exe
generate_release_notes: true📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Create Github Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/auditgen.exe | |
| generate_release_notes: true | |
| - name: Create Github Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: dist/auditgen.exe | |
| generate_release_notes: true |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/build.yml around lines 60 - 64, The "Create Github
Release" step (uses: softprops/action-gh-release@v2) runs on manual
workflow_dispatch and tag pushes causing failures when no tag exists; add a
conditional like if: startsWith(github.ref, 'refs/tags/') to the step to ensure
the release action (files: dist/auditgen.exe, generate_release_notes: true) only
executes for tag-created workflows.
| from rich.console import Console | ||
| from rich.text import Text | ||
| from rich.console import Console | ||
| from rich.panel import Panel | ||
| from rich.align import Align |
There was a problem hiding this comment.
Remove the duplicate Console import on Line 3.
from rich.console import Console appears on both line 1 and line 3.
🔧 Proposed fix
from rich.console import Console
from rich.text import Text
-from rich.console import Console
from rich.panel import Panel
from rich.align import Align📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| from rich.console import Console | |
| from rich.text import Text | |
| from rich.console import Console | |
| from rich.panel import Panel | |
| from rich.align import Align | |
| from rich.console import Console | |
| from rich.text import Text | |
| from rich.panel import Panel | |
| from rich.align import Align |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@audigen_cli/banner.py` around lines 1 - 5, The file imports Console twice;
remove the duplicate import statement so only a single "from rich.console import
Console" remains; edit audigen_cli/banner.py to delete the redundant Console
import (the duplicate line) and keep the other imports (Text, Panel, Align)
unchanged to avoid unused or duplicate import warnings.
| if key == "output_dir": | ||
| path = Path(value.strip()) | ||
| if not path.exists(): | ||
| create = _ask(questionary.confirm(f"Folder does not exist. Create it?", style=custom_style)) |
There was a problem hiding this comment.
Remove the f prefix — this f-string has no placeholders (Ruff F541).
🔧 Proposed fix
- create = _ask(questionary.confirm(f"Folder does not exist. Create it?", style=custom_style))
+ create = _ask(questionary.confirm("Folder does not exist. Create it?", style=custom_style))📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| create = _ask(questionary.confirm(f"Folder does not exist. Create it?", style=custom_style)) | |
| create = _ask(questionary.confirm("Folder does not exist. Create it?", style=custom_style)) |
🧰 Tools
🪛 Ruff (0.15.12)
[error] 61-61: f-string without any placeholders
Remove extraneous f prefix
(F541)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@audigen_cli/cli.py` at line 61, The string passed to questionary.confirm in
the create assignment is using an unnecessary f-string (causing Ruff F541);
update the call in the expression create = _ask(questionary.confirm(f"Folder
does not exist. Create it?", style=custom_style)) to use a plain string without
the f prefix — e.g. questionary.confirm("Folder does not exist. Create it?",
style=custom_style) — leaving the surrounding _ask helper and variable name
create unchanged.
| selected_keys = questionary.checkbox( | ||
| "Select fields to configure:(space to toggle, enter to confirm)", | ||
| choices=choices | ||
| ).ask() |
There was a problem hiding this comment.
config_setup bypasses _ask() — Ctrl+C during the checkbox prompt shows the wrong message.
questionary.checkbox(...).ask() is called directly instead of through _ask(). When the user presses Ctrl+C, .ask() returns None, which the if not selected_keys: guard then turns into "⚠ No fields selected. Aborting setup." instead of the consistent "Aborted." message produced by _ask().
🔧 Proposed fix
- selected_keys = questionary.checkbox(
- "Select fields to configure:(space to toggle, enter to confirm)",
- choices=choices
- ).ask()
-
- if not selected_keys:
- console.print("[yellow]⚠ No fields selected. Aborting setup.[/yellow]")
- return
+ selected_keys = _ask(questionary.checkbox(
+ "Select fields to configure:(space to toggle, enter to confirm)",
+ choices=choices,
+ ))
+ if not selected_keys:
+ console.print("[yellow]⚠ No fields selected. Aborting setup.[/yellow]")
+ return📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| selected_keys = questionary.checkbox( | |
| "Select fields to configure:(space to toggle, enter to confirm)", | |
| choices=choices | |
| ).ask() | |
| selected_keys = _ask(questionary.checkbox( | |
| "Select fields to configure:(space to toggle, enter to confirm)", | |
| choices=choices, | |
| )) | |
| if not selected_keys: | |
| console.print("[yellow]⚠ No fields selected. Aborting setup.[/yellow]") | |
| return |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@audigen_cli/cli.py` around lines 114 - 117, The checkbox prompt in
config_setup calls questionary.checkbox(...).ask() directly so Ctrl+C returns
None and triggers the wrong message; instead build the Question object with
questionary.checkbox(...) and pass it to the existing _ask(...) wrapper (i.e.,
replace questionary.checkbox(...).ask() with _ask(questionary.checkbox(...))) so
that Ctrl+C is handled consistently and the "Aborted." message is shown; update
the assignment to selected_keys = _ask(questionary.checkbox(...)) and keep the
existing if not selected_keys: logic unchanged.
| def load_config() -> dict: | ||
| _ensure_config_dir() | ||
| if not CONFIG_FILE.exists(): | ||
| return dict(DEFAULTS) | ||
| with open(CONFIG_FILE, "r") as f: | ||
| return {**DEFAULTS,**json.load(f)} |
There was a problem hiding this comment.
Handle json.JSONDecodeError — a corrupted config crashes the entire tool.
If ~/.auditgen/config.json contains invalid JSON (e.g., partial write, manual edit mistake), json.load(f) raises json.JSONDecodeError which propagates unhandled and kills any auditgen invocation.
🛡️ Proposed fix
def load_config() -> dict:
_ensure_config_dir()
if not CONFIG_FILE.exists():
return dict(DEFAULTS)
- with open(CONFIG_FILE, "r") as f:
- return {**DEFAULTS, **json.load(f)}
+ try:
+ with open(CONFIG_FILE) as f:
+ return {**DEFAULTS, **json.load(f)}
+ except json.JSONDecodeError:
+ return dict(DEFAULTS)🧰 Tools
🪛 Ruff (0.15.12)
[warning] 21-21: Unnecessary mode argument
Remove mode argument
(UP015)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@audigen_cli/config.py` around lines 17 - 22, The load_config function should
guard against a corrupted JSON file: wrap the json.load(CONFIG_FILE) call
(inside load_config) in a try/except that catches json.JSONDecodeError; when
caught, log or print a warning (include CONFIG_FILE name), move/rename the
corrupted file to a backup (so it’s not lost), and return a safe configuration
(e.g., dict(DEFAULTS) or {**DEFAULTS}); optionally write DEFAULTS back to
CONFIG_FILE after ensuring the directory via _ensure_config_dir(). Ensure you
reference load_config, CONFIG_FILE, DEFAULTS and _ensure_config_dir when
updating the code.
| def save_config(data: dict): | ||
| _ensure_config_dir() | ||
| with open(CONFIG_FILE, "w") as f: | ||
| json.dump(data, f, indent=2) |
There was a problem hiding this comment.
Restrict file permissions after saving — the API key is world-readable by default.
save_config writes api_key in plaintext to ~/.auditgen/config.json with whatever permissions the process umask produces (typically 0o644 on Linux/macOS), making it readable by any local user. Apply chmod 0o600 immediately after writing.
🔒 Proposed fix
def save_config(data: dict):
_ensure_config_dir()
with open(CONFIG_FILE, "w") as f:
json.dump(data, f, indent=2)
+ CONFIG_FILE.chmod(0o600)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@audigen_cli/config.py` around lines 25 - 28, The save_config function
currently writes CONFIG_FILE with default umask-permissions making the stored
api_key world-readable; after the json.dump finishes in save_config, call
os.chmod(CONFIG_FILE, 0o600) to restrict file permissions to owner read/write
only (and add an import os if missing); keep the existing _ensure_config_dir()
and write flow but ensure chmod runs after closing the file to apply the secure
mode.
| # Changelog | ||
|
|
||
| ## [v0.1.0] - 2025-04-26 | ||
| ### Added | ||
| - Interactive dual-mode CLI (flags or questionary prompts) | ||
| - Config registry with `auditgen config setup` | ||
| - Generates Impact Analysis, Test Cases, Code Checklist from BRD | ||
| - Windows EXE via GitHub Actions | ||
| - Input validation with friendly error messages | ||
| - Path traversal protection on ticket ID | ||
| - Ctrl+C handling across all prompts No newline at end of file |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Fix Markdown formatting for consistency.
Add blank lines around headings and a trailing newline to comply with Markdown best practices (MD022, MD047).
📝 Proposed formatting fixes
# Changelog
## [v0.1.0] - 2025-04-26
+
### Added
+
- Interactive dual-mode CLI (flags or questionary prompts)
- Config registry with `auditgen config setup`
- Generates Impact Analysis, Test Cases, Code Checklist from BRD
- Windows EXE via GitHub Actions
- Input validation with friendly error messages
- Path traversal protection on ticket ID
-- Ctrl+C handling across all prompts
+- Ctrl+C handling across all prompts
+As per coding guidelines, static analysis identified these Markdown best practices (MD022, MD047).
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Changelog | |
| ## [v0.1.0] - 2025-04-26 | |
| ### Added | |
| - Interactive dual-mode CLI (flags or questionary prompts) | |
| - Config registry with `auditgen config setup` | |
| - Generates Impact Analysis, Test Cases, Code Checklist from BRD | |
| - Windows EXE via GitHub Actions | |
| - Input validation with friendly error messages | |
| - Path traversal protection on ticket ID | |
| - Ctrl+C handling across all prompts | |
| # Changelog | |
| ## [v0.1.0] - 2025-04-26 | |
| ### Added | |
| - Interactive dual-mode CLI (flags or questionary prompts) | |
| - Config registry with `auditgen config setup` | |
| - Generates Impact Analysis, Test Cases, Code Checklist from BRD | |
| - Windows EXE via GitHub Actions | |
| - Input validation with friendly error messages | |
| - Path traversal protection on ticket ID | |
| - Ctrl+C handling across all prompts | |
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 4-4: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Above
(MD022, blanks-around-headings)
[warning] 4-4: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 11-11: Files should end with a single newline character
(MD047, single-trailing-newline)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` around lines 1 - 11, The Markdown headings in the changelog
(e.g., "# Changelog", "## [v0.1.0] - 2025-04-26", and "### Added") need blank
lines before and after each heading and the file must end with a trailing
newline to satisfy MD022/MD047; update CHANGELOG.md to insert a blank line above
"## [v0.1.0] - 2025-04-26" and above "### Added" (and ensure a blank line
between each heading and the list that follows), and add a final newline at EOF.
| @@ -0,0 +1,11 @@ | |||
| # Changelog | |||
|
|
|||
| ## [v0.1.0] - 2025-04-26 | |||
There was a problem hiding this comment.
Verify the release date.
The changelog shows 2025-04-26 but this PR was created on 2025-05-04. Ensure the date reflects when the version will actually be released, or update it to match the PR/tag date if this is a documentation-first approach.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 3-3: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` at line 3, The release date in the changelog header "##
[v0.1.0] - 2025-04-26" is incorrect; update that line to the correct release/tag
date (for example change 2025-04-26 to 2025-05-04 or the actual planned release
date) while preserving the existing header format "## [v0.1.0] - YYYY-MM-DD" so
the version heading remains consistent.
| # AudiGen CLI | ||
|
|
||
| Audit document generator CLI tool — generates Impact Analysis, Test Cases, | ||
| and Code Review Checklist from a BRD document using AI. | ||
|
|
||
| ## Requirements | ||
| - Windows 10/11 | ||
| - Gemini API key ([get one free here](https://aistudio.google.com/)) | ||
|
|
||
| ## Installation | ||
| 1. Download `auditgen.exe` from [Releases](../../releases) | ||
| 2. Place it in a folder e.g. `C:\Tools\auditgen\` | ||
| 3. Add that folder to your Windows PATH | ||
| 4. Open a new terminal and run `auditgen --help` | ||
|
|
||
| ## First Time Setup | ||
| ```cmd | ||
| auditgen config setup | ||
| ``` | ||
| Select all fields and enter your details when prompted. | ||
|
|
||
| ## Usage | ||
| ```cmd | ||
| # Interactive mode — prompts for everything | ||
| auditgen generate | ||
|
|
||
| # Direct mode — pass everything as flags | ||
| auditgen generate "path\to\brd.docx" TKT-001 -s 20-04-2025 -e 30-04-2025 | ||
|
|
||
| # View your config | ||
| auditgen config show | ||
| ``` | ||
|
|
||
| ## Output | ||
| Running `generate` produces three Excel files in your output folder: | ||
| - `TKT-001-Impact Analysis Template.xlsx` | ||
| - `TKT-001-Test Cases.xlsx` | ||
| - `TKT-001-Code Checklist.xlsx` | ||
|
|
||
| ## Built With | ||
| - Python 3.12 | ||
| - Click — CLI framework | ||
| - Google Gemini — test case generation | ||
| - openpyxl — Excel generation | ||
| - Rich + Questionary — terminal UI No newline at end of file |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Fix Markdown formatting for better readability.
The README has several formatting issues flagged by static analysis:
- Missing blank lines around headings (MD022)
- Missing blank lines around fenced code blocks (MD031)
- Missing trailing newline (MD047)
- "First Time" should be hyphenated as "First-Time" when used as an adjective
📝 Proposed formatting fixes
# AudiGen CLI
Audit document generator CLI tool — generates Impact Analysis, Test Cases,
and Code Review Checklist from a BRD document using AI.
## Requirements
+
- Windows 10/11
- Gemini API key ([get one free here](https://aistudio.google.com/))
## Installation
+
1. Download `auditgen.exe` from [Releases](../../releases)
2. Place it in a folder e.g. `C:\Tools\auditgen\`
3. Add that folder to your Windows PATH
4. Open a new terminal and run `auditgen --help`
-## First Time Setup
+## First-Time Setup
+
```cmd
auditgen config setupSelect all fields and enter your details when prompted.
Usage
# Interactive mode — prompts for everything
auditgen generate
# Direct mode — pass everything as flags
auditgen generate "path\to\brd.docx" TKT-001 -s 20-04-2025 -e 30-04-2025
# View your config
auditgen config showOutput
Running generate produces three Excel files in your output folder:
TKT-001-Impact Analysis Template.xlsxTKT-001-Test Cases.xlsxTKT-001-Code Checklist.xlsx
Built With
- Python 3.12
- Click — CLI framework
- Google Gemini — test case generation
- openpyxl — Excel generation
-- Rich + Questionary — terminal UI
+- Rich + Questionary — terminal UI
</details>
As per coding guidelines, static analysis identified these Markdown best practices (MD022, MD031, MD047) and grammar improvements.
<details>
<summary>🧰 Tools</summary>
<details>
<summary>🪛 LanguageTool</summary>
[grammar] ~16-~16: Use a hyphen to join words.
Context: ...inal and run `auditgen --help` ## First Time Setup ```cmd auditgen config setup ...
(QB_NEW_EN_HYPHEN)
</details>
<details>
<summary>🪛 markdownlint-cli2 (0.22.1)</summary>
[warning] 6-6: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 10-10: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 16-16: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 17-17: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 19-19: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 22-22: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 23-23: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
---
[warning] 34-34: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 40-40: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
---
[warning] 45-45: Files should end with a single newline character
(MD047, single-trailing-newline)
</details>
</details>
<details>
<summary>🤖 Prompt for AI Agents</summary>
Verify each finding against the current code and only fix it if needed.
In @README.md around lines 1 - 45, The README has Markdown spacing and minor
grammar issues: add a blank line before and after each heading (e.g., "# AudiGen
CLI", "## Requirements", "## Installation", "## First-Time Setup", "## Usage",
"## Output", "## Built With") and ensure fenced code blocks use blank lines
above and below the ```cmd blocks (both the single-line auditgen config setup
and the multi-line usage example). Replace the heading text "First Time Setup"
with "First-Time Setup" to hyphenate the adjective, ensure the file ends with a
trailing newline (MD047), and remove any stray or duplicate punctuation/spacing
in the "Built With" list (e.g., ensure "Rich + Questionary — terminal UI"
appears once).
</details>
<!-- fingerprinting:phantom:triton:puma:101f1b88-ee41-462b-92b9-479ef71fb4f7 -->
<!-- d98c2f50 -->
<!-- This is an auto-generated comment by CodeRabbit -->
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. ❌ Cannot run autofix: This PR has merge conflicts. Please resolve the conflicts with the base branch and try again. Alternatively, use |
|
@coderabbitai resolve merge conflict |
|
❌ An unexpected error occurred while resolving merge conflicts: Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree |
Summary by CodeRabbit
New Features
auditgen config setupcommandDocumentation