<@U04UQ68083H> is there a way to export my kratos ...
# ory-copilot
w
@chilly-king-10285 is there a way to export my kratos config? It should include values not explicitly set
c
A message from kapa.ai
Yes, you can export your Ory Kratos configuration using the Ory CLI. This can be particularly useful for moving your local setup to the cloud or for testing different settings in a local development environment. To export your project's Ory Identities configuration, you can use the following commands:
Copy code
bash ## List all available workspaces   ory list workspaces      ## List all available projects   ory list projects --workspace <workspace-id>      ## Get config   ory get identity-config --project <project-id> --workspace <workspace-id> --format yaml
The
--format
flag defines the format of the output file. You can choose one of
yaml
,
json
, or
json-pretty
. Getting the configuration in the YAML format produces output that is ready to use with self-hosted Ory Kratos. To save the configuration to a YAML file, you can use the following command:
Copy code
bash ory get identity-config --project <project-id> --workspace <workspace-id> --format yaml > identity-config.yaml
Please note that you must be signed in to an Ory Network account to perform this action. You can read more about this in the [Ory CLI documentation](https://www.ory.sh/docs/guides/cli/cli-basics#use-cli-with-existing-cloud-account). [Source](https://www.ory.sh/docs/guides/cli/identity-cli)
w
@chilly-king-10285 can i use this cli against a self hosted kratos instance?
c
A message from kapa.ai
Yes, you can use the Ory CLI with a self-hosted Ory Kratos instance. The CLI allows you to adjust the configuration of the Ory Identities and apply the configuration from the Ory Network environment to self-hosted Ory Kratos Identity Server instances. However, please note that for multi-tenancy, Ory Network is the only available option. It is not possible to self-host Ory Kratos as a multi-tenant service due to data, scalability, and operational complexity. For more information, you can refer to the [Ory CLI documentation](https://www.ory.sh/docs/guides/cli/identity-cli) and the [Ory Kratos multi-tenancy guide](https://www.ory.sh/docs/kratos/guides/multi-tenancy-multitenant).
w
@chilly-king-10285 i mean can i use the cli to perform actions against my selfhosted kratos?
c
A message from kapa.ai
Yes, you can use the Ory CLI to interact with your self-hosted Ory Kratos instance. For example, you can use the
kratos serve
command to run the Ory Kratos server:
Copy code
bash kratos serve [flags]
The flags for this command include:
Copy code
bash   -c, --config strings   Path to one or more .json, .yaml, .yml, .toml config files.        --dev              Disables critical security features to make development easier     -h, --help             help for serve         --sqa-opt-out      Disable anonymized telemetry reports        --watch-courier    Run the message courier as a background task, to simplify single-instance setup
You can also use the
kratos remote
command to manage remote Ory Kratos instances:
Copy code
bash   -e, --endpoint string   The URL of Ory Kratos' Admin API. Alternatively set using the KRATOS_ADMIN_URL environmental variable.         --format string     Set the output format. One of table, json, yaml, json-pretty, jsonpath and jsonpointer. (default "default")     -h, --help              help for remote     -q, --quiet             Be quiet with output printing.
For more information, you can refer to the [Ory Kratos CLI documentation](https://www.ory.sh/docs/kratos/cli/kratos-serve) and the [Ory Kratos remote CLI documentation](https://www.ory.sh/docs/kratos/cli/kratos-remote).
w
@chilly-king-10285 thanks. Is there an environment variable I can set for the endpoint as opposed to adding it to every command?
c
A message from kapa.ai
New message text here