ghentcdh / omeka-s-cli
Omeka-S Command Line Tool
Requires
- php: ^8.1
- ext-pdo: *
- ext-pdo_mysql: *
- ext-zip: *
- adhocore/cli: ^1.9.0
- composer/semver: ^3.4
- fakerphp/faker: ^1.23
Requires (Dev)
Replaces
- omeka-s-themes/default: *
- dev-main
- 0.12.0
- 0.11.0
- 0.10.0
- 0.10.0-beta
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.4
- 0.6.3
- 0.6.0
- 0.5.0
- 0.4.1
- 0.4.0
- 0.3.5
- 0.3.0
- 0.2.1
- 0.2.0
- dev-release/v0.12.0
- dev-feat/self_update
- dev-chore/config_updates
- dev-release/v0.11.0
- dev-release/v0.10.0
- dev-release/v0.9.3
- dev-release/v0.9.1
- dev-release/v0.9.0
- dev-release/v0.8.1
- dev-release/v0.8.0
- dev-release/v0.7.3
- dev-release/v0.7.2
- dev-release/v0.7.0
- dev-release/v0.6.4
This package is auto-updated.
Last update: 2026-04-03 09:15:02 UTC
README
Omeka-S-Cli is a command line tool to manage Omeka S instances.
Features
- Core
- Download specific Omeka S version
- Update Omeka S to any/latest version
- Install Omeka S (init database, create admin user)
- Perform database migrations
- Get core status/version
- Manage modules
- Search and download modules from official Omeka S module repository and Daniel Berthereau's module repository
- Download modules from git repositories
- Install, update, upgrade, enable, disable and delete modules
- List all downloaded modules and their status
- Manage themes
- Search and download themes from the official Omeka S theme repository
- Download themes from git repositories
- Delete downloaded themes
- List all downloaded themes and their status
- Manage resource templates
- Import and export resource templates from/to JSON files
- List all resource templates
- Delete resource templates
- Manage vocabularies
- Import vocabularies from file or url
- Import vocabularies from JSON config file
- Create JSON import configuration files
- List all vocabularies
- Delete vocabularies
- Dummy data
- Generate dummy items and item sets with configurable generators
- Config
- Export list of installed modules and themes
- Get, set and list global settings
- Create database.ini file
- User
- List all users
- Add, delete, enable or disable a user
- Manage API keys for a user
Automating Omeka S instance setup
The Omeka-S-Cli tool can be used to automate the setup and configuration of new Omeka S instances. A typical workflow is:
- Download and install Omeka S
core:download <path> [version]to download Omeka Sconfig:create-db-ini --dbname <dbname> --username <username> --password <password> --host <host> --port <port>to create the database.ini filecore:install --admin-name <admin-name> --admin-email <admin-email> --admin-password <admin-password>to run the Omeka S installer
- Add users
user:add <email> <name> <role> [password]to add usersuser:create-api-key <user-id-or-email> <label>to add API keys for users
- Download and install modules and themes
module:download <module>to download a modulemodule:install <module>to install a moduletheme:download <theme>to download a theme
- Import vocabularies
vocabulary:import --config <file>to import vocabulary from a JSON config filevocabulary:import --url <url> --namespace-uri="<uri>" --prefix="<prefix>" --label="<label>"to import vocabulary from a URL
- Import resource templates
resource-template:import <file>to import resource templates
- Set config options
config:set <id> <value>to set global settings
Usage
omeka-s-cli [ - h | --help ]
omeka-s-cli <command> --help
omeka-s-cli <command> [options]
Example: List downloaded modules
omeka-s-cli module:list
+--------------------------+----------------------------+---------------+---------+------------------+---------------+-----------------+
| Id | Name | State | Version | InstalledVersion | LatestVersion | UpdateAvailable |
+--------------------------+----------------------------+---------------+---------+------------------+---------------+-----------------+
| AdvancedResourceTemplate | Advanced Resource Template | active | 3.4.43 | 3.4.43 | 3.4.45 | yes |
| AdvancedSearch | Advanced Search | not_installed | 3.4.51 | | 3.4.51 | |
| Common | Common | active | 3.4.72 | 3.4.72 | 3.4.72 | |
+--------------------------+----------------------------+---------------+---------+------------------+---------------+-----------------+
You can export almost any command output with the --json option.
Example: Download a module from a repository
The easiest way to download a module is to use its official name. The downloader will search the name in one of the supported module repositories and automatically download the latest version compatible with the installed Omeka S core version.
# omeka-s-cli module:download common
If the module already exists, you can use the --force option to replace it with the newly downloaded version.
You can download a specific module version using the <module>:<version> syntax:
omeka-s-cli module:download common:3.4.67
The official Omeka S module repository does not always have all versions available. In that case, you can use a url to a zip-release or a git repository.
Example: Download a module from a zip release
omeka-s-cli module:download https://github.com/Daniel-KM/Omeka-S-module-Common/releases/download/3.4.65/Common-3.4.65.zip
Example: Download a module from a git repository
omeka-s-cli module:download https://github.com/GhentCDH/Omeka-S-module-AuthCAS.git
You can use the short gh:user/repo syntax for GitHub repositories:
omeka-s-cli module:download gh:GhentCDH/Omeka-S-module-AuthCAS
You can checkout a specific tag, branch or commit by appending #<branch|tag|commit>.
omeka-s-cli module:download https://github.com/Daniel-KM/Omeka-S-module-AdvancedSearch.git#3.4.22
omeka-s-cli module:download gh:Daniel-KM/Omeka-S-module-AdvancedSearch#3.4.22
The installer will run composer install in the module directory if a composer.lock file is present. Other dependencies must be installed manually.
Example: Download a theme
The theme downloader also automatically selects the latest version compatible with the installed Omeka S core version.
omeka-s-cli theme:download freedom
Or using the GitHub repository:
omeka-s-cli gh:omeka-s-themes/freedom#v1.0.6
Example: Download and import a vocabulary
Download directly from a URL:
omeka-s-cli vocabulary:import --url "https://schema.org/version/latest/schemaorg-current-https.rdf" --namespace-uri="https://schema.org/" --prefix="schema" --label="schema.org"
Or using a JSON config file. First create a JSON file with content like below:
{
"url": "https://schema.org/version/latest/schemaorg-current-https.rdf",
"label": "schema.org",
"namespaceUri": "https://schema.org/",
"prefix": "schema"
}
Then import the vocabulary with:
omeka-s-cli vocabulary:import --config ./schema-dot-org.json
Example: Create dummy items
# 100 items using built-in defaults omeka-s-cli dummy:create-items 100 # 100 items from a config file omeka-s-cli dummy:create-items 100 --config ./examples/dummy/item.json
omeka-s-cli dummy:create-item-sets 10 omeka-s-cli dummy:create-item-sets 10 --config ./examples/dummy/item-set.json
See docs/dummy.md for the full generator and config reference.
Example: Import a resource template
Import a resource template from a file with:
omeka-s-cli resource-template:import "/path/to/template.json"
You can also specify a different label:
omeka-s-cli resource-template:import "/path/to/template.json" --label="My Custom Template"
Update an existing template by ID:
omeka-s-cli resource-template:import "/path/to/template.json" 2
Update an existing template by label:
omeka-s-cli resource-template:import "/path/to/template.json" "My Custom Template"
Requirements
- PHP (>= 8.1) with PDO_MySQL and Zip enabled
- Omeka S (>= 4)
Installation
- Download omeka-s-cli.phar from the latest release.
- Run with
php omeka-s-cli.pharor move it to a directory in your PATH and make it executable.
Build
This project uses https://github.com/box-project/box to create a phar file.
box global install
composer global require humbug/box
compile phar
box compile
To do
- Module dependency checking
- Add support for custom vocabularies
- Add support for sites and site pages
Credits
Built @ the Ghent Center For Digital Humanities, Ghent University by:
- Frederic Lamsens
Built with:
- adhocore/cli — CLI framework
- fakerphp/faker — fake data generation
Code copied from third-party sources:
resource-template:import—flagValid()andcheckMissingDependencies()methods copied from Common module by Daniel Berthereau, © 2020–2025
Inspired by:
