OARepo CLI
oarepo-cli is a command-line tool for scaffolding and developing OARepo repositories and libraries.
It provides three things:
new— scaffold a brand-new repository from a copier templaterepository— manage an existing repository instance (install, run, test, models, ...)library— develop an OARepo library package (models, modules, extensions)
Table of Contents
New Repository
At first, make sure that you have uv installed. See docs.astral.sh for installation instructions.
Then, uvx oarepo-cli new <name> scaffolds a new repository from a copier template into ./<name>.
uva oarepo-cli new my-repo
| Option | Description | Default |
|---|---|---|
--template <url/path> |
Copier template — a GitHub URL or a local path | https://github.com/oarepo/nrp-app-copier |
--version <ref> |
Template git ref, used only when --template is a GitHub URL |
rdm-14 |
--config <file> |
YAML data file seeding all answers non-interactively | — |
--python <binary> |
Python binary; only checked for existence, not otherwise used | python3.14 |
--uv <binary> / --uvx <binary> |
uv/uvx binaries; only checked for existence, not otherwise used |
uv / uvx |
What it does:
- Renders the template into
./<name> - Generates a self-signed development TLS certificate/key pair (
docker/development.crt/.key) - Clears out any stale Docker containers left over from a previous attempt at the same name
- Initializes a git repository with an initial commit (skipped in CI, or if git isn't installed)
- Adds a run.sh script for installing and running the repository
Repository Tools
Commands for managing an existing repository instance, run from inside the repository directory.
| Command | Description |
|---|---|
install |
Install the repository into its virtual environment |
upgrade |
Clean and fully reinstall |
services |
Manage Docker services (setup/start/stop/destroy) |
model |
Create/update record models |
local |
Manage local (editable) package dependencies |
run |
Start the development server |
shell |
Open a shell in the virtual environment |
cli |
Passthrough to invenio-cli |
invenio |
Passthrough to the venv's own invenio |
lint |
Run linters and type checkers |
format |
Format code with ruff |
check |
Read-only lint + format, for CI |
jslint |
Run ESLint and Prettier |
jstest |
Run JavaScript tests (Jest) |
test |
Run the pytest suite |
translations |
Extract/compile translations |
index rebuild |
Rebuild the search index |
reset |
Full reset (destroys all data) |
info |
Show the resolved Python version and models |
Every command accepts --quiet/-q to suppress subprocess output; only additional options are listed below.
repository install
Installs the repository into its virtual environment and configures Invenio.
oarepo-cli repository install
- Syncs the virtual environment with
uv sync - Copies the translation overlay into site-packages
- Resolves and creates the Invenio instance directory, symlinking
invenio.cfg - Runs
invenio-cli install(assets, database tables, etc.) - Writes local service ports to
.invenio.private - Compiles backend translations
repository upgrade
Removes the virtual environment, uv.lock, and uv cache, then reinstalls from scratch. Use after changing OARepo/RDM version pins or when the environment needs a clean rebuild.
oarepo-cli repository upgrade
repository services
Passthrough to invenio-cli services <subcommand>: extra arguments/flags are forwarded verbatim, and --help shows invenio-cli's own help.
oarepo-cli repository services setup
oarepo-cli repository services start
oarepo-cli repository services stop
oarepo-cli repository services destroy
repository model
Creates and updates record models via copier, rendering the model template into models/<name>/. The template/version are configured in pyproject.toml ([tool.oarepo-cli.model]) or via OAREPO_MODEL_TEMPLATE_URL/OAREPO_MODEL_TEMPLATE_VERSION — not as CLI flags.
oarepo-cli repository model create <name> [config_file]
oarepo-cli repository model update <name> [answers_file]
create <name> [config_file]: renders the template intomodels/<name>/. Ifconfig_file(YAML) is given, it seeds all answers and must includemodel_nameitself; otherwise onlymodel_nameis passed and the template's own defaults apply. Reinstalls the repository afterward if a virtual environment already exists.update <name> [answers_file]: updates an existing model from its recorded.copier-answers.yml, or fromanswers_fileif given. Requires a clean, git-tracked repository; conflicts are written inline for review viagit diff.
repository local
Manages locally-developed packages as editable [tool.uv.sources] entries in pyproject.toml — for developing a dependency (e.g. a custom extension) alongside the repository. Both subcommands edit pyproject.toml in place and trigger a full repository upgrade (without clearing the uv cache).
oarepo-cli repository local add <path>
oarepo-cli repository local remove <name>
oarepo-cli repository local remove --all
add <path>: adds the package at<path>(which must have its ownpyproject.toml) as an editable source and appends it to[project].dependencies. Re-adding an already-present package updates its entry in place.remove <name>/remove --all: removes one or all local packages from[tool.uv.sources]/[project].dependencies.--allonly touches entries added viaaddand upgrades once for all of them.
repository run
Starts the development server: starts Docker services (unless --no-services), then replaces the current process with invenio-cli run (or, with --no-celery, the venv's own invenio run directly). A terminal Ctrl+C hits invenio/invenio-cli directly. Services are not stopped when the server exits — run repository services stop explicitly.
oarepo-cli repository run
oarepo-cli repository run --no-celery -- -p 5001
| Option | Description |
|---|---|
--no-services |
Don't start Docker services first |
--no-celery |
Run the venv's own invenio run directly, without Celery/invenio-cli |
Extra arguments (e.g. -p 5001) are forwarded to the underlying invenio-cli run/invenio run.
repository shell
Opens an interactive bash shell with the virtual environment activated, resolving service connection details from invenio.cfg/.invenio.private. Replaces the current process — it never returns.
oarepo-cli repository shell
oarepo-cli repository shell --no-services
| Option | Description |
|---|---|
--no-services |
Don't start Docker services first |
repository cli / repository invenio
Pure passthroughs that replace the current process, so --help and the exit code are exactly the wrapped tool's own. cli runs invenio-cli; invenio runs the venv's own bare invenio binary directly.
oarepo-cli repository cli services status
oarepo-cli repository invenio db upgrade
repository lint / format / check
Runs ruff, a license-header check, a from __future__ import annotations check, and ty, across every module directory declared in [tool.uv.build-backend] (or src/, if used instead).
oarepo-cli repository lint
oarepo-cli repository format
oarepo-cli repository check
lintruns everything in order, stopping at the first failure, and auto-fixes by default (--no-fixfor report-only).formatruns ruff format only, and rewrites files by default (--no-fixforruff format --check).checkis the read-only equivalent of both combined (never modifies files) — the exit code is that of the first failing check. Still generates.ruff.toml/ty.tomlconfig files in the project root.
repository jslint / jstest
jslint runs ESLint and Prettier on the repository's JavaScript files (skipped if no package.json exists at the root). jstest runs Jest via invenio webpack run test, across every registered invenio_assets.webpack entry point; it requires the repository to already be installed.
oarepo-cli repository jslint
oarepo-cli repository jstest
| Option | Description |
|---|---|
--setup (jstest only) |
Not implemented |
--skip-services (jstest only) |
Don't start Docker services first |
repository test
Runs the pytest suite. Docker services are started first unless --no-services (unlike other commands, they are never stopped afterward). pytest/pytest-cov are installed on demand if missing, since a fresh repository has no "tests" extra of its own.
oarepo-cli repository test
oarepo-cli repository test --with-coverage
oarepo-cli repository test -v -k test_specific
| Option | Description |
|---|---|
--no-services |
Don't start Docker services first |
--with-coverage |
Enable coverage reporting (HTML + terminal), across every module directory |
Extra arguments are passed directly to pytest.
repository translations
oarepo-cli repository translations # extract, merge, compile (backend + JS)
oarepo-cli repository translations compile # backend only, via invenio-cli
repository index rebuild
Destroys and re-creates the search index, then rebuilds all records and custom fields.
oarepo-cli repository index rebuild
repository reset
Destroys Docker services, removes the virtual environment/uv.lock/.invenio.private, cleans the uv cache, reinstalls, sets up services again, and creates a demo admin user (user@demo.org, password from DEMO_USER_PASSWORD, default 123456).
oarepo-cli repository reset
Prompts for confirmation (exactly yes) since this purges all existing data in your containers. Anything else cancels without error.
repository info
Shows the resolved Python version and discovered record models.
oarepo-cli repository info
Library Development Tools
Commands for developing an OARepo library package, run from inside the library directory.
| Command | Description |
|---|---|
venv |
Set up the virtual environment |
install |
Alias for venv |
upgrade |
Clean and recreate the venv |
test |
Run pytest tests |
start / stop |
Start/stop Docker services |
lint |
Run linters and type checkers |
format |
Format code with ruff |
check |
Read-only lint + format, for CI |
shell |
Open a shell in the venv |
invenio |
Run invenio commands in the venv |
translations |
Extract/compile translations |
license-headers |
Add SPDX/MIT license headers |
jslint |
Run ESLint and Prettier |
jstest |
Run JavaScript tests (Jest) |
oarepo-versions |
List detected OARepo/Python versions (JSON) |
clean |
Remove the venv and services |
Every command accepts --quiet/-q to suppress subprocess output; only additional options are listed below.
library venv / install / upgrade
venv (aliased as install) creates or verifies the virtual environment and syncs dependencies; upgrade stops services, cleans the uv cache, and recreates the venv from scratch.
oarepo-cli library venv
oarepo-cli library venv --force
oarepo-cli library upgrade
| Option | Description |
|---|---|
--force / -f (venv only) |
Recreate the venv from scratch |
--no-editable (venv only) |
Install as a built wheel instead of editable mode |
library test
oarepo-cli library test
oarepo-cli library test --with-coverage -x -k test_specific
| Option | Description |
|---|---|
--skip-services |
Don't start/stop Docker services |
--with-coverage |
Enable coverage reporting (HTML + terminal) |
Extra arguments are passed directly to pytest.
library start / stop
Starts or stops the Docker services (PostgreSQL, OpenSearch, Redis, RabbitMQ, MinIO) configured via [tool.oarepo-cli.services] or OAREPO_SERVICES_*, writing connection details to .env-services.
oarepo-cli library start
oarepo-cli library stop
library lint / format / check
Runs ruff, a license-header check, a from __future__ import annotations check, and ty on the library's source.
oarepo-cli library lint
oarepo-cli library format
oarepo-cli library check
lintruns everything in order, stopping at the first failure, and auto-fixes by default (--no-fixfor report-only). The license-header and future-annotations checks never modify files — uselicense-headersfor those.formatruns ruff format only, and rewrites files by default (--no-fixforruff format --check).checkis the read-only equivalent of both combined — safe for CI.
library shell
Opens an interactive bash shell with the venv activated and .env-services loaded. Replaces the current process.
oarepo-cli library shell
oarepo-cli library shell --skip-services
| Option | Description |
|---|---|
--skip-services |
Don't start Docker services first |
library invenio
Runs invenio CLI commands in the venv, with .env-services loaded.
oarepo-cli library invenio db upgrade
oarepo-cli library invenio users create admin@example.com --password 123456 --active
| Option | Description |
|---|---|
--skip-services |
Don't start Docker services first |
library translations
Extracts and compiles translations via oarepo-tools make-translations. Extra arguments are forwarded to it verbatim.
oarepo-cli library translations
library license-headers
Adds an SPDX/MIT license header to any Python file that doesn't already have one.
oarepo-cli library license-headers
oarepo-cli library license-headers --organization "My Organization"
| Option | Description | Default |
|---|---|---|
--organization / -o |
Organization name in the header | [tool.oarepo-cli.license].organization, or CESNET z.s.p.o |
library jslint / jstest
jslint runs ESLint and Prettier on JavaScript files (skipped if no package.json exists). jstest runs Jest via invenio webpack run test.
oarepo-cli library jslint
oarepo-cli library jstest
| Option | Description |
|---|---|
--setup (jstest only) |
Not implemented |
--skip-services (jstest only) |
Don't start Docker services first |
library oarepo-versions
Prints the OARepo/Python/Node versions detected from pyproject.toml's dependency constraints and system availability, as JSON:
$ oarepo-cli library oarepo-versions
{"oarepo_versions": ["14"], "python_versions": ["3.14"], "node_versions": ["24", "22"]}
- OARepo versions: Extracted from
oarepoconstraints in[project].dependencies/[project.optional-dependencies], sorted highest-first. Commands that need a single version (venv,test, ...) use the highest one; override withOAREPO_VERSION. - Python versions: Compatible versions from
requires-pythonconstraint that are available on the system. - Node.js versions: Available Node.js major versions detected on the system (empty array if Node.js is not installed).
library clean
Stops services, then removes the virtual environment, uv.lock, and .env-services. Idempotent.
oarepo-cli library clean
Configuration
Settings are resolved with this precedence: defaults < pyproject.toml < environment variables < CLI flags.
| Environment Variable | pyproject.toml key |
Default |
|---|---|---|
OAREPO_VENV_PATH |
[tool.oarepo-cli.venv].path |
.venv |
OAREPO_VERSION |
(none — auto-detected from dependencies) | auto-detected |
OAREPO_PYTHON_BINARY |
[tool.oarepo-cli.python].binary |
auto-detected |
OAREPO_BUILD_EDITABLE |
[tool.oarepo-cli.build].editable |
true |
OAREPO_TEST_COVERAGE |
[tool.oarepo-cli.test].coverage |
false |
OAREPO_TEST_SKIP_SERVICES |
[tool.oarepo-cli.test].skip_services |
false |
OAREPO_SERVICES_SKIP |
[tool.oarepo-cli.services].skip |
false |
OAREPO_SERVICES_DB |
[tool.oarepo-cli.services].db |
postgresql |
OAREPO_SERVICES_SEARCH |
[tool.oarepo-cli.services].search |
opensearch |
OAREPO_SERVICES_CACHE |
[tool.oarepo-cli.services].cache |
redis |
OAREPO_SERVICES_MQ |
[tool.oarepo-cli.services].mq |
rabbitmq |
OAREPO_SERVICES_S3 |
[tool.oarepo-cli.services].s3 |
minio |
OAREPO_MODEL_TEMPLATE_URL |
[tool.oarepo-cli.model].template_url |
https://github.com/oarepo/nrp-model-copier |
OAREPO_MODEL_TEMPLATE_VERSION |
[tool.oarepo-cli.model].template_version |
rdm-14 |
OAREPO_TRANSLATIONS_OVERLAY |
[tool.oarepo-cli.translations].overlay_dir |
auto-detected |
OAREPO_CELERY_POOL_TYPE |
[tool.oarepo-cli.celery].pool_type |
threads |
OAREPO_CELERY_CONCURRENCY |
[tool.oarepo-cli.celery].concurrency |
10 |
OAREPO_LICENSE_ORG |
[tool.oarepo-cli.license].organization |
CESNET z.s.p.o |
DEMO_USER_PASSWORD |
[tool.oarepo-cli.security].demo_user_password |
123456 |
Example pyproject.toml:
[tool.oarepo-cli.venv]
path = ".venv"
[tool.oarepo-cli.services]
db = "postgresql"
search = "opensearch"
cache = "redis"
mq = "rabbitmq"
s3 = "minio"
[tool.oarepo-cli.license]
organization = "Your Organization"
Exit Codes
0— success.1— a failure, e.g. a subprocess exited non-zero, or the project context couldn't be discovered (nopyproject.toml).2— a usage error (missing/invalid arguments or options), reported before anything runs.- Passthrough commands (
repository cli/invenio/services <subcommand>,repository run's server) exit with whatever the wrapped tool itself returns, not collapsed to0/1.
repository reset is the one exception: 0 covers both a completed reset and the user cancelling the confirmation prompt.
License
MIT License — see LICENSE for details.
Copyright © 2026 CESNET z.s.p.o.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oarepo_cli-14.1.6.tar.gz.
File metadata
- Download URL: oarepo_cli-14.1.6.tar.gz
- Upload date:
- Size: 105.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b77ed559a4371a02fd1237c5c6c48a3700f6afbc1028ea60368c505acd3bc74
|
|
| MD5 |
9cd619126b5e301bacc9693c20354d09
|
|
| BLAKE2b-256 |
336cd0ee19ad774fc55d27cfdc17a3022332488f01c023f8b8f7bb7bd4e8ae9c
|
File details
Details for the file oarepo_cli-14.1.6-py3-none-any.whl.
File metadata
- Download URL: oarepo_cli-14.1.6-py3-none-any.whl
- Upload date:
- Size: 130.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ab13ae79b5fefcfae3065f016d85c3097b80d711b4ee57a78c53192187ebc69
|
|
| MD5 |
55db779ffca7d9defa0d5eb3b2357dc5
|
|
| BLAKE2b-256 |
940e593186fa5ccc7d005a1218aee2b51517638a178fe0e424a2530427d3f511
|