Relative Content

Tag Archive for pythonenvironment-variablesclickaccess-token

What is the proper way to store an access token for a CLI accessing an API?

I am creating a CLI using Click for accessing my API but am unsure the proper way to store the access token for the routes that require authorization. My initial thought was to store it as an environment variable, but as the CLI is not a shell or REPL and is command based the environment variable does not persist once the process dies (after the response is received and processed), so it is accessible during that command, but not accessible for any following commands.