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

Request: follow XDG Base Directory specification for stored config #205

Open
jonschlinkert opened this issue Jul 23, 2020 · 5 comments
Open
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: community enhancement feature request not on Twilio's roadmap

Comments

@jonschlinkert
Copy link

In #37, config was moved to .twilio-cli/config.json, however, this is less than idiomatic as many developers strongly prefer not to clutter up the user directory with custom confirmation files or folders.

Instead, I'd like to recommend that we follow the XDG Base Directory specification, which provides sensible defaults for the config directory to use, but also allows users to override with environment variables.

If we decide to implement this, I think it can be done in a backwards compatible way. Also, FWIW I created this library for this purpose (on other projects), but I won't be offended in the least if you wanted to use something different.

@childish-sambino
Copy link
Contributor

Thanks for bringing this to our attention. oclif itself does support XDG base directories (source), but I don't think we liked that the fallback was to splitting up the dirs into separate locations (docs). So, we added an environment configuration that gets run before commands are executed and essentially nullifies any XDG base directory stuff that oclif would have done otherwise.

Perhaps not the best decision, but it's worked well thus far and I don't think we want to break things to force splitting up the directories in this point.

That said, configureEnv could be modified to honor XDG base directory env vars. Essentially don't set the TWILIO_(.+)_DIR var if the XDG_$1_HOME var is already set. I think this would then allow the XDG env vars to take precedence.

@childish-sambino childish-sambino added status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jul 24, 2020
@jonschlinkert
Copy link
Author

jonschlinkert commented Jul 24, 2020 via email

@childish-sambino
Copy link
Contributor

childish-sambino commented Jul 24, 2020

I'm fine with leaving it open as an enhancement request:

configureEnv could be modified to honor XDG base directory env vars. Essentially don't set the TWILIO_(.+)_DIR var if the XDG_$1_HOME var is already set.

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@childish-sambino childish-sambino added difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap and removed status: waiting for feedback waiting for feedback from the submitter type: question question directed at the library labels Jul 24, 2020
@austintraver
Copy link

I'd love to help with this, I'd just need someone to point me in the right direction.

If instead of ${HOME}/.twilio-cli, configuration files could be installed at ${XDG_CONFIG_HOME}/twilio as a base directory, as a suggested alternative to ${XDG_CONFIG_HOME}/twilio-cli, which I prefer less by comparison.

I mean, there's no other Twilio service that uses the XDG base directory specification, it's only fitting to make a twilio directory 😄

@jonschlinkert
Copy link
Author

jonschlinkert commented Sep 7, 2020

I mean, there's no other Twilio service that uses the XDG base directory specification, it's only fitting to make a twilio directory

Even if you use ${XDG_CONFIG_HOME}/twilio, you can still avoid conflict via naming conventions inside the directory.

@shrutiburman shrutiburman added the triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. label Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community triage queue Issue is in our internal backlog. It's either a bug or a feature enhancement. type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

4 participants