Skip to content

feat: add PDF export support to CLI (#1734)#2005

Open
Harini-2811 wants to merge 2 commits into
utksh1:mainfrom
Harini-2811:feat/cli-pdf-export
Open

feat: add PDF export support to CLI (#1734)#2005
Harini-2811 wants to merge 2 commits into
utksh1:mainfrom
Harini-2811:feat/cli-pdf-export

Conversation

@Harini-2811

Copy link
Copy Markdown
Collaborator

Description

Added PDF export support to the SecuScan CLI. Previously, the --format flag supported sarif, json, csv, html, and console but not pdf. This change adds pdf as a valid format option in the CLI, reusing the existing generate_pdf_report() logic from ReportGenerator and the build_report_filename() helper already used by the API route.

Related Issues

Closes #1734

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  1. Run a scan via CLI with explicit output path:
   python -m backend.secuscan.cli scan <target> --plugin <plugin_id> --format pdf -o report.pdf
  1. Verify the PDF is saved at the specified path.
  2. Open the PDF and confirm it includes scan summary, severity breakdown, and findings.
  3. Run without --output to confirm auto-generated filename works:
   python -m backend.secuscan.cli scan <target> --plugin <plugin_id> --format pdf
  1. Confirm existing formats (html, json, csv, sarif, console) are unaffected.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label area:backend Backend API, database, or service work labels Jul 13, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for adding the PDF option. Please add focused regression coverage before this is merge-ready: a CLI test (or equivalent unit test around the scan export path) should verify that --format pdf calls the PDF report generator, writes bytes to the selected output path/default filename, and handles RuntimeError cleanly. Right now the new behavior is untested, so this could regress silently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Security Report PDF

2 participants