CLI
apply, diff and delete
Create, update and delete resources from YAML files, and export them with relic get.
Show what apply would change, as a unified diff:
relic diff -f relic.yaml
Create the missing resources and update the ones that differ:
relic apply -f relic.yaml
Delete the resources in the file, in reverse order:
relic delete -f relic.yaml
applygoes through the files in order and printscreated,configuredorunchangedper resource.- A spec sets only the top-level fields it names; the rest keep their values.
- Write-only fields (passwords and secrets) are not compared. To change only
one, run
apply --force. Fields the server sets (timestamps, usage, last runs) are not compared either. diff --exit-codeexits with 1 when something would change, and with 2 when the diff fails.delete --ignore-not-founddoes not fail on missing resources.-f -reads standard input;-fcan be repeated.-fwith a directory reads its.yamland.ymlfiles in name order.- A file with no
relic.build/v1resources is an error.
relic apply accepts what relic get -o yaml prints.
List the repositories, with their class, format, project and remote URL:
relic get repositories
Print their names, one per line:
relic get repositories -o name
Print them as a JSON array of Relic API messages:
relic get repositories -o json
Print one repository as a relic.build/v1 document:
relic get repository libs-local -o yaml
Save all permissions to a file:
relic get permissions -o yaml > permissions.yaml