enough-vase-33352
04/07/2025, 9:40 AMbrief-egg-61061
04/07/2025, 9:40 AMbrief-egg-61061
04/07/2025, 9:40 AMbrew install ory/tap/cli
### For Linux: bash <(curl <https://raw.githubusercontent.com/ory/meta/master/install.sh>) -b . ory sudo mv ./ory /usr/local/bin/
### For Windows: scoop bucket add ory <https://github.com/ory/scoop.git> scoop install ory
Verify the installation with: ory help
[Installation guide](https://www.ory.sh/docs/guides/cli/installation) ## 2. For self-hosted Ory Kratos When working with a self-hosted Ory Kratos instance, you need to: 1. Clone and run Ory Kratos locally: git clone --depth 1 --branch master <https://github.com/ory/kratos.git> cd kratos git checkout master git pull -ff docker-compose -f quickstart.yml -f contrib/quickstart/kratos/cloud/quickstart.yml up --build --force-recreate -d
2. Set the environment variable to point to your local Kratos instance: export ORY_SDK_URL=<http://localhost:4433>
[Getting Started guide](https://www.ory.sh/docs/getting-started/integrate-auth/react#run-your-react-app) ## 3. Export/Import Configuration You can export the configuration from your self-hosted Kratos instance to use with the CLI: ory get identity-config --project <project-id> --workspace <workspace-id> --format yaml > identity-config.yaml
Or import a configuration file to your Ory Identities: ory update identity-config --project <project-id> --workspace <workspace-id> --file config.yaml
[Identity CLI guide](https://www.ory.sh/docs/guides/cli/identity-cli) ## 4. For Local Development If you're developing locally, you can use Ory Tunnel to create a connection between your local environment and Ory: ory tunnel --dev --project $PROJECT_SLUG <http://localhost:3000>
This opens port 4000 on your local machine and allows your application to communicate with Ory Kratos. [Local Development guide](https://www.ory.sh/docs/getting-started/local-development#local-development) Remember that the Ory Tunnel should only be used for development purposes. For production, you should add a custom domain to your project.enough-vase-33352
04/07/2025, 9:41 AMbrief-egg-61061
04/07/2025, 9:41 AMbrief-egg-61061
04/07/2025, 9:42 AM--endpoint
flag or the corresponding environment variable to point to your Kratos admin API URL: 1. Using the endpoint flag: kratos --endpoint <https://your-kratos-admin-api.aws-domain.com> <command>
2. Using environment variable: export KRATOS_ADMIN_URL=<https://your-kratos-admin-api.aws-domain.com> kratos <command>
This approach works for all Kratos CLI commands that interact with a remote instance, such as: - Identity management: kratos identities list
, kratos identities get
, etc. - Remote status checks: kratos remote status
- Version information: kratos remote version
## Example Commands Here are some examples of commands you might use with your AWS-deployed Kratos: # List all identities kratos --endpoint <https://your-kratos-admin-api.aws-domain.com> identities list # Get a specific identity kratos --endpoint <https://your-kratos-admin-api.aws-domain.com> identities get <id> # Check if your Kratos instance is running kratos --endpoint <https://your-kratos-admin-api.aws-domain.com> remote status
The Ory CLI will use the specified endpoint to communicate with your Kratos instance running on AWS. ## Additional Information - Make sure your AWS security groups and network settings allow connections from your local machine to the Kratos admin API. - Ensure proper authentication is set up if your admin API requires it. - The admin API should not be publicly accessible without proper security measures. For more details on available commands, you can refer to the [Kratos CLI documentation](https://www.ory.sh/docs/kratos/cli/kratos) and [Kratos remote commands](https://www.ory.sh/docs/kratos/cli/kratos-remote).