create-lib

Create a charm library.

Charmcraft manages charm libraries, which are published by charmers to help other charmers integrate their charms. This command creates a new library in your charm which you are publishing for others.

This command MUST be run inside your charm directory with a valid metadata.yaml. It will create the Python library with API version 0 initially:

lib/charms/<yourcharm>/v0/<name>.py

Each library has a unique identifier assigned by Charmhub that supports accurate updates of libraries even if charms are renamed. Charmcraft will request a unique ID from Charmhub and initialise a template Python library.

Creating a charm library will take you through login if needed.

Usage

charmcraft create-lib [options] <None>

Required

None

The name of the library file (e.g. ‘db’).

Options

--format

Produce the result in the specified format (currently only ‘json’).

Global options

-h or --help

Show this help message and exit.

-q or --quiet

Only show warnings and errors, not progress.

-v or --verbose

Show debug information and be more verbose.

--verbosity

Set the verbosity level to ‘quiet’, ‘brief’, ‘verbose’, ‘debug’ or ‘trace’.

-V or --version

Show the application version and exit.