Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ private static void ConfigureClientContext(
ParseResult parseResult,
Session? session)
{
var cloudUrlResult = parseResult.GetResult(Opt<OptionalCloudUrlOption>.Instance);
var cloudUrl = parseResult.GetValue(Opt<OptionalCloudUrlOption>.Instance);
string? apiUrl;
if (cloudUrlResult is { Implicit: false } && !string.IsNullOrWhiteSpace(cloudUrl))
{
apiUrl = cloudUrl;
}
else
// The option resolves explicit --cloud-url, then the NITRO_CLOUD_URL env var.
// We then fall back to the session's URL, and finally Constants.ApiUrl
// (applied by NitroClientContext.Configure when apiUrl is null).
var apiUrl = parseResult.GetValue(Opt<OptionalCloudUrlOption>.Instance);

if (string.IsNullOrWhiteSpace(apiUrl))
{
apiUrl = session?.ApiUrl;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ChilliCream.Nitro.CommandLine.Helpers;

namespace ChilliCream.Nitro.CommandLine;

internal sealed class OptionalCloudUrlOption : Option<string>
Expand All @@ -8,6 +6,6 @@ public OptionalCloudUrlOption() : base("--cloud-url")
{
Description = "The URL of the Nitro backend (only needed for self-hosted or dedicated deployments)";
Required = false;
this.DefaultFromEnvironmentValue(EnvironmentVariables.CloudUrl, defaultValue: Constants.ApiUrl["https://".Length..]);
this.DefaultFromEnvironmentValue(EnvironmentVariables.CloudUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nitro api-key create [options]
--api-id <api-id> The ID of the API [env: NITRO_API_ID]
--workspace-id <workspace-id> The ID of the workspace [env: NITRO_WORKSPACE_ID]
--stage-condition <stage-condition> [Preview] Limit the API key to a specific stage name (if not set, the key is valid for all stages)
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nitro api-key delete <id> [options]

Options:
--force Skip confirmation prompts for deletes and overwrites
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nitro api-key list [options]
Options:
--cursor <cursor> The pagination cursor to resume from [env: NITRO_CURSOR]
--workspace-id <workspace-id> The ID of the workspace [env: NITRO_WORKSPACE_ID]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nitro api create [options]
--name <name> The name of the API [env: NITRO_API_NAME]
--workspace-id <workspace-id> The ID of the workspace [env: NITRO_WORKSPACE_ID]
--kind <collection|gateway|service> The kind of the API [env: NITRO_API_KIND]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ nitro api delete <id> [options]

Options:
--force Skip confirmation prompts for deletes and overwrites
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nitro api list [options]
Options:
--cursor <cursor> The pagination cursor to resume from [env: NITRO_CURSOR]
--workspace-id <workspace-id> The ID of the workspace [env: NITRO_WORKSPACE_ID]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nitro api set-settings <id> [options]
Options:
--treat-dangerous-as-breaking Treat dangerous changes as breaking [env: NITRO_TREAT_DANGEROUS_AS_BREAKING]
--allow-breaking-schema-changes Allow breaking schema changes when no client breaks [env: NITRO_ALLOW_BREAKING_SCHEMA_CHANGES]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nitro api show <id> [options]
<id> The resource ID

Options:
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nitro client create [options]
Options:
--api-id <api-id> The ID of the API [env: NITRO_API_ID]
--name <name> The name of the client [env: NITRO_CLIENT_NAME]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ nitro client delete [<id>] [options]

Options:
--force Skip confirmation prompts for deletes and overwrites
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ nitro client download [options]
--stage <stage> (REQUIRED) The name of the stage [env: NITRO_STAGE]
--path <path> (REQUIRED) The path where the client is stored
--format <folder|relay> The format in which the client is stored [default: relay]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nitro client list [command] [options]
Options:
--api-id <api-id> The ID of the API [env: NITRO_API_ID]
--cursor <cursor> The pagination cursor to resume from [env: NITRO_CURSOR]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ nitro client list published-versions [options]
Options:
--client-id <client-id> The ID of the client [env: NITRO_CLIENT_ID]
--cursor <cursor> The pagination cursor to resume from [env: NITRO_CURSOR]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ nitro client list versions [options]
Options:
--client-id <client-id> The ID of the client [env: NITRO_CLIENT_ID]
--cursor <cursor> The pagination cursor to resume from [env: NITRO_CURSOR]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ nitro client publish [options]
--stage <stage> (REQUIRED) The name of the stage [env: NITRO_STAGE]
--force Skip confirmation prompts for deletes and overwrites
--wait-for-approval Wait for the deployment to be approved before completing [env: NITRO_WAIT_FOR_APPROVAL]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ nitro client show <id> [options]
<id> The resource ID

Options:
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nitro client unpublish [options]
--tag <tag> (REQUIRED) One or more client version tags to unpublish [env: NITRO_TAG]
--stage <stage> (REQUIRED) The name of the stage [env: NITRO_STAGE]
--client-id <client-id> (REQUIRED) The ID of the client [env: NITRO_CLIENT_ID]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nitro client upload [options]
--client-id <client-id> (REQUIRED) The ID of the client [env: NITRO_CLIENT_ID]
--tag <tag> (REQUIRED) The tag of the schema version to deploy [env: NITRO_TAG]
--operations-file <operations-file> (REQUIRED) The path to the json file with the operations [env: NITRO_OPERATIONS_FILE]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ nitro client validate [options]
--client-id <client-id> (REQUIRED) The ID of the client [env: NITRO_CLIENT_ID]
--stage <stage> (REQUIRED) The name of the stage [env: NITRO_STAGE]
--operations-file <operations-file> (REQUIRED) The path to the json file with the operations [env: NITRO_OPERATIONS_FILE]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ nitro environment create [options]
Options:
-n, --name <name> The name of the environment
--workspace-id <workspace-id> The ID of the workspace [env: NITRO_WORKSPACE_ID]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL] [default: api.chillicream.com]
--cloud-url <cloud-url> The URL of the Nitro backend (only needed for self-hosted or dedicated deployments) [env: NITRO_CLOUD_URL]
--api-key <api-key> The API key used for authentication [env: NITRO_API_KEY]
--output <json> The output format (enables non-interactive mode) [env: NITRO_OUTPUT_FORMAT]
-?, -h, --help Show help and usage information
Expand Down
Loading
Loading