Skip to content

ttab/clitools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLI tools

Go Reference

The clitools contains helpers for building TT CLI tools.

Logging in using the ConfigurationHandler

See the example in the Go docs.

Configuration and tokens will be saved in $XDG_CONFIG_HOME or the appropriate user configuration directory for your platform, for Linux this is "~/.config/[name of application]/". Configuration is stored in "config.json" and the access tokens in "tokens.json".

Configuration directory and environment loading

UserConfigDir() gives preference to XDG_CONFIG_HOME, letting users in any OS specify a linux-style user config location. If XDG_CONFIG_HOME is empty it behaves just like os.UserConfigDir().

LoadEnv() loads any ".env" (override by setting DOT_ENV) in the current path and "[user config dir]/[app]/config.env" if they exist. This will not override any variables that are set, and the .env file takes precedence over config.env.

About

Helpers for building cli tools

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages