Skip to content

Themes

The theme:* commands find themes in the omeka.org catalog, download them into the themes/ directory of an Omeka S installation, and list, check and delete them. A theme needs no installation step: once it is in themes/, you can assign it to a site.

Find a theme

theme:search lists the themes in the omeka.org theme directory, or those whose id, name, owner or tags contain the query:

omeka-s-cli theme:search

--extended adds the URL, owner and catalog of each theme:

omeka-s-cli theme:search free --extended
+---------+---------------+------------------------+-------------------------------------------+----------------+------------+
| Id      | LatestVersion | OmekaVersionConstraint | Url                                       | Owner          | Repository |
+---------+---------------+------------------------+-------------------------------------------+----------------+------------+
| freedom | 1.1.0         | ^4.2.0                 | https://github.com/omeka-s-themes/freedom | omeka-s-themes | Omeka.org  |
+---------+---------------+------------------------+-------------------------------------------+----------------+------------+

As with modules, a search inside an Omeka S installation hides the themes that have no release for the installed Omeka S version (--include-incompatible shows them), and the catalog is cached for 24 hours (--refresh fetches it again).

Download a theme

theme:download takes the same kind of URI as module:download: a catalog id, optionally with a version, a release zip (URL or file), or a git repository.

omeka-s-cli theme:download freedom

Without a version, it picks the most recent release that supports the installed Omeka S version. Add a version to pin a release; a pinned release that does not support your Omeka S version is refused unless you add --force. A theme that is already there gives a warning and exit code 0; --force replaces it:

omeka-s-cli theme:download freedom:1.0.7 --force

From a git repository, at a tag, branch or commit, or from a release zip:

omeka-s-cli theme:download gh:omeka-s-themes/cozy#v1.6.3
omeka-s-cli theme:download https://github.com/omeka-s-themes/cozy/releases/download/v1.6.3/cozy-1.6.3.zip --force

Directory name

A theme downloaded by catalog id goes in a directory named after that id (themes/cozy). A theme downloaded from a zip or git repository goes in a directory named after the name in its theme.ini (themes/Cozy). The directory name is the theme id Omeka S stores for a site, so pick one way of downloading a theme and stick to it: mixing them leaves two copies of the same theme.

Choose the theme folder

The folder is the theme's ID in Omeka S; sites refer to it. A theme from the catalog keeps the catalog's folder. A ZIP or git theme gets its theme.ini name, unless you pick the folder with --dir:

omeka-s-cli theme:download gh:omeka-s-themes/freedom --dir freedom-dev

Use a theme

Choose the theme of a site when you create it, or change it later with site:update:

omeka-s-cli site:add "Exhibits" --slug exhibits --theme freedom

List themes and check their status

theme:list shows every theme in the themes/ directory, with its version and the latest version in the catalog:

omeka-s-cli theme:list
+---------+---------+--------+---------+---------------+-----------------+------------+
| Id      | Name    | State  | Version | LatestVersion | UpdateAvailable | Author     |
+---------+---------+--------+---------+---------------+-----------------+------------+
| freedom | Freedom | active | 1.0.7   | 1.1.0         | yes             | Omeka Team |
| Cozy    | Cozy    | active | 1.6.3   | 1.6.3         | no              | Omeka Team |
| default | Default | active | 1.9.3   | 1.9.3         | no              | Omeka Team |
+---------+---------+--------+---------+---------------+-----------------+------------+

The state is the one Omeka S reports: active means the theme is valid and can be used, not that a site uses it. Other states, such as invalid_ini or invalid_omeka_version, point to a theme that Omeka S cannot use. --extended adds the path of each theme, --json and --csv change the format.

theme:status shows the same row for one theme, and fails if it is not in themes/:

omeka-s-cli theme:status freedom

Update a theme

theme:list --outdated shows the themes for which the catalog has a newer release:

omeka-s-cli theme:list --outdated
omeka-s-cli theme:list --outdated --json | jq -r '.[].id'

There is no update command for themes: download the theme again with --force. Add --backup to move the old copy to ~/.omeka-s-cli/backups/themes/<theme>/<date-time>/ instead of deleting it, which keeps any changes you made to its files:

omeka-s-cli theme:download freedom --force --backup
Selected 'freedom' v1.1.0 (compatible with Omeka S 4.2.1).
Download https://github.com/omeka-s-themes/freedom/releases/download/v1.1.0/freedom-v1.1.0.zip ... done
Theme 'freedom' v1.1.0 downloaded.

Delete a theme

theme:delete removes a theme's directory. It refuses a theme that a site uses: with the site above, theme:delete freedom fails with

The theme is currently active on a site. Use the --force flag to proceed.

Give those sites another theme first. --force deletes the theme anyway, and leaves the sites with a theme that no longer exists. With --ignore-not-found, deleting a theme that is not there prints a note and exits 0:

omeka-s-cli theme:delete freedom
omeka-s-cli theme:delete Cozy --ignore-not-found

Reference

All commands also accept the global options.

theme:search

Search/list available themes

omeka-s-cli theme:search [options] [query]
Argument Description Default
[query] Part of the theme name or description
Option Description Default
--refresh Refresh the repository data
--include-incompatible Include themes incompatible with the current Omeka S version
-j, --json Output json
-c, --csv Output csv
-x, --extended Extended output

theme:download

Download theme

omeka-s-cli theme:download [options] <theme>
Argument Description Default
<theme> Theme URI (syntax: theme-id:version, zip-release-url, zip-file, git-url#version|tag|branch)
Option Description Default
-f, --force Force theme overwrite
-b, --backup Backup current theme before download (delete otherwise)
--dir <value> Folder (the theme ID) to install into (default: the catalog folder, or the theme.ini name for a zip or git source)

theme:list

List downloaded themes

omeka-s-cli theme:list [options]
Option Description Default
-j, --json Output json
-c, --csv Output csv
-x, --extended Extended output
--outdated Show outdated themes

theme:status

Get theme status

omeka-s-cli theme:status [options] <theme-id>
Argument Description Default
<theme-id> The theme ID (or id:version)
Option Description Default
-j, --json Output json
-c, --csv Output csv
-x, --extended Extended output

theme:delete

Delete theme

omeka-s-cli theme:delete [options] <theme-id>
Argument Description Default
<theme-id> The theme ID (or id:version)
Option Description Default
-f, --force Force theme delete
--ignore-not-found Do nothing if the theme does not exist (default: throw an error)