Repository Command Line Tool#
The Colectica Repository Command Line Interface (CLI) is a separate tool, distributed as
ColecticaRepositoryCli-version-windows.zip, ColecticaRepositoryCli-version-linux.zip,
or a macOS package.
It registers, exports, lists, and deletes items, and performs database maintenance tasks.
It requires the .NET 10 runtime.
On Windows the executable is Colectica.Repository.Cli.exe.
On Linux and macOS, run ./Colectica.Repository.Cli.
Run the tool with --help to see the full usage information for each command, and with
--version to see the build revision.
Connecting to a Repository#
Most commands connect to Colectica Repository over the REST API using the following options.
- --host
The hostname of Colectica Repository
- --user
The username used to connect to Colectica Repository
- --password
The password used to connect to Colectica Repository
- --windowsauth
Use Windows authentication to connect to Colectica Repository
Commands whose names end in -db connect directly to the repository database instead,
using the --connection and --provider options with the same values as in appsettings.json.
Run these commands on the server, while the web application is stopped.
Commands#
- register-items
Register items from DDI Lifecycle files with the repository. Use
--filefor a single file or--directoryfor a directory of files, and--jobsto process several files at once. DDI Codebook files can be registered by supplying the--agencyIdto assign.- validate-ddi
Validate a DDI Codebook or DDI Lifecycle file, including second level validation.
- export
Export all items, or the set of items under the item named by
--itemId, to a DDI Lifecycle XML file. Use--entireHistoryto include all versions of the set, and--skipDeprecatedto omit deprecated items.- list-items
List the identifiers of all items of the type given by
--item-type. By default only the latest versions are listed; use--allto include every version.- delete-item
Delete the item named by
--idand, with--delete-set, the items under it. The--behavioroption (warn,deprecate, orskip) determines what happens when a deleted item is referenced by an item that is not being deleted. Deletion must be enabled on the server with theRepositorySettings:Features:EnableItemDeletionsetting.- register-items-db
Register items from a DDI Lifecycle fragment instance directly into the repository database. The file must be second level validated with proper UUIDs.
- export-db
Export all items or a set of items directly from the repository database.
- migrate-db
Upgrade the repository database to the latest schema.
- migrate-portal-db
Upgrade the portal database to the latest schema.
- reindex-db
Delete and rebuild the repository database’s advanced search index.
- update-all-references-to-latest
Ensure that all references from the latest version of every item point to the latest versions of the referenced items.
See also
The Elastic Indexer is a separate command line tool that maintains the Elasticsearch index used by the portal’s search page.