Skip to main content

OpenSAFELY codelists add command

29 January 2025

We have improved the way in which codelists can be added to an OpenSAFELY project.

Previously, to add a codelist to a project, one had to manually add a codelist and version identifier to the codelists.txt file, then run the opensafely codelists update command to download it. This method is still supported.

We have now added the opensafely codelists add command, which allows you to directly add and download a codelist to your project in a single step using its URL.

For example:

opensafely codelists add https://www.opencodelists.org/codelist/opensafely/covid-identification/2020-06-03/