Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

feat: allow style set via environment variable#43

Merged
reugn merged 1 commit intoreugn:mainfrom
smemsh:glamour-style-env
Feb 27, 2025
Merged

feat: allow style set via environment variable#43
reugn merged 1 commit intoreugn:mainfrom
smemsh:glamour-style-env

Conversation

@smemsh
Copy link
Contributor

@smemsh smemsh commented Feb 25, 2025

Allow the Glamour style to be set by using its standard environment variable, $GLAMOUR_STYLE. This allows all Glamour-using apps (such as GitHub CLI app) to share a style specification by setting a variable in the user's shell profile. Furthermore, it allows gemini-cli to use a style without needing to repeatedly specify --style= on the command line.

The argument can be a predefined style name or the path to a json style file, as interpreted by Glamour's WithEnvironmentConfig().

Fixes #42

@smemsh
Copy link
Contributor Author

smemsh commented Feb 25, 2025

Note, the two places using the environment variable have identical code, but they have other parts of them that can be refactored: both NewGeminiQuery() and NewHelpCommand() differ only really in the return value and parameters. So I left factoring those out to the upstream authors.

@reugn reugn changed the title implement environment var to allow style set via $GLAMOUR_STYLE feat: allow style set via environment variable Feb 26, 2025
smemsh added a commit to smemsh/gemini-cli that referenced this pull request Feb 27, 2025
This is the standard environment variable used with other Glamour apps
(such as Github CLI).  This way the user does not have to add extra
arguments (--style=) to all their comand line invocations to use a style
file, and the value of the variable will get passed to the Glamour
backend for interpretation.

Furthermore, it allows sharing settings with other Glamour-using
applications, by using an environment variable.
smemsh added a commit to smemsh/gemini-cli that referenced this pull request Feb 27, 2025
This is the standard environment variable used with other Glamour apps
(such as Github CLI).  This way the user does not have to add extra
arguments (--style=) to all their comand line invocations to use a style
file, and the value of the variable will get passed to the Glamour
backend for interpretation.

Furthermore, it allows sharing settings with other Glamour-using
applications, by using an environment variable.
smemsh added a commit to smemsh/gemini-cli that referenced this pull request Feb 27, 2025
This is the standard environment variable used with other Glamour apps
(such as Github CLI).  This way the user does not have to add extra
arguments (--style=) to all their comand line invocations to use a style
file, and the value of the variable will get passed to the Glamour
backend for interpretation.

Furthermore, it allows sharing settings with other Glamour-using
applications, by using an environment variable.
This is the standard environment variable used with other Glamour apps
(such as Github CLI).  This way the user does not have to add extra
arguments (--style=) to all their comand line invocations to use a style
file, and the value of the variable will get passed to the Glamour
backend for interpretation.

Furthermore, it allows sharing settings with other Glamour-using
applications, by using an environment variable.
Copy link
Owner

@reugn reugn left a comment

Choose a reason for hiding this comment

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

Looks good, @smemsh. Thanks.

@reugn reugn merged commit a4383c5 into reugn:main Feb 27, 2025
3 checks 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.

method to set stylepath option in config file?

2 participants