login¶
Login to Charmhub.
Charmcraft will provide a URL for the Charmhub login. When you have successfully logged in, Charmcraft will store a token for ongoing access to Charmhub at the CLI (if –export option was not used otherwise it will only save the credentials in the indicated file).
If –export <file> option is used, a secret credentials file will be created. And the file can be used to set CHARMCRAFT_AUTH environment variable.
export CHARMCRAFT_AUTH=$(cat secret)
This is suitable for Linux environments without a Vault, such as remote servers and CI/CD pipelines.
Please ensure the secret file and environment variable are secured.
Remember to charmcraft logout if you want to remove that token from your local system, especially in a shared environment.
If the credentials are exported, they can also be attenuated in several ways specifying their time-to-live (–ttl), on which channels would work (–channel), what actions will be able to do (–permission), and on which packages they will work (using –charm or –bundle).
See also charmcraft whoami to verify that you are logged in.
Usage¶
charmcraft login [options]
Options¶
--bundleThe bundle(s) on which the required credentials would work (this option can be indicated multiple times; defaults to all).
--channelThe channel(s) on which the required credentials would work (this option can be indicated multiple times, defaults to any channel).
--charmThe charm(s) on which the required credentials would work (this option can be indicated multiple times; defaults to all).
--exportExport the Charmhub unencrypted secret credentials to a file.
--permissionThe permission(s) that the required credentials will have (this option can be indicated multiple times, defaults to all permissions).
--ttlThe time-to-live (in seconds) of the required credentials (defaults to 30 hours).
Global options¶
-hor--helpShow this help message and exit.
-qor--quietOnly show warnings and errors, not progress.
-vor--verboseShow debug information and be more verbose.
--verbositySet the verbosity level to ‘quiet’, ‘brief’, ‘verbose’, ‘debug’ or ‘trace’.
-Vor--versionShow the application version and exit.