# basic data
juju info <charm-name>
# parseable output
juju info <charm-name> --format yaml
# build for specific series
charmcraft pack --bases-index=0 # `0` first base in charmcraft.yaml
# uploaded revision
charmcraft revisions <charm-name>
# uploaded resource revisions
charmcraft resource-revisions <charm-name> <resource-name>
# status with attached resources
charmcraft status <charm-name>
# upload charm from the charm directory
charmcraft upload *.charm
# upload a OCI image
charmcraft upload-resource <charm-name> <resource-name> --image=sha256:c8f0dbc0d...
# or
charmcraft upload-resource <charm-name> <resource-name> --image=docker.io/<namespace>/<image>:<tag>
NOTE: when uploading a image, if the image is not available in canonical registries, it must be locally present.
# download the .charm (zip) file
juju download <charm-name> --channel latest/stable --filepath <file_name>.charm
# NOTE: one cannot set a revision
# with a previously uploaded charm (identified by the revision number)
charmcraft release mysql --revision=<revision_number> --channel=latest/edge
# publish when uploading
charmcraft upload --release latest/stable ./<local-charm-file>
# publish/update lib from charm directory
charmcraft publish-lib
# publish to a (hidden) branch
charmcraft upload ./mysql_ubuntu-20.04-amd64.charm --release=latest/edge/secret_branch
per charm token used programatically in ci/cd Note the permissions and channels access
charmcraft login --export output.auth \
--charm=<charm-name> --permission=package-manage \
--permission=package-manage-revisions \
--permission=package-manage-releases \
--permission=package-view \
--channel=latest/edge \ # channel permissions
--channel=latest/candidate \
--ttl 31536000 # expire time in seconds
To use it, define token content in env var CHARMCRAFT_AUTH
, e.g.:
CHARMCRAFT_AUTH="$(cat output.auth)" charmcraft <your_command>