CR8TOR CLI Commands Reference¶
CR8TOR CLI provides a comprehensive set of commands to manage the entire data access request (DAR) lifecycle, from project initiation to data publication.
Core Workflow Commands¶
Initiate Project¶
Initializes a new CR8 project using a specified cookiecutter template.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
template_path
|
str
|
The GitHub URL or relative path to the cr8-cookiecutter template. This is prompted from the user if not provided. |
required |
push_to_github
|
bool
|
Flag to indicate if the project should be pushed to GitHub. Defaults to False. |
False
|
git_org
|
str
|
The target GitHub organization name. Required if |
None
|
checkout
|
str
|
The branch, tag, or commit to checkout from the cookiecutter template. |
None
|
project_name
|
str
|
The name of the project to be created. If provided, cookiecutter will skip the prompt for other values. |
None
|
environment
|
str
|
The target environment (DEV, TEST, PROD). Defaults to "PROD". |
'PROD'
|
cr8tor_branch
|
str
|
For development and debugging. Specifies the GitHub cr8tor branch to be used in the orchestration layer. |
None
|
runner_os
|
str
|
The target runner OS for GitHub Actions workflows (Windows, Linux). Defaults to "Windows". |
'Windows'
|
This command performs the following actions:
- Generates a new project by applying the specified cookiecutter template.
- Adds a timestamp to the context used by the template.
- If push_to_github is True, creates a GitHub repository under the specified organization and pushes the generated project to GitHub using the personal access token (retrieved from os.getenv("GH_TOKEN")).
Example usage
cr8tor initiate -t https://github.com/lsc-sde-crates/cr8-cookiecutter
cr8tor initiate -t path-to-local-cr8-cookiecutter-dir
cr8tor initiate -t path-to-local-cr8-cookiecutter-dir -n "my-project" -org "lsc-sde-crates" --push
cr8tor initiate -t path-to-local-cr8-cookiecutter-dir -n "my-project" -org "lsc-sde-crates" -ros "Linux" --push
Source code in src/cr8tor/cli/initiate.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
Warning
--push argument requires a fine-grained PAT token generated in GitHub. It must be stored under local environment variable GH_TOKEN. See minimum PAT token permissions defined here.
Create Project RO-Crate¶
Generates the initial RO-Crate data crate within the target Cr8tor project from the specified metadata resources.
This command performs the following actions:
- Generates a UUID for the project.
- Builds an RO-Crate along with an RO-Crate knowledge graph.
- Packages the crate as a non-serialized BagIt Archive in the "bagit/" directory.
- If the dryrun option is provided, prints the crate details without writing to the "crate/" directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
resources_dir
|
Path
|
Directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
bagit_dir
|
Path
|
Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
config_file
|
Path
|
Location of the configuration TOML file. Defaults to "./config.toml". |
'./config.toml'
|
dryrun
|
bool
|
If True, prints the crate details without writing to the "crate/" directory. Defaults to False. |
False
|
Example usage
cr8tor create -a agent_label -i path-to-resources-dir -b path-to-bagit-dir -c path-to-config-file --dryrun
Source code in src/cr8tor/cli/create.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
Build RO-Crate Package¶
Builds the RO-Crate data crate for the target Cr8tor project using the specified metadata resources and configuration.
This command performs the following actions:
- Reads the configuration from the specified TOML file.
- Includes resources from the specified directory into the RO-Crate.
- If the dryrun option is provided, prints the crate details without writing to the "crate/" directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resources_dir
|
Path
|
Directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
config_file
|
Path
|
Location of the configuration TOML file. Defaults to "./config.toml". |
'./config.toml'
|
dryrun
|
bool
|
If True, prints the crate details without writing to the "crate/" directory. Defaults to False. |
False
|
Example usage
cr8tor build -i path-to-resources-dir -c path-to-config-file --dryrun
Source code in src/cr8tor/cli/build.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | |
Validate Project Metadata¶
Validate the contents of a Bagit directory containing an RO-Crate data directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
bagit_dir
|
Path
|
The Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
resources_dir
|
Path
|
The directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
This function performs the following: - Validates the contents of the specified Bagit directory and its RO-Crate data directory. - Validates access and governance metadata resources. - Rebuilds the Bagit contents, including the RO-Crate metadata.
Example usage
cr8tor validate -b
Source code in src/cr8tor/cli/validate.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
Approval Workflow Commands¶
Sign-Off Project¶
Logs sign-off metadata in the RO-Crate and verifies project sign-off in the approvals management platform (e.g., GitHub).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agreement_url
|
str
|
URL to the project sign-off event (e.g., PR event in the project's GitHub history). |
required |
signing_entity
|
str
|
The entity that agreed to sign off the project request. |
required |
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
bagit_dir
|
Path
|
Path to the Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
resources_dir
|
Path
|
Path to the directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
This command performs the following actions: - Updates the project approvals metadata in the RO-Crate. - Verifies the project sign-off in the approvals management platform.
Example usage
cr8tor sign-off -agreement
Source code in src/cr8tor/cli/sign_off.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
Disclosure Check¶
Logs disclosure metadata in the RO-Crate and verifies project disclosure in the approvals management platform (e.g., GitHub).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agreement_url
|
str
|
URL to the project disclosure event (e.g., PR event in the project's GitHub history). |
required |
signing_entity
|
str
|
The entity that completed the disclosure check. |
required |
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
bagit_dir
|
Path
|
Path to the Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
resources_dir
|
Path
|
Path to the directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
This command performs the following actions: - Updates the project approvals metadata in the RO-Crate. - Verifies the project disclosure in the approvals management platform.
Example usage
cr8tor disclosure -agreement
Source code in src/cr8tor/cli/disclosure.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
Data Transfer Commands¶
Stage Data Transfer¶
Stages the data by transferring it from the specified source to the sink TRE.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
bagit_dir
|
Path
|
Path to the Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
resources_dir
|
Path
|
Path to the directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
This function prepares the data transfer for the specified CR8 project by: - Validating the current RO-Crate graph. - Ensuring that all necessary resources are included.
Example usage
cr8tor stage-transfer -a agent_label -b path-to-bagit-dir -i path-to-resources-dir
Source code in src/cr8tor/cli/stage_transfer.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
Publish Data¶
Publishes the data by transferring it from staging to production storage, making it accessible to a TRE and/or authorised TRE workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent
|
str
|
The agent label triggering the validation. Defaults to None. |
None
|
bagit_dir
|
Path
|
Path to the Bagit directory containing the RO-Crate data directory. Defaults to "./bagit". |
'./bagit'
|
resources_dir
|
Path
|
Path to the directory containing resources to include in the RO-Crate. Defaults to "./resources". |
'./resources'
|
This command performs the following actions: - Transfers the staged data to production storage. - Ensures the data is accessible to the TRE or authorised TRE workspace.
Example usage
cr8tor publish -a
Source code in src/cr8tor/cli/publish.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | |
Command Workflow¶
The CR8TOR commands follow a specific sequence in the data access workflow:
- initiate - Creates a new DAR project repository from cookiecutter template
- create - Initializes the project with unique identifiers and basic metadata
- build - Builds the BagIt RO-Crate package containing project metadata
- validate - Validates data source connections and retrieves metadata
- sign-off - Records approval for the validated data request
- stage-transfer - Transfers data from source to staging storage
- disclosure - Records disclosure approval for staged data
- publish - Moves data from staging to production storage
Command Dependencies
Each command typically depends on the successful completion of previous commands in the workflow. The CLI validates these dependencies and will exit with an error if prerequisite steps are missing.