Install
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
  • apply goes through the files in order and prints created, configured or unchanged per 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-code exits with 1 when something would change, and with 2 when the diff fails.
  • delete --ignore-not-found does not fail on missing resources.
  • -f - reads standard input; -f can be repeated. -f with a directory reads its .yaml and .yml files in name order.
  • A file with no relic.build/v1 resources 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