Skip to content

💡 Feature Request: Use environment variables (e.g., $env:USERPROFILE or %USERPROFILE%) instead of hardcoded Windows paths #365

@oualigit

Description

@oualigit

When returning file paths for Windows systems, it would be much more robust and user-friendly if the AI-generated responses used environment variables such as:

%USERPROFILE% in CMD

$env:USERPROFILE in PowerShell

...instead of hardcoding paths like C:\Users\YourUsername\Documents, which do not generalize across systems.

Use Case
Many users copy and paste commands directly into their terminal. Hardcoded usernames cause confusion or require manual editing. For example:

❌ cd C:\Users\JohnDoe\Desktop
✅ cd $env:USERPROFILE\Desktop (PowerShell)
✅ cd %USERPROFILE%\Desktop (CMD)

This would make tgpt more context-aware and reduce friction for users on Windows systems.

Suggested Implementation
Add this behavior by default, or allow it via a flag like --dynamic-paths or a config setting. Even better, make it part of the default behavior on Windows.

Related Context
This behavior is especially useful for commands involving:

File navigation

Script generation

Downloads and documents folder references

User-specific configuration paths

Thanks for the great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions