Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]
ContentsContents
AppStream
  1. 1 About AppStream
  2. 2 Upstream Metadata
  3. 3 Catalog Metadata
  4. 4 Miscellaneous
  5. 5 Metadata Quickstart
  6. 6 Data Validation
  7. 7 Manual pages
      appstreamcli 2012-2024Matthias Klumpp AppStream 26 July,2012 appstreamcli1appstreamcliHandle AppStream metadata formats and query AppStream dataappstreamcliCOMMANDDescription This manual page documents briefly the appstreamcli command. appstreamcli is a small helper tool to work with AppStream metadata and access the AppStream component index from the command-line. The AppStream component index contains a list of all available software components for your distribution, matched to their package names. It is generated using AppStream XML or Debian DEP-11 data, which is provided by your distributor. For more information about the AppStream project and the other components which are part of it, take a look at the AppStream pages at Freedesktop.org. Optionsget IDGet a component from the metadata pool by its identifier.ssearch TERMSearch the AppStream component pool for a given search term.what-provides TYPE TERM Return components which provide a given item. An item type can be specified using the TYPE parameter, a value to search for has to be supplied using the TERM parameter. Examples: Get components which handle the "text/xml" mediatype. appstreamcli what-provides mediatype "text/xml" Get component which provides the "libfoo.so.2" library. appstreamcli what-provides lib libfoo.so.2 refreshrefresh-cache Trigger a database refresh, if necessary. In case you want to force the database to be rebuilt, supply the --force flag. This command must be executed with root permission.status Display various information about the installed metadata and the metadata cache. os-info Show information about the current operating system from the metadata index. This requires the operating system to provide a operating-system component for itself. dump ID Dump the complete XML descriptions of components with the given ID that were found in the metadata pool. validate FILES Validate AppStream XML metadata for compliance with the specification. Both XML metadata types, upstream and distro XML, are handled. The format type which should be validated is determined automatically. The --pedantic flag triggers a more pedantic validation of the file, including minor and style issues in the report. validate-tree DIRECTORY Validate AppStream XML metadata found in a file-tree. This performs a standard validation of all found metadata, but also checks for additional errors, like the presence of .desktop files and validity of other additional metadata. check-license LICENSE Test a license string or license expression for validity and display details about it. This will check whether the license string is considered to be valid for AppStream, and return a non-zero exit code if it is not. The command will also display useful information like the canonical ID of a license, whether it is suitable as license for AppStream metadata, and whether the license is considered to be for Free and Open Source software or proprietary software. AppStream will consider any license as Free and Open Source that is marked as suitable by either the Free Software Foundation (FSF), Open Source Initiative (OSI) or explicit license list of the Debian Free Software Guidelines (DFSG). install ID Install a software component by its ID using the package manager or Flatpak. This resolves the AppStream component ID to an installation candidate and then calls either the native package manager or Flatpak (if available) to install the component. remove ID Uninstall a software component by its ID using the package manager or Flatpak. This will uninstall software matching the selected ID using either the native package manager or Flatpak (if available). put FILE Install a metadata file into the right directory on the current machine. compare-versionsvercmp VER1 [CMP] VER2 Compare two version numbers. If two version numbers are given as parameters, the versions will be compared and the comparison result will be printed to stdout. If a version number, a comparison operator and another version number are passed in as parameter, the result of the comparison operation will be printed to stdout, and appstreamcli will exit with a non-zero exit status in case the comparison failed. The comparison operator can be one of the following: eq - Equal tone - Not equal tolt - Less thangt - Greater thanle - Less than or equal toge - Greater than or equal tonew-template TYPE FILE Create a metainfo file template to be used by software projects. The --from-desktop option can be used to use a .desktop file as template for generating the example file. The generated files contain example entries which need to be filed in with the actual desired values by the project author. The first TYPE parameter is the name of an AppStream component type. For a complete list check out the documentation or the help output of appstreamcli for this subcommand. make-desktop-file MI_FILE DESKTOP_FILE Create a XDG desktop-entry file from a metainfo file. If the desktop-entry file specified in DESKTOP_FILE already exists, it will get extended with the new information extracted from the metainfo file. Otherwise a new file will be created. This command will use the first binary mentioned in a provides tag of the component for the Exec= field of the new desktop-entry file. If this is not the desired behavior, the --exec flag can be used to explicitly define a binary to launch. Other methods of launching the application are currently not supported. In order to generate a proper desktop-entry, this command assumes that not only the minimally required tags for an AppStream component are set, but also that it has an <icon/> tag of type "stock" to describe the stock icon that should be used as well as a <categories/> tag containing the categories the application should be placed in. news-to-metainfo NEWS_FILE MI_FILE [OUT_FILE] This command converts a NEWS file as used by many open source projects into the XML used by AppStream. Since NEWS files are free text, a lot of heuristics will be applied to get reasonable results. The converter can also read a YAML version of the AppStream release description and convert it to XML as well. If the metainfo file MI_FILE already exists, it will be augmented with the new release entries, otherwise the release entries will be written without any wrapping component. If [OUT_FILE] is specified, instead of acting on MI_FILE the changed data will be written to the particular file. If any of the output filenames is set to "-", the output will instead be written to stdout. The --format option can be used to enforce reading the input file in a specific format ("text" or "yaml") in case the format autodetection fails. The --limit option is used to limit the amount of release entries written (the newest entries will always be first). metainfo-to-news MI_FILE NEWS_FILE This command reverses the news-to-metainfo command and writes a NEWS file as text or YAML using the XML contained in a metainfo file. If NEWS_FILE is set to "-", the resulting data will be written to stdout instead of to a file. The --format option can be used to explicitly specify the output format ("yaml" or "text"). If it is not set, appstreamcli will guess which format is most suitable. convert FILE1 FILE1 Converts AppStream XML metadata into its YAML representation and vice versa. compose Composes an AppStream metadata catalog from a directory tree with metainfo files. This command is only available if the org.freedesktop.appstream.compose component is installed. See appstreamcli-compose1 for more information. --detailsPrint out more information about a found component.--no-colorDon't print colored output.--no-netDo not access the network when validating metadata. The same effect can be achieved by setting the AS_VALIDATE_NONET environment variable before running appstreamcli. --versionDisplay the version number of appstreamcliSee Alsopkcon1.AUTHOR This manual page was written by Matthias Klumpp matthias@tenstral.net. appstreamcli compose 2020-2024Matthias Klumpp AppStream 28 Aug,2020 appstreamcli compose1appstreamcli-composeCompose AppStream metadata catalog from directory treesappstreamcli composeCOMMANDDescription This manual page documents briefly the appstreamcli compose command. The appstreamcli compose tool is used to construct AppStream metadata catalogs from directory trees. The tool will also perform many related metadata generation actions, like resizing icons and screenshots and merging in data from referenced desktop-entry files as well as translation status information. Therefore, the tool provides a fast way to test how the final processed metadata for an application that is shipped to users may look like. It also provides a way to easily generate AppStream data for projects which do not need a more complex data generator like appstream-generator. In order for the appstreamcli compose command to be available, you may need to install the optional compose module for appstreamcli first. For more information about the AppStream project and the other components which are part of it, take a look at the AppStream pages at Freedesktop.org. OptionsSOURCE-DIRECTORIES A list of directories to process needs to be provided as positional parameters. Data from all directories will be combined into one output namespace. --origin NAME Set the AppStream data origin identifier. This can be a value like "debian-unstable-main" or "flathub". --result-root DIR Sets the directory where all generated output that is deployed to a user's machine is exported to. If this parameter is not set and we only have one directory to process, we use that directory as default output path. If both --data-dir and --icons-dir are set, --result-root is not necessary and no data will be written to that directory. --data-dir DIR Override the directory where the generated AppStream metadata catalog will be written to. Data will be written directly to this directory, and no supdirectories will be created (unlike when using --result-root to set an output location). --icons-dir DIR Override the directory where the cached icons are exported to. --hints-dir DIR Set a directory where hints reported generated during metadata processing are saved to. If this parameter is not set, no HTML/YAML hint reports will be saved. --media-dir DIR If set, creates a directory with media content (icons, screenshots, ...) that can be served via a webserver. The metadata will be extended to include information about these remote media. --media-baseurl URL The URL under which the contents of a directory set via --media-dir will be served. This value must be set if a media directory is created. --prefix DIR Set the default prefix that is used in the processed directories. If none is set explicitly, /usr is assumed. --print-report MODE Print the issue hints report (that gets exported as HTML and YAML document when --hints-dir was set) to the console in text form. Various print modes are supported: on-error only prints a short report if the run failed (default), short generates an abridged report that is always printed and full results in a detailed report to be printed. --no-partial-urls If set, all URLs in the generated data will be absolute and media_baseurl will not be used. This makes changing the media mirror harder without regenerating all data and is generally not recommended, to increase flexibility. --icon-policy POLICY-STRING Override the existing icon policy with a custom one. The icon policy sets how icons of different sizes should be dealt with. They can be in the icon cache only, be a remote icon in the media location or be both cached and available in the remote location. The icon-policy string is comprised of comma-separated %{size}x%{size}@%{scale}=%{state} statements. The size and scale are that of the respective icon, with the scale being allowed to be omitted if it is 1. The state can be one of remote, cached or cached-remote. By default, a policy of 48x48=cached,48x48@2=cached,64x64=cached,64x64@2=cached,128x128=cached-remote,128x128@2=cached-remote is selected. --components COMPONENT-IDs Set a comma-separated list of AppStream component IDs that should be considered for the generated metadata. All components that exist in the input data but are not mentioned in this list will be ignored for the generated output. --no-colorDon't print colored output.--verboseDisplay extra debugging information--versionDisplay the version number of appstreamcli composeSee Also appstreamcli1, appstream-generator1. AUTHOR This manual page was written by Matthias Klumpp matthias@tenstral.net.
  8. 8 AppStream API Reference
  9. Index
Navigation

2.3 Desktop Applications

2.3.1 Introduction

A desktop application is an application which has a graphical user interface and is commonly used with mouse and keyboard. It also ships a Freedesktop .desktop file to be visible in application menus.

AppStream generators may pull data from the preexisting .desktop files to represent an application in the AppStream metadata pool. Upstream projects should ship a metainfo file containing additional metadata to describe their application though, to enhance the available metadata. This data includes things like screenshots, long descriptions, icon information and various other things needed to present the application properly to the user. For some distributions, the presence of this metadata is a prerequisite for the application showing up in the metadata pool and being presented in software centers.

The file described in this document is built upon the generic component metadata with fields specific for desktop applications (see Section 2.1, “Generic Component”).

The metainfo files override any values which are automatically fetched from other sources by the AppStream data generator, which means that its data will always take precedence over data which has already been defined in a .desktop file. Applications can ship one or more files in /usr/share/metainfo/%{id}.metainfo.xml.

Data will only be fetched from a desktop file if one <launchable/> tag is present to define a .desktop file ID. If multiple launchable tags are defined, no data will be merged in from .desktop files.

Note
Note

If you are looking for some quickstart guide to just get your application to ship AppStream metadata quickly, this document might not be for you. You might want to take a look at Section 5.1, “For GUI application upstream maintainers” instead.

Note
Note

While desktop-application metadata is commonly stored in /usr/share/metainfo/%{id}.metainfo.xml (with a .metainfo.xml extension), using a .appdata.xml extension is also permitted for this component type for legacy compatibility. AppStream implementations will recognize either file type, as long as it ends up in the right location on the filesystem.

Note
Note

If you want to hide a desktop-entry file from AppStream metadata generators which synthesize components from desktop-entry data, you may want to add X-AppStream-Ignore=True to the Desktop Entry section of the .desktop file. Keep in mind that if your .desktop file already has a NoDisplay=True key or is not of Type=Application, it will always be ignored, unless metainfo file exists that references it (in which case its data may be merged with the metainfo data).

2.3.2 File specification

The basic structure for a generic component as described at Section 2.1.3, “XML Specification” applies. Note that the XML root must have the type property set to desktop-application, while in a generic component this property can be omitted. This clearly identifies this metainfo document as describing an application.

Note
Note

All tags defined in the generic component specification are valid for desktop-application components as well. An application is just a specialized component, allowing tools like software centers to filter out the component types they want to display.

Note
Note

The desktop-application component type is the same as the desktop component type - desktop is the older type identifier for desktop-applications and should not be used for new metainfo files, unless compatibility with very old AppStream tools (pre 2016) is still wanted.

The following list describes the special tags for application upstream metadata and provides some additional information about the values the tags are expected to have. If no information is given about a tag, refer to the respective tag in Section 2.1, “Generic Component”.

<id/> 

For desktop applications, the <id/> tag value must follow the reverse-DNS scheme as described in <id/>.

Note
Note

In previous AppStream releases, the <id/> was used to associate metainfo files with their .desktop files to merge in data from .desktop files into the AppStream generator's final output. In modern metainfo files, the component-ID for desktop-application components can be an arbitrary reverse-DNS string (matching the naming rules applying to all AppStream metadata), while the <launchable/> tag is used to associate .desktop files with their metainfo files.

Note that even though the component-ID can now be any rDNS name, when updating existing applications, do not change their <id/> to drop the .desktop suffix. The rules are relaxed when picking a new component-ID for new applications, but when updating older applications they still need to keep their original <id/> (when it's otherwise compliant). The ID is used to uniquely identify applications across distributions and releases and should always remain the same for the same application.

<metadata_license/>

The <metadata_license/> tag as described in <metadata_license/> must be present.

<name/> 

The human-readable name of the application. This is the name you want users to see prior to installing the application.

<summary/> 

A short summary on what this application does, roughly equivalent to the Comment field of the accompanying .desktop file of the application.

<launchable/> 

It is required that a <launchable/> tag is present in desktop-application MetaInfo files, unless the MetaInfo data itself contains all required information that a desktop-entry file would have (categories, icon data, ...) and the application can not be launched standalone. This makes the launchable tag a required tag for pretty much all desktop-application components, with only very rare exceptions. The tag is described in detail at <launchable/>.

If only one launchable entry of type desktop-id is present, AppStream metadata generators might decide to merge metadata from .desktop files referenced by the tag into their final output.

The launchable tag is optional, but if omitted software centers will not be able to launch the application directly after it was installed.

<screenshots/> 

A screenshot presents your application to the outside world, and could be seen by hundreds or thousands of people.

The <screenshots/> tag should look like it is described at <screenshots/>.

Screenshot size, shape and format recommendations for applications:

  • All screenshots should have a 16:9 aspect ratio, and should have a width that is no smaller than 620px (software center applications will be able to fill in the screenshots in the space they provide for that more easily then).

    Ideally the window will be resized to a 16:9 aspect ratio, but screenshots can also be cropped if only a small area of the window needs to be shown.

  • Screenshots should ideally be in the PNG format, but JPEG and WebP images are also fine. Keep in mind though that the images are converted into PNG when catalog metadata is generated for a software distribution.

  • Do not scale screenshots below their original size.

You can find a lot more information on how to create good screenshots in the quickstart guide on applications.

<project_group/>

This tag is described for generic components at Section 2.1.3, “XML Specification”. You should use it for your application if appropriate.

<provides/> 

This tag is described in detail for generic components at <provides/>.

If your application ships a binary in a location in the default PATH, you should add at least a child of type <binary/> to make that new executable known to the distribution.

<releases/>

The application metainfo should at least provide one <releases/> tag, which has one or more <release/> children to define the version and release date of this application. For details, see <releases/> .

For a component of type desktop-application, the following tags are required and must always be present: <id/>, <name/>, <summary/>, <description/>, <metadata_license/>, <launchable/>.