Skip to content

Add CLI tool for terminal-based code analysis#183

Open
AnubhavC-001 wants to merge 3 commits into
imDarshanGK:mainfrom
AnubhavC-001:feature-cli-tool
Open

Add CLI tool for terminal-based code analysis#183
AnubhavC-001 wants to merge 3 commits into
imDarshanGK:mainfrom
AnubhavC-001:feature-cli-tool

Conversation

@AnubhavC-001
Copy link
Copy Markdown
Contributor

Summary

Implemented a command-line interface for QyverixAI so developers can analyze files directly from the terminal without opening the browser UI.

Features Added

  • Rich colored terminal output using rich
  • Explanation, debugging, and suggestions tables
  • Bug reporting with line numbers and severity
  • Quality score bar with grade display
  • --json flag for machine-readable output
  • --api-url flag for custom backend support
  • Sample test file for CLI validation

Files Added

  • cli/qyverix.py
  • cli/requirements.txt
  • cli/README.md
  • cli/test_sample.py

Testing

Tested locally with:

  • Python source files
  • JSON output mode
  • Custom backend URL support
  • Running FastAPI backend integration
  • CLI validation using test_sample.py

Verified successful CLI analysis output and formatted reporting.

Notes

The CLI communicates directly with the /analyze/ backend endpoint and provides a lightweight terminal workflow for developers.

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

Completed implementation for the CLI tool feature.

Implemented:

  • Rich terminal UI
  • Bug reporting tables
  • Suggestions and quality score display
  • JSON output support
  • Custom API URL support
  • CLI sample test file
  • Documentation and setup guide

PR: #183

Please review when possible. Thank you!

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

Hi @imDarshanGK , my PR #102 and PR #153 have been merged successfully. I just wanted to confirm whether the required GSSoC labels/tags have been added correctly so the contributions can reflect on the dashboard. Thank you!

@imDarshanGK
Copy link
Copy Markdown
Owner

@AnubhavC-001 Could you please attach the related issue number to this PR for proper tracking? Thanks!

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

PR #183 for ISSUE #136

@imDarshanGK imDarshanGK self-requested a review as a code owner May 21, 2026 13:33
Copy link
Copy Markdown
Owner

@imDarshanGK imDarshanGK left a comment

Choose a reason for hiding this comment

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

@AnubhavC-001 Thanks for the CLI work. This is not ready to merge yet because the issue requirements are only partially implemented. Please add support for --mode debug, --output, and --recursive directory analysis, and make sure the CLI handles both single files and folders as requested. After that, I can re-review

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

AnubhavC-001 commented May 21, 2026

Thanks for the detailed review and feedback.

I’ll work on the remaining requirements:

  • --mode debug
  • --output
  • recursive directory analysis
  • proper handling for both single files and folders

I’ll update the implementation and request re-review once completed.

GSSoC Contributor

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

AnubhavC-001 commented May 21, 2026

Implemented the requested CLI improvements and updated the branch with the latest changes.

Added Features

  • Added --mode support for dynamic endpoint selection (analyze, debug, suggest)
  • Added --output support to save JSON analysis reports into files
  • Added recursive directory analysis using --recursive
  • Added handling for both single file and directory inputs
  • Added directory safety validation to prevent accidental recursive scans
  • Added support for analyzing multiple supported file types recursively

Testing Performed

Successfully tested:

  • single file analysis
  • recursive folder scanning
  • debug mode execution
  • JSON response output
  • output file generation
  • backend integration with local API server

Additional Work

  • Synced branch with latest upstream changes
  • Resolved rebase/update conflicts
  • Verified CLI execution after branch synchronization

Requesting re-review whenever possible.

GSSoC Contributor

@AnubhavC-001 AnubhavC-001 requested a review from imDarshanGK May 21, 2026 15:14
@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

Hi @imDarshanGK
Please check this pr whenever possible.
Thank you

Copy link
Copy Markdown
Owner

@imDarshanGK imDarshanGK left a comment

Choose a reason for hiding this comment

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

The PR is linked to #136, but it still has a functional bug: the --api-url flag is parsed in cli/qyverix.py but never used when building the request URL in cli/qyverix.py, so custom backend support does not work. Please wire args.api_url into the request path, then I can review again.

@AnubhavC-001
Copy link
Copy Markdown
Contributor Author

Thanks for catching that.

The CLI was parsing --api-url correctly, but the endpoint URL construction was still using the default base URL. I've updated the routing logic to build request URLs from the user-provided --api-url value, so custom backend instances are now respected properly.

The fix has been pushed to the branch. Please re-review when convenient.

GSSoC Contributor 🚀

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.

2 participants