tt icon indicating copy to clipboard operation
tt copied to clipboard

Please respect TT_CLI_CFG environment variable as a path to tt.yaml

Open ochaton opened this issue 1 year ago • 1 comments

Subject

I use the single tt binary in various $PWD directories, and sometimes the autodiscovery of tt.yaml works as expected, but other times it does not. Having to specify --cfg each time is not always convenient.

Could you please add a feature to retrieve the value from the TT_CLI_CFG environment variable as a path to tt.yaml and use it before the autodiscovery mechanism of tt.yaml?

The path of tt.yaml specified with the --cfg option must take priority over the TT_CLI_CFG environment variable. Therefore, the precedence should be as follows:

  1. The --cfg option, if specified (must throw an error when the file is not readable).
  2. The TT_CLI_CFG environment variable (works the same as --cfg).
  3. The existing autodiscovery mechanism of tt.yaml.

tt cfg dump should indicate that the configuration was taken from the TT_CLI_CFG environment variable and print the resolved absolute path to tt.yaml.

ochaton avatar Apr 03 '24 11:04 ochaton

Since the configuration discovery process is somewhat complex, it would be helpful to have a log message (debug-level) detailing the location of the found configuration file.

psergee avatar Apr 05 '24 07:04 psergee