Skip to main content

Migration Guide to Ory CLI v1

The Ory CLI v1 got a big lift in terms of usability and features. This guide helps you migrate from Ory CLI v0 to Ory CLI v1.

Upgrade to v1

To upgrade the Ory CLI to v1 please follow the installation guide for your OS.

New authentication methods

The Ory CLI v1 comes with multiple new authentication mechanisms, please visit the CLI Basics document for an overview of the different authentication methods.

Migrate existing scripts and automation

All commands work mostly the same way as before. Use ory help to get more information about the available commands, arguments and flags.

To use the new API key authentication, create the necessary keys and set the ORY_WORKSPACE_API_KEY and ORY_PROJECT_API_KEY environment variables, see here for a detailed description of the new authentication mechanisms.
If your script uses multiple workspaces or projects, you need to create multiple keys and use the corresponding environment variables.

Here are the changes to commands:

- ory open ui <project>
+ ory open ui --project <project>
+ ory open ui --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workpsace> ORY_PROJECT=<project> ory open ui

- ory get identity-config|oauth2-config|permissions-config <project>
+ ory get identity-config|oauth2-config|permissions-config --project <project>
+ ory get identity-config|oauth2-config|permissions-config --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workpsace> ORY_PROJECT=<project> ory get identity-config|oauth2-config|permissions-config

- ORY_SDK_URL=https://<project-slug>.projects.oryapis.com ory proxy|tunnel
- ORY_KRATOS_URL=https://<project-slug>.projects.oryapis.com ory proxy|tunnel
+ ory proxy|tunnel --project <project>
+ ory proxy|tunnel --workspace <workspace_id> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project-id> ory proxy|tunnel

- ory create event-stream|jwk|oauth2-client|organization|project|relationships|workspace <project>
+ ory create event-stream|jwk|oauth2-client|organization|project|relationships|workspace --project <project>
+ ory create event-stream|jwk|oauth2-client|organization|project|relationships|workspace --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory create event-stream|jwk|oauth2-client|organization|project|relationships|workspace

- ory delete access-tokens|event-stream|identity|jwk|oauth2-client|organization|relationships <project>
+ ory delete access-tokens|event-stream|identity|jwk|oauth2-client|organization|relationships --project <project>
+ ory delete access-tokens|event-stream|identity|jwk|oauth2-client|organization|relationships --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory delete access-tokens|event-stream|identity|jwk|oauth2-client|organization|relationships

- ory list event-streams|identities|oauth2-clients|organizations|projects|relationships|workspaces <project>
+ ory list event-streams|identities|oauth2-clients|organizations|projects|relationships|workspaces --project <project>
+ ory list event-streams|identities|oauth2-clients|organizations|projects|relationships|workspaces --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory list event-streams|identities|oauth2-clients|organizations|projects|relationships|workspaces

- ory import identities|jwk|oauth2-client <project>
+ ory import identities|jwk|oauth2-client --project <project>
+ ory import identities|jwk|oauth2-client --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory import identities|jwk|oauth2-client

- ory patch identity-config|oauth2-config|opl|permission-config|project <project>
+ ory patch identity-config|oauth2-config|opl|permission-config|project --project <project>
+ ory patch identity-config|oauth2-config|opl|permission-config|project --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory patch identity-config|oauth2-config|opl|permission-config|project

- ory update event-stream|identity-config|oauth2-client|oauth2-config|opl|organization|permission-config|project <project>
+ ory update event-stream|identity-config|oauth2-client|oauth2-config|opl|organization|permission-config|project --project <project>
+ ory update event-stream|identity-config|oauth2-client|oauth2-config|opl|organization|permission-config|project --workspace <workspace> --project <project>
+ ORY_WORKSPACE=<workspace> ORY_PROJECT=<project> ory update event-stream|identity-config|oauth2-client|oauth2-config|opl|organization|permission-config|project