Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance --sysinfo with version data and environment variable insights #1195

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

Vikranth3140
Copy link
Contributor

This PR addresses #1194 by enhancing the --sysinfo command-line argument in the GPT-Engineer CLI tool. The --sysinfo argument now provides detailed system information, including the version of gpt-engineer and environment variables with sensitive data masked for security.

Changes Include:

  • New Functionality:
    • Added functions get_gpt_engineer_version and get_env_variables to retrieve version data and environment variables.
    • Updated get_system_info to include version and environment variable insights.
  • File Modifications:
    • Updated main.py to include the --sysinfo option and corresponding logic for gathering and displaying the additional information.

Usage:

To use the enhanced --sysinfo feature, run the following command:

python main.py --sysinfo

This will display the following information:

  • gpt-engineer Version
  • Operating System and Version
  • System Architecture
  • Python Version
  • Installed Python Packages and their Versions
  • Environment Variables (with sensitive data masked)

Example Output:

gpt_engineer_version: 0.1.0
os: Linux
os_version: #1 SMP Wed Dec 15 10:30:14 UTC 2021
architecture: x86_64
python_version: 3.10.2 (default, Jan 14 2022, 00:00:00) [GCC 7.5.0]
packages: {"typer": "0.4.0", "openai": "0.10.1", ...}
env_variables: {"OPENAI_API_KEY": "*****", "OTHER_VAR": "value"}

Notes:

  • This enhancement aims to help users and developers quickly gather essential system information, facilitating easier debugging and support.
  • Masking sensitive data in environment variables ensures security and compliance with best practices.

Please review the changes and provide feedback. Thank you!

@captivus
Copy link
Collaborator

Right on, @Vikranth3140! Can you work the version details to distinguish between pip installs and builds of the repo directly?

@Vikranth3140 Vikranth3140 changed the title Enhance -sysinfo with version data and environment variable insights Enhance --sysinfo with version data and environment variable insights Jul 26, 2024
@Vikranth3140
Copy link
Contributor Author

Hey @captivus,

I've updated the get_gpt_engineer_version function to distinguish between pip installs and direct repo builds. The function now checks for the version via pip first and, if not found, retrieves the version from git tags for direct repo builds.

Thanks for the feedback! Please review the changes and let me know if any further adjustments are needed.

@Vikranth3140
Copy link
Contributor Author

Hey @captivus,

Below is an example of how the --sysinfo output will look:

python main.py --sysinfo

Output:

gpt_engineer_version: pip version: 0.1.0
os: Linux
os_version: #22~22.04.1-Ubuntu SMP Tue Apr 30 16:08:18 UTC 2024
architecture: x86_64
python_version: 3.10.13 (main, May 30 2024, 20:38:07) [GCC 9.4.0]
packages: 
accessible-pygments: 0.0.4
aiohttp: 3.9.5
aiosignal: 1.3.1
alabaster: 0.7.16
annotated-types: 0.6.0
... (and more)
env_variables: 
OPENAI_API_KEY: *****
OTHER_VAR: value

Thanks for the feedback! Please review the changes and let me know if any further adjustments are needed.

@viborc viborc requested a review from captivus August 1, 2024 16:56
@viborc
Copy link
Collaborator

viborc commented Aug 1, 2024

Great job with this @Vikranth3140!

@captivus, your review would be much appreciated. This LGTM, but I would love you to take a look at it, too.

@Vikranth3140
Copy link
Contributor Author

Hey @captivus,

Do let me know if any changes are needed

@viborc
Copy link
Collaborator

viborc commented Aug 8, 2024

Hey @Vikranth3140, @captivus is a little less available right now, but we will look into this. It lgtm, but I'd still wait for his confirmation and green light.

Thanks for your swift work on this!

Hey @captivus,

Do let me know if any changes are needed

Copy link

@RahulVadisetty91 RahulVadisetty91 left a comment

Choose a reason for hiding this comment

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

re9

Depending on how you want the self-heal mode to operate, you might need to change how errors are captured and managed during this mode.

@Vikranth3140
Copy link
Contributor Author

Hey @viborc,

Any update on this PR as I have made the system information more verbose and all the checks have passed successfully.

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.

4 participants