denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
14.61k stars 489 forks source link

Clearer information about the `.cheat` files and `navi` config paths #860

Closed tapyu closed 6 months ago

tapyu commented 7 months ago

It is unclear how .cheat file and config file paths are defined. On my Linux machine, the .cheat path is being placed at ~/.local/share/navi/cheats and the config file is being placed at ~/.conifg/navi/config.yaml. However, due to the lack of a proper documentation, I am not sure how this path was resolved for both.

  1. Does it have anything to do with the XDG Base Directory Specification? $XDG_DATA_HOME and $XDG_CONFIG_HOME are set as global environment variables and I don't know whether navi uses this information to define .cheat and config path.
  2. The navi info cheats-path command is not mentioned anyhere in docs/. It is only used (but not explained) in cheatsheet_repositories.md.
  3. The possibility of adding more paths by using the navi config file also not mentioned anywhere.
  4. There is no information about overwriting the .cheat file paths at runtime with the $NAVI_PATH environment variable. One mentions the overwrite only at compile time, but not at runtime.
  5. There is no information about passing the --path option to navi to add more .cheat file paths. AFAIK, it is only said in the navi --help command but should also be present in the README.md or docs/.
  6. Finally, there is no information about which setting takes precedence over which one.

Concerning the config file path:

  1. There is no information about how to set NAVI_CONFIG_YAML or NAVI_CONFIG. The unique information that I could find is on --help message, and it didn't get it. NAVI_CONFIG_YAML seems to be deprecated as it doesn't affect anything. NAVI_CONFIG is mentioned in the installation manual, but it is only at compile time.

I would like to discuss more about it, I am opening a pull request to address these issues. Any misinterpretation on my side, please let me know.

welcome[bot] commented 7 months ago

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)