Skip to content

Develop#10

Merged
ThiruNithish28 merged 8 commits into
mainfrom
develop
May 16, 2026
Merged

Develop#10
ThiruNithish28 merged 8 commits into
mainfrom
develop

Conversation

@ThiruNithish28
Copy link
Copy Markdown
Owner

@ThiruNithish28 ThiruNithish28 commented May 4, 2026

Summary by CodeRabbit

  • New Features

    • Introduced AudiGen CLI for generating audit deliverables (Impact Analysis, Test Cases, Code Checklist) from a Business Requirements Document.
    • Added interactive dual-mode CLI supporting both prompts and direct command flags.
    • Added configuration setup command (config setup) for managing API keys and user preferences.
    • Windows executable (auditgen.exe) now available via automated builds on releases.
    • Input validation with friendly error messages and path traversal protection.
  • Documentation

    • Added comprehensive README with installation, configuration, and usage examples.
    • Added CHANGELOG documenting v0.1.0 release features.

Review Change Stack

* 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)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d90d41e5-2a41-40b9-b624-8b00b5348a6c

📥 Commits

Reviewing files that changed from the base of the PR and between df042a1 and ed26fd0.

📒 Files selected for processing (1)
  • .vscode/settings.json

📝 Walkthrough

Walkthrough

This PR delivers the v0.1.0 release of AudiGen: a complete interactive CLI application that generates audit deliverables (Impact Analysis, Test Cases, Code Checklists) from a Business Requirements Document. It includes configuration management, a Windows executable build workflow, and comprehensive user documentation.

Changes

AudiGen v0.1.0 Release

Layer / File(s) Summary
CLI Configuration and Helper Functions
audigen_cli/cli.py (lines 1–89)
Establishes the CLI module with CONFIG_FIELDS describing interactive prompts, _prompt_for_field() for collecting configuration values with optional masking, _ask() for centralized Ctrl+C handling, and _assert_valid_date() for date validation.
Configuration Management Commands
audigen_cli/cli.py (lines 93–150)
Implements the root cli() group and config() subgroup, with config_setup() to interactively select and set configuration fields (API key, default user/approver, output directory) and config_show() to display current configuration in a table.
Generate Command and CLI Entrypoint
audigen_cli/cli.py (lines 155–273)
Implements the main generate() command that collects BRD/ticket/dates/user/approver/complexity/priority (from flags or prompts), validates inputs, orchestrates a three-step pipeline (extract BRD → call Gemini LLM → write Excel outputs), and displays results. Includes a __main__ entrypoint with crash logging to ~/auditgen_crash.log.
Windows Executable Build Workflow
.github/workflows/build.yml (all lines)
Defines a GitHub Actions workflow triggered on v* tags or manual dispatch that sets up Python 3.12, installs Poetry and dependencies, builds a one-file Windows executable using PyInstaller with explicit hidden imports, uploads the artifact, and attaches it to a GitHub Release with auto-generated notes.
Release Documentation
CHANGELOG.md, README.md
Introduces CHANGELOG.md with v0.1.0 release notes (2025-04-26) listing dual-mode CLI, config setup, BRD-to-output generation, Windows packaging, and input validation. Updates README.md with project purpose, Windows/Gemini requirements, installation/setup/usage examples, output file descriptions, and technology stack (Python 3.12, Click, Gemini, openpyxl, Rich/Questionary).
Development Environment Configuration
.vscode/settings.json
Configures VS Code to use Poetry as the default Python environment manager and package manager.

Sequence Diagram

sequenceDiagram
  participant User
  participant CLI as generate command
  participant BRD as extractDoc
  participant LLM as callLLM
  participant Excel as startExcelChange
  participant Output as Excel File
  User->>CLI: auditgen generate [flags/interactive]
  CLI->>CLI: Collect input (BRD, ticket, dates, user, approver, complexity, priority)
  CLI->>CLI: Validate dates and output directory
  CLI->>BRD: Extract requirements from BRD file
  BRD->>CLI: Return extracted content
  CLI->>LLM: Generate test cases via Gemini API
  LLM->>CLI: Return generated results
  CLI->>Excel: Write Impact Analysis, Test Cases, Code Checklist
  Excel->>Output: Create three Excel files
  CLI->>User: Display summary and file locations
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ThiruNithish28/audiGen-cli#3: Modifies the GitHub Actions Windows executable build workflow to package auditgen.exe via PyInstaller.
  • ThiruNithish28/audiGen-cli#2: Introduces the CONFIG_FIELDS-driven config setup/show workflow and refactors the generate command to use questionary-backed interactive prompts.

Suggested labels

enhancement

Poem

🐰 A rabbit hops forth with CLI in hand,
Config and prompts across Windows land,
From BRD to Excel, three steps so bright,
With Gemini's aid and PyInstaller's might!
Release v0.1.0—let auditing take flight! 🚀

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.77% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The pull request title 'Develop' is vague and generic, providing no meaningful information about the actual changes in the pull request. Replace the title with a descriptive summary of the main changes, such as 'Add CLI implementation with config management and build workflow' or 'Implement AudiGen CLI with interactive prompts and GitHub Actions build pipeline'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ThiruNithish28 ThiruNithish28 self-assigned this May 4, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 118323b and df042a1.

⛔ Files ignored due to path filters (2)
  • poetry.lock is excluded by !**/*.lock
  • template/Vendor initiation date and time should be captured in the checklevel report.docx is excluded by !**/*.docx
📒 Files selected for processing (12)
  • .github/workflows/build.yml
  • CHANGELOG.md
  • README.md
  • audigen_cli/banner.py
  • audigen_cli/cli.py
  • audigen_cli/config.py
  • audigen_cli/excelWriter.py
  • audigen_cli/extractor.py
  • audigen_cli/llm_client.py
  • audigen_cli/ui.py
  • audigen_cli/utils.py
  • pyproject.toml
💤 Files with no reviewable changes (1)
  • audigen_cli/llm_client.py

Comment on lines +3 to +4
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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"
done

Repository: 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:


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.

Comment on lines +60 to +64
- name: Create Github Release
uses: softprops/action-gh-release@v2
with:
files: dist/auditgen.exe
generate_release_notes: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
- 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.

Comment thread audigen_cli/banner.py
Comment on lines +1 to +5
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

Comment thread audigen_cli/cli.py
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))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

Comment thread audigen_cli/cli.py
Comment on lines +114 to +117
selected_keys = questionary.checkbox(
"Select fields to configure:(space to toggle, enter to confirm)",
choices=choices
).ask()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

Comment thread audigen_cli/config.py
Comment on lines +17 to +22
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)}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Comment thread audigen_cli/config.py
Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
Comment thread README.md
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

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 to automatically resolve the conflicts.

@ThiruNithish28
Copy link
Copy Markdown
Owner Author

@coderabbitai resolve merge conflict

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

An unexpected error occurred while resolving merge conflicts:

Resource not accessible by integration - https://docs.github.com/rest/git/trees#create-a-tree

@ThiruNithish28 ThiruNithish28 merged commit 90b33a6 into main May 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant