Snapcraft top-level metadata

The top-level keys and values in snapcraft.yaml provide the snap build process, and the store, with the overarching details of a snap.

See Snapcraft app metadata and Snapcraft parts metadata for details on how apps and parts are configured within snapcraft.yaml.

Top-level details include a snap’s name, version and description, alongside operational values such as its confinement level and supported architecture.

Name Description
name
mandatory
The name of the snap.
Type: string
Max len. 30 chars, must start with an ASCII character, can only use ASCII lowercase letters, numbers, and hyphens, and must have at least one letter.
Example: my-awesome-app
base
optional
A snap of type base to be used as the execution environment for this snap.
Example: core18
version
mandatory
A user facing version to display.
Type: string
Max len. 32 chars. Needs to be wrapped with single-quotes when the value will be interpreted by the YAML parser as non-string
Examples: '1', '1.2', '1.2.3', git (will be replaced by a git describe based version string)
summary
mandatory
Sentence summarising the snap.
Type: string
Max len. 78 characters, describing the snap in short and simple terms.
Example: The super cat generator
description
mandatory
Multi-line description of the snap.
Type: string
A more in-depth look at what your snap does and who may find it most useful.
type
optional
The type of snap, implicitly set to app if not set.
Type: enum
For more details, see: gadget, kernel, base
confinement
optional
Determines if the snap should be restricted in access or not.
Type: enum
Possible values are strict (for no access outside of declared interfaces through plugs), devmode (for unrestricted access) or classic. For more information, refer to Confinement
Examples: strict, or devmode
icon
optional
Path to icon image that represents the snap.
Type: string
Relative path to a PNG/SVG file from the source tree root.
Example: share/icons/_package_name_.svg
logo.png
grade
optional
Defines the quality grade of the snap.
Type: enum
Can be either devel (i.e. a development version of the snap, so not to be published to the stable or candidate channels) or stable (i.e. a stable release or release candidate, which can be released to all channels)
architectures
optional
List of build and run architectures.
Type: list[object]
For more details, see Architectures.
assumes
optional
A list of features that must be supported by the core in order for this snap to install.
Type: list[string]
passthrough
optional
Attributes to passthrough to snap.yaml without validation from snapcraft.
Type: type[object]
See Using development features in snapcraft for more details.

Plugs and slots for an interface are usually configured per-app or per-daemon within snapcraft.yaml. See Snapcraft app metadata for more details. However, snapcraft.yaml also enables global plugs and slots configuration for an entire snap:

Name Description
plugs
optional
A set of plugs that the snap asserts.
Type: dict
These plugs apply to all apps and differs from apps.<app-name>.plugs in that the type is in a dict rather than a list format, :(colon) must be postfixed to the interface name and shouldn’t start with -(dash-space)
Example: [home, removable-media, gnome-platform-plug]
plugs.<plug-name>
optional
A set of attributes for a plug
Type: dict
Example: read attribute for the home interface
plugs.<plug-name>.<attribute-name>
optional
Value of the attribute
Type: string
Example: all for read attribute of the home interface
slots
optional
A set of slots that the snap provides.
Type dict
These slots apply to all the apps
slots.<slot-name>
optional
A set of attributes of the slot
Type: dict
slots.<slot-name>.<attribute-name>
optional
Value of the attribute
Type: dict

Last updated 24 days ago. Help improve this document in the forum.