Edit on GitHub


Declares a new MLEM Object MLEM Object from config args and config files.


usage: mlem declare [-h]
                    [<subtype> [subtype options] | --load <declaration>]

Builtin subtypes:
- builder
- client
- deployment
- docker_registry
- env
- server


.mlem metafiles can be created for MLEM Objects using this command. This is particularly useful for configuring environments and deployments.

Each MLEM Object, along with its subtype (which represents a particular implementation), will accept different configuration arguments. The list of configuration arguments per type can be fetched by running the mlem types command. For an example output, check out the last example here


  • -h, --help - Show this message and exit.


Declare an environment object metafile with a config key:

# Fetch all available config args for a heroku env
$ mlem types env heroku
[not required] api_key: str = None

# Declare the heroku env
$ mlem declare env heroku production --api_key mlem_heroku_staging
💾 Saving env to staging.mlem

# Print the contents of the new heroku env metafile
$ cat staging.mlem
api_key: mlem_heroku_staging
object_type: env
type: heroku

🐛 Found an issue? Let us know! Or fix it:

Edit on GitHub

Have a question? Join our chat, we will help you:

Discord Chat