├── .version ├── test ├── ConfigCat.Cli.Tests │ ├── a │ │ ├── a.txt │ │ ├── .ignore │ │ ├── b │ │ │ ├── b.txt │ │ │ ├── d │ │ │ │ ├── d.txt │ │ │ │ └── h.txt │ │ │ ├── e │ │ │ │ └── e.txt │ │ │ └── .ignore │ │ └── c │ │ │ ├── c.txt │ │ │ ├── f │ │ │ ├── f.txt │ │ │ └── .ignore │ │ │ └── g │ │ │ └── g.txt │ ├── Fakes │ │ └── FakeRandomNumberGenerator.cs │ ├── custom.txt │ └── GitClientTests.cs ├── sample-to-scan1.txt └── sample-to-scan2.txt ├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ └── publish-net-tool.yml ├── docs ├── favicon.ico ├── _includes │ └── head-custom.html ├── _config.yml ├── assets │ └── css │ │ └── style.scss ├── configcat-tag-rm.md ├── configcat-product-ls.md ├── configcat-config-rm.md ├── configcat-tag-ls.md ├── configcat-product-rm.md ├── configcat-segment-rm.md ├── configcat-webhook-rm.md ├── configcat-workspace-clr.md ├── configcat-config-ls.md ├── configcat-member-lsp.md ├── configcat-segment-ls.md ├── configcat-webhook-ls.md ├── configcat-webhook-show.md ├── configcat-flag-rm.md ├── configcat-member-lsip.md ├── configcat-environment-rm.md ├── configcat-flag-v2-rm.md ├── configcat-member-lso.md ├── configcat-environment-ls.md ├── configcat-member-lsio.md ├── configcat-workspace-show.md ├── configcat-member-rm.md ├── configcat-webhook-headers-rm.md ├── configcat-segment-show.md ├── configcat-tag-update.md ├── configcat-ls.md ├── configcat-permission-group-rm.md ├── configcat-permission-group-ls.md ├── configcat-flag-attach.md ├── configcat-flag-detach.md ├── configcat-product-preferences-show.md ├── configcat-webhook-headers.md ├── configcat-flag-v2-attach.md ├── configcat-flag-v2-detach.md ├── configcat-tag-create.md ├── configcat-flag-ls.md ├── configcat-config-update.md ├── configcat-workspace-set.md ├── configcat-flag-percentage.md ├── configcat-flag-v2-ls.md ├── configcat-product-update.md ├── configcat-permission-group-show.md ├── configcat-product-preferences.md ├── configcat-flag-value-show.md ├── configcat-environment-update.md ├── configcat-product-preferences-update-env.md ├── configcat-flag-v2-value-show.md ├── configcat-member-add-permission.md ├── configcat-flag-value.md ├── configcat-member-rm-permission.md ├── configcat-flag-v2-targeting-condition.md ├── configcat-product-create.md ├── configcat-sdk-key.md ├── configcat-webhook-update.md ├── configcat-webhook-headers-add.md ├── configcat-flag-update.md ├── configcat-flag-v2-value.md ├── configcat-webhook-create.md ├── configcat-flag-v2-update.md ├── configcat-config-json.md ├── configcat-flag-percentage-clear.md ├── configcat-flag-v2-targeting.md ├── configcat-environment-create.md ├── configcat-flag-targeting-rm.md ├── configcat-member-invite.md ├── configcat-flag-targeting.md ├── configcat-config-create.md ├── configcat-flag-v2-targeting-rule-rm.md ├── configcat-flag-v2-targeting-percentage-clear.md ├── configcat-flag-value-update.md ├── configcat-flag-targeting-move.md ├── configcat-flag-v2-value-update.md ├── configcat-setup.md ├── configcat-config-json-convert.md ├── configcat-flag-v2-targeting-rule-create.md ├── configcat-workspace.md ├── configcat-flag-v2-targeting-condition-add.md ├── configcat-flag-v2-targeting-rule-move.md ├── configcat-flag-v2-targeting-condition-rm.md ├── configcat-flag-percentage-update.md ├── configcat-flag-v2-targeting-percentage.md ├── configcat-tag.md ├── configcat-flag-v2-targeting-rule.md ├── configcat-flag-v2-targeting-percentage-update.md ├── configcat-flag-v2-targeting-percentage-attribute.md ├── configcat-config.md ├── configcat-config-json-get.md ├── configcat-environment.md ├── configcat-product.md ├── configcat-segment.md ├── configcat-segment-update.md ├── configcat-webhook.md ├── configcat-flag-v2-targeting-rule-update-served-value.md ├── configcat-segment-create.md ├── configcat-flag-v2-targeting-condition-add-segment.md ├── configcat-flag-create.md ├── configcat-flag-v2-create.md ├── configcat-product-preferences-update.md ├── configcat-member.md ├── configcat-flag-v2-targeting-rule-create-segment.md ├── configcat-permission-group-env.md ├── configcat-flag-v2-targeting-condition-add-prerequisite.md ├── configcat-permission-group.md ├── configcat-eval.md ├── configcat-flag.md ├── configcat-flag-v2.md ├── configcat-flag-targeting-create.md ├── configcat-flag-v2-targeting-rule-create-prerequisite.md └── configcat-flag-targeting-update.md ├── assets ├── cli-setup2.gif └── cli-flag-create2.gif ├── media └── icon-128x128.png ├── src ├── ConfigCat.Cli.Services │ ├── Exceptions │ │ ├── ShowHelpException.cs │ │ ├── JsonParsingFailedException.cs │ │ └── HttpStatusException.cs │ ├── Json │ │ ├── JsonPatchOperation.cs │ │ └── JsonPatchDocument.cs │ ├── Rendering │ │ └── CursorHider.cs │ ├── ConfigCat.Cli.Services.csproj │ ├── FileSystem │ │ └── Ignore │ │ │ ├── GlobalIgnorePolicy.cs │ │ │ ├── IgnorePolicy.cs │ │ │ └── IgnoreFile.cs │ ├── Api │ │ ├── MeClient.cs │ │ ├── SdkKeyClient.cs │ │ └── OrganizationClient.cs │ ├── Utilities │ │ └── TokenGenerator.cs │ ├── Extensions │ │ ├── IOExtensions.cs │ │ ├── HttpRequestMessageExtensions.cs │ │ ├── ModelExtensions.cs │ │ └── ListExtensions.cs │ └── Configuration │ │ └── ConfigurationFileStorage.cs ├── ConfigCat.Cli │ ├── Properties │ │ └── launchSettings.json │ ├── ExtendedCommand.cs │ ├── Options │ │ ├── VerboseOption.cs │ │ ├── NonInteractiveOption.cs │ │ ├── ExtendedHelpBuilder.cs │ │ ├── ReasonRequiredEnvironmentOption.cs │ │ ├── UserAttributeArgument.cs │ │ └── FlagInitialValuesOption.cs │ ├── CommandDescriptor.cs │ └── Commands │ │ └── Setup.cs ├── ConfigCat.Cli.Models │ ├── Api │ │ ├── MeModel.cs │ │ ├── PercentageModel.cs │ │ ├── SdkKeyModel.cs │ │ ├── OrganizationModel.cs │ │ ├── UpdateFlagModel.cs │ │ ├── ConfigModel.cs │ │ ├── EnvironmentModel.cs │ │ ├── TagModel.cs │ │ ├── TargetingModel.cs │ │ ├── FlagValueModel.cs │ │ ├── CreateFlagModel.cs │ │ ├── ProductModel.cs │ │ ├── FlagModel.cs │ │ ├── WebhookModel.cs │ │ ├── SegmentModel.cs │ │ └── MemberModel.cs │ ├── Scan │ │ ├── Line.cs │ │ ├── FlagReferenceResult.cs │ │ ├── AliasScanResult.cs │ │ └── Reference.cs │ ├── CliOptions.cs │ ├── Configuration │ │ ├── CliConfig.cs │ │ ├── Workspace.cs │ │ └── Auth.cs │ ├── ConfigFile │ │ ├── V6 │ │ │ ├── PercentageOptionV6.cs │ │ │ ├── ValueAndVariationIdV6.cs │ │ │ ├── SegmentConditionV6.cs │ │ │ ├── PrerequisiteFlagConditionV6.cs │ │ │ ├── ConfigV6.cs │ │ │ ├── PreferenceV6.cs │ │ │ ├── ValueV6.cs │ │ │ ├── SegmentV6.cs │ │ │ ├── TargetingRuleV6.cs │ │ │ ├── ConditionV6.cs │ │ │ ├── ComparisonRuleV6.cs │ │ │ └── EvaluationFormulaV6.cs │ │ ├── V5 │ │ │ ├── PreferencesV5.cs │ │ │ ├── ConfigV5.cs │ │ │ ├── RolloutPercentageItem.cs │ │ │ ├── SettingV5.cs │ │ │ └── RolloutRuleV5.cs │ │ ├── SegmentComparator.cs │ │ ├── PrerequisiteComparator.cs │ │ ├── SettingType.cs │ │ └── RolloutRuleComparator.cs │ ├── Git │ │ └── GitRepositoryInfo.cs │ ├── ConfigCat.Cli.Models.csproj │ ├── EvalResult.cs │ └── JsonOutputs.cs └── ConfigCat.Cli.DocGenerator │ ├── ConfigCat.Cli.DocGenerator.csproj │ └── ExposedHelpBuilder.cs ├── Dockerfile ├── azure-devops └── Dockerfile ├── choco ├── VERIFICATION.txt └── configcat.nuspec ├── snap └── snapcraft.yaml ├── brew └── fromula-template.rb ├── LICENSE ├── scoop └── configcat-template.json └── scripts ├── scoop-publish.sh └── brew-publish.sh /.version: -------------------------------------------------------------------------------- 1 | 2.5.2 -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/.ignore: -------------------------------------------------------------------------------- 1 | b -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/b/b.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/b/d/d.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/b/d/h.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/b/e/e.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/c/c.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/c/f/f.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/c/g/g.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/sample-to-scan1.txt: -------------------------------------------------------------------------------- 1 | 'flag_to_scan' -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/c/f/.ignore: -------------------------------------------------------------------------------- 1 | *.txt -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @configcat/developers 2 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/a/b/.ignore: -------------------------------------------------------------------------------- 1 | !d/ 2 | !e.txt -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/configcat/cli/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /assets/cli-setup2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/configcat/cli/HEAD/assets/cli-setup2.gif -------------------------------------------------------------------------------- /media/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/configcat/cli/HEAD/media/icon-128x128.png -------------------------------------------------------------------------------- /assets/cli-flag-create2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/configcat/cli/HEAD/assets/cli-flag-create2.gif -------------------------------------------------------------------------------- /docs/_includes/head-custom.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/sample-to-scan2.txt: -------------------------------------------------------------------------------- 1 | "flag_to_scan" 2 | 3 | "flag_to_scan_2" 4 | 5 | custom_alias = flags!(flag_to_scan) -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | markdown: GFM 2 | name: Command Line Interface Reference 3 | title: null 4 | github: 5 | private: true -------------------------------------------------------------------------------- /docs/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "{{ site.theme }}"; 5 | 6 | table td:first-of-type { 7 | white-space: nowrap; 8 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" 8 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Exceptions/ShowHelpException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ConfigCat.Cli.Services.Exceptions; 4 | 5 | public class ShowHelpException(string message) : Exception(message); -------------------------------------------------------------------------------- /src/ConfigCat.Cli/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "ConfigCat.Cli": { 4 | "commandName": "Project", 5 | "commandLineArgs": "m lso" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/MeModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class MeModel 4 | { 5 | public string Email { get; set; } 6 | 7 | public string FullName { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Scan/Line.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Scan; 2 | 3 | public class Line 4 | { 5 | public string LineText { get; set; } 6 | 7 | public int LineNumber { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/PercentageModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class PercentageModel 4 | { 5 | public int Percentage { get; set; } 6 | 7 | public object Value { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/SdkKeyModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class SdkKeyModel 4 | { 5 | public string Primary { get; set; } 6 | 7 | public string Secondary { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/CliOptions.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models; 2 | 3 | public class CliOptions 4 | { 5 | public bool IsVerboseEnabled { get; set; } 6 | 7 | public bool IsNonInteractive { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/OrganizationModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class OrganizationModel 4 | { 5 | public string OrganizationId { get; set; } 6 | 7 | public string Name { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Configuration/CliConfig.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Configuration; 2 | 3 | public class CliConfig 4 | { 5 | public Auth Auth { get; set; } 6 | 7 | public Workspace Workspace { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Configuration/Workspace.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Configuration; 2 | 3 | public class Workspace 4 | { 5 | public string Product { get; set; } 6 | 7 | public string Config { get; set; } 8 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Exceptions/JsonParsingFailedException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ConfigCat.Cli.Services.Exceptions; 4 | 5 | internal class JsonParsingFailedException(string message, Exception innerException) : Exception(message, innerException); -------------------------------------------------------------------------------- /src/ConfigCat.Cli/ExtendedCommand.cs: -------------------------------------------------------------------------------- 1 | using System.CommandLine; 2 | 3 | namespace ConfigCat.Cli; 4 | 5 | public class ExtendedCommand(string name, string description = null, string example = null) 6 | : Command(name, description) 7 | { 8 | public string Example { get; set; } = example; 9 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.20 2 | 3 | RUN apk add --no-cache \ 4 | git \ 5 | ca-certificates \ 6 | libgcc \ 7 | libssl3 \ 8 | libstdc++ \ 9 | zlib 10 | 11 | COPY ./linux-musl-x64/configcat /usr/local/bin 12 | 13 | ENTRYPOINT ["configcat"] 14 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Scan/FlagReferenceResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | 4 | namespace ConfigCat.Cli.Models.Scan; 5 | 6 | public class FlagReferenceResult 7 | { 8 | public FileInfo File { get; set; } 9 | 10 | public List References { get; set; } 11 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/PercentageOptionV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class PercentageOptionV6 : ValueAndVariationIdV6 6 | { 7 | [JsonPropertyName("p")] 8 | public byte Percentage { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Json/JsonPatchOperation.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Services.Json; 2 | 3 | public class JsonPatchOperation 4 | { 5 | public object Value { get; set; } 6 | 7 | public string Path { get; set; } 8 | 9 | public string Op { get; set; } 10 | 11 | public string From { get; set; } 12 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Git/GitRepositoryInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ConfigCat.Cli.Models.Git; 4 | 5 | public class GitRepositoryInfo 6 | { 7 | public string Branch { get; set; } 8 | 9 | public string CurrentCommitHash { get; set; } 10 | 11 | public List ActiveBranches { get; set; } 12 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/UpdateFlagModel.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.Api; 4 | 5 | public class UpdateFlagModel 6 | { 7 | public string Name { get; set; } 8 | 9 | public string Hint { get; set; } 10 | 11 | [JsonPropertyName("tags")] 12 | public int[] TagIds { get; set; } 13 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Scan/AliasScanResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System.IO; 3 | 4 | namespace ConfigCat.Cli.Models.Scan; 5 | 6 | public class AliasScanResult 7 | { 8 | public FileInfo ScannedFile { get; set; } 9 | 10 | public ConcurrentDictionary> FlagAliases { get; set; } = new(); 11 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigCat.Cli.Models.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V5/PreferencesV5.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V5 4 | { 5 | public class PreferencesV5 6 | { 7 | [JsonPropertyName("u")] 8 | public string Url { get; set; } 9 | 10 | [JsonPropertyName("r")] 11 | public int RedirectMode { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/ConfigModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class ConfigModel 4 | { 5 | public ProductModel Product { get; set; } 6 | 7 | public string ConfigId { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string EvaluationVersion { get; set; } 12 | 13 | public string Description { get; set; } 14 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/EnvironmentModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class EnvironmentModel 4 | { 5 | public ProductModel Product { get; set; } 6 | 7 | public string EnvironmentId { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string Color { get; set; } 12 | 13 | public string Description { get; set; } 14 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/ValueAndVariationIdV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class ValueAndVariationIdV6 6 | { 7 | [JsonPropertyName("v")] 8 | public ValueV6 Value { get; set; } 9 | 10 | [JsonPropertyName("i")] 11 | public string VariationId { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/Fakes/FakeRandomNumberGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace ConfigCat.Cli.Tests.Fakes 5 | { 6 | public class FakeRandomNumberGenerator(int seed = 0) : RandomNumberGenerator 7 | { 8 | private Random random = new(seed); 9 | 10 | public override void GetBytes(byte[] data) => this.random.NextBytes(data); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/SegmentConditionV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class SegmentConditionV6 6 | { 7 | [JsonPropertyName("s")] 8 | public int SegmentIndex { get; set; } 9 | 10 | [JsonPropertyName("c")] 11 | public SegmentComparator SegmentComparator { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Configuration/Auth.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.Configuration; 4 | 5 | public class Auth 6 | { 7 | [JsonPropertyName("user")] 8 | public string UserName { get; set; } 9 | 10 | [JsonPropertyName("pass")] 11 | public string Password { get; set; } 12 | 13 | [JsonPropertyName("host")] 14 | public string ApiHost { get; set; } 15 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V5/ConfigV5.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V5 5 | { 6 | public class ConfigV5 7 | { 8 | [JsonPropertyName("f")] 9 | public Dictionary Settings { get; set; } 10 | 11 | [JsonPropertyName("p")] 12 | public PreferencesV5 Preferences { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /azure-devops/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:18-alpine 2 | 3 | COPY ./linux-musl-x64/configcat /usr/local/bin 4 | 5 | RUN apk add --no-cache \ 6 | git ca-certificates \ 7 | libgcc libssl3 libstdc++ zlib \ 8 | bash sudo shadow 9 | 10 | RUN apk add --no-cache --virtual .pipeline-deps readline linux-pam \ 11 | && apk del .pipeline-deps 12 | 13 | LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/local/bin/node" 14 | 15 | CMD [ "node" ] 16 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/SegmentComparator.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile 4 | { 5 | /// 6 | /// The segment comparison operator used during the evaluation process. 7 | /// 8 | public enum SegmentComparator 9 | { 10 | [Display(Name = "IS IN SEGMENT")] 11 | IsIn, 12 | 13 | [Display(Name = "IS NOT IN SEGMENT")] 14 | IsNotIn 15 | } 16 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/TagModel.cs: -------------------------------------------------------------------------------- 1 | namespace ConfigCat.Cli.Models.Api; 2 | 3 | public class TagModel 4 | { 5 | public ProductModel Product { get; set; } 6 | 7 | public int TagId { get; set; } 8 | 9 | public string Name { get; set; } 10 | 11 | public string Color { get; set; } 12 | 13 | public override bool Equals(object obj) => obj is TagModel model && this.TagId.Equals(model.TagId); 14 | 15 | public override int GetHashCode() => this.TagId.GetHashCode(); 16 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/PrerequisiteComparator.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile 4 | { 5 | /// 6 | /// The comparison operator used during the evaluation process. 7 | /// 8 | public enum PrerequisiteComparator : byte 9 | { 10 | [Display(Name = "EQUALS")] 11 | Equals = 0, 12 | 13 | [Display(Name = "NOT EQUALS")] 14 | DoesNotEqual = 1 15 | } 16 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Rendering/CursorHider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace ConfigCat.Cli.Services.Rendering; 4 | 5 | public class CursorHider : IDisposable 6 | { 7 | private readonly IOutput output; 8 | 9 | public CursorHider(IOutput output) 10 | { 11 | this.output = output; 12 | output.HideCursor(); 13 | } 14 | 15 | public void ShowCursor() => this.output?.ShowCursor(); 16 | 17 | public void Dispose() => this.ShowCursor(); 18 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.DocGenerator/ConfigCat.Cli.DocGenerator.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Exceptions/HttpStatusException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | namespace ConfigCat.Cli.Services.Exceptions; 5 | 6 | public class HttpStatusException( 7 | HttpStatusCode statusCode, 8 | string reason, 9 | string message = null, 10 | Exception innerException = null) 11 | : Exception(message, innerException) 12 | { 13 | public HttpStatusCode StatusCode { get; } = statusCode; 14 | 15 | public string ReasonPhrase { get; } = reason; 16 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli/Options/VerboseOption.cs: -------------------------------------------------------------------------------- 1 | using System.CommandLine; 2 | 3 | namespace ConfigCat.Cli.Options; 4 | 5 | internal class VerboseOption() : Option([ 6 | "--verbose", 7 | "-v", 8 | "/v" 9 | ], "Print detailed execution information") 10 | { 11 | public override bool Equals(object obj) 12 | { 13 | return obj is VerboseOption; 14 | } 15 | 16 | public override int GetHashCode() 17 | { 18 | return typeof(VerboseOption).GetHashCode(); 19 | } 20 | } -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/custom.txt: -------------------------------------------------------------------------------- 1 | CUS_TEST_FLAG = :test_flag 2 | 3 | CUS_ANOTHER_FLAG = :another_flag 4 | 5 | Somewhere else refer to CUS_TEST_FLAG 6 | 7 | CUS2_TEST_FLAG = client_wrapper.get_flag(:test_flag) 8 | 9 | client_wrapper.get_flag(:test_flag, cust_flag_val => { 10 | 11 | Somewhere else refer to CUS_TEST_FLAG 12 | 13 | let is_test_flag_on := FLAGS('test_flag') 14 | 15 | Reference to is_test_flag_on 16 | 17 | Reference to CUS2_TEST_FLAG 18 | 19 | Reference to cust_flag_val 20 | 21 | if FLAGS.enabled(:test_direct) { 22 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli/Options/NonInteractiveOption.cs: -------------------------------------------------------------------------------- 1 | using System.CommandLine; 2 | 3 | namespace ConfigCat.Cli.Options; 4 | 5 | internal class NonInteractiveOption() : Option([ 6 | "--non-interactive", 7 | "-ni" 8 | ], "Turn off progress rendering and interactive features") 9 | { 10 | public override bool Equals(object obj) 11 | { 12 | return obj is NonInteractiveOption; 13 | } 14 | 15 | public override int GetHashCode() 16 | { 17 | return typeof(NonInteractiveOption).GetHashCode(); 18 | } 19 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/SettingType.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile 4 | { 5 | public enum SettingType 6 | { 7 | [Display(Name = "On/Off Toggle (Boolean)")] 8 | Boolean = 0, 9 | 10 | [Display(Name = "Text (String)")] 11 | String = 1, 12 | 13 | [Display(Name = "Whole Number (Integer) - eg. 42")] 14 | Int = 2, 15 | 16 | [Display(Name = "Decimal Number (Double) - eg. 3.14")] 17 | Double = 3, 18 | } 19 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/PrerequisiteFlagConditionV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class PrerequisiteFlagConditionV6 6 | { 7 | [JsonPropertyName("f")] 8 | public string PrerequisiteSettingKey { get; set; } 9 | 10 | [JsonPropertyName("c")] 11 | public PrerequisiteComparator PrerequisiteComparator { get; set; } 12 | 13 | [JsonPropertyName("v")] 14 | public ValueV6 Value { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/ConfigV6.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V6 5 | { 6 | public class ConfigV6 7 | { 8 | [JsonPropertyName("p")] 9 | public PreferenceV6 Preferences { get; set; } 10 | 11 | [JsonPropertyName("s")] 12 | public List Segments { get; set; } 13 | 14 | [JsonPropertyName("f")] 15 | public Dictionary FeatureFlags { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/PreferenceV6.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V6 5 | { 6 | public class PreferenceV6 7 | { 8 | [JsonPropertyName("u")] 9 | public Uri BaseUrl { get; set; } 10 | 11 | // Note: this property maybe will be overriden in the CdnService 12 | [JsonPropertyName("r")] 13 | public int? Redirect { get; set; } 14 | 15 | [JsonPropertyName("s")] 16 | public string Salt { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/ValueV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class ValueV6 6 | { 7 | [JsonPropertyName("b")] 8 | public bool? BoolValue { get; set; } 9 | 10 | [JsonPropertyName("s")] 11 | public string StringValue { get; set; } 12 | 13 | [JsonPropertyName("i")] 14 | public int? IntValue { get; set; } 15 | 16 | [JsonPropertyName("d")] 17 | public double? DoubleValue { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/TargetingModel.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.Api; 4 | 5 | public class TargetingModel 6 | { 7 | public string ComparisonAttribute { get; set; } 8 | 9 | public string Comparator { get; set; } 10 | 11 | public string ComparisonValue { get; set; } 12 | 13 | public object Value { get; set; } 14 | 15 | public string SegmentComparator { get; set; } 16 | 17 | public string SegmentId { get; set; } 18 | 19 | [JsonIgnore] 20 | public SegmentModel Segment { get; set; } 21 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V5/RolloutPercentageItem.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V5 5 | { 6 | public class RolloutPercentageItem 7 | { 8 | [JsonPropertyName("o")] 9 | public short Order { get; set; } 10 | 11 | [JsonPropertyName("v")] 12 | public JsonElement Value { get; set; } 13 | 14 | [JsonPropertyName("p")] 15 | public int Percentage { get; set; } 16 | 17 | [JsonPropertyName("i")] 18 | public string VariationId { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Scan/Reference.cs: -------------------------------------------------------------------------------- 1 | using ConfigCat.Cli.Models.Api; 2 | using System.Collections.Generic; 3 | 4 | namespace ConfigCat.Cli.Models.Scan 5 | { 6 | public class Reference 7 | { 8 | public string MatchedSample { get; set; } 9 | 10 | public FlagModel FoundFlag { get; set; } 11 | 12 | public List PreLines { get; set; } = new List(); 13 | 14 | public List PostLines { get; set; } = new List(); 15 | 16 | public Line ReferenceLine { get; set; } 17 | 18 | public bool IsAlias { get; set; } 19 | } 20 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/SegmentV6.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V6 5 | { 6 | public class SegmentV6 7 | { 8 | /// 9 | /// The first 4 characters of the Segment's name 10 | /// 11 | [JsonPropertyName("n")] 12 | public string Name { get; set; } 13 | 14 | /// 15 | /// Segment rule conditions (AND) 16 | /// 17 | [JsonPropertyName("r")] 18 | public List SegmentRules { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/ConfigCat.Cli.Services.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | latest 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/TargetingRuleV6.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V6 5 | { 6 | public class TargetingRuleV6 7 | { 8 | /// 9 | /// Targeting rule conditions (AND stuff) 10 | /// 11 | [JsonPropertyName("c")] 12 | public List Conditions { get; set; } 13 | 14 | [JsonPropertyName("s")] 15 | public ValueAndVariationIdV6 ServedValue { get; set; } 16 | 17 | [JsonPropertyName("p")] 18 | public List PercentageOptions { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/EvalResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace ConfigCat.Cli.Models; 5 | 6 | public class EvalResult 7 | { 8 | public required object Value { get; init; } 9 | 10 | public required string VariationId { get; init; } 11 | 12 | public required DateTime FetchTime { get; init; } 13 | 14 | public required IReadOnlyDictionary User { get; init; } 15 | 16 | public required bool IsDefaultValue { get; init; } 17 | 18 | public required int ErrorCode { get; init; } 19 | 20 | public required string ErrorMessage { get; init; } 21 | 22 | public required bool TargetingMatch { get; init; } 23 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/FlagValueModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.Api; 5 | 6 | public class FlagValueModel 7 | { 8 | public const string TargetingRuleJsonName = "rolloutRules"; 9 | 10 | public const string PercentageRuleJsonName = "rolloutPercentageItems"; 11 | 12 | public FlagModel Setting { get; set; } 13 | 14 | [JsonPropertyName(PercentageRuleJsonName)] 15 | public List PercentageRules { get; set; } 16 | 17 | [JsonPropertyName(TargetingRuleJsonName)] 18 | public List TargetingRules { get; set; } 19 | 20 | public object Value { get; set; } 21 | } -------------------------------------------------------------------------------- /docs/configcat-tag-rm.md: -------------------------------------------------------------------------------- 1 | # configcat tag rm 2 | Remove a Tag identified by the `--tag-id` option 3 | ## Usage 4 | ``` 5 | configcat tag rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat tag rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--tag-id`, `-i` | ID of the Tag to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat tag](configcat-tag.md) | Manage Tags | 22 | -------------------------------------------------------------------------------- /docs/configcat-product-ls.md: -------------------------------------------------------------------------------- 1 | # configcat product ls 2 | List all Products that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat product ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat product ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--json` | Format the output in JSON | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat product](configcat-product.md) | Manage Products | 22 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V5/SettingV5.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V5 5 | { 6 | public class SettingV5 7 | { 8 | [JsonPropertyName("v")] 9 | public JsonElement Value { get; set; } 10 | 11 | [JsonPropertyName("t")] 12 | public SettingType? SettingType { get; set; } 13 | 14 | [JsonPropertyName("p")] 15 | public RolloutPercentageItem[] RolloutPercentageItems { get; set; } 16 | 17 | [JsonPropertyName("r")] 18 | public RolloutRuleV5[] RolloutRules { get; set; } 19 | 20 | [JsonPropertyName("i")] 21 | public string VariationId { get; set; } 22 | } 23 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/CreateFlagModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.Api; 5 | 6 | public class CreateFlagModel 7 | { 8 | public string Key { get; set; } 9 | 10 | public string Name { get; set; } 11 | 12 | public string Hint { get; set; } 13 | 14 | [JsonPropertyName("settingType")] 15 | public string Type { get; set; } 16 | 17 | [JsonPropertyName("tags")] 18 | public IEnumerable TagIds { get; set; } 19 | 20 | public IEnumerable InitialValues { get; set; } 21 | } 22 | 23 | public class InitialValue 24 | { 25 | public string EnvironmentId { get; set; } 26 | 27 | public object Value { get; set; } 28 | } -------------------------------------------------------------------------------- /docs/configcat-config-rm.md: -------------------------------------------------------------------------------- 1 | # configcat config rm 2 | Remove a Config identified by the `--config-id` option 3 | ## Usage 4 | ``` 5 | configcat config rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat config rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--config-id`, `-i` | ID of the Config to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat config](configcat-config.md) | Manage Configs | 22 | -------------------------------------------------------------------------------- /docs/configcat-tag-ls.md: -------------------------------------------------------------------------------- 1 | # configcat tag ls 2 | List all Tags that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat tag ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat tag ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's tags | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat tag](configcat-tag.md) | Manage Tags | 23 | -------------------------------------------------------------------------------- /docs/configcat-product-rm.md: -------------------------------------------------------------------------------- 1 | # configcat product rm 2 | Remove a Product identified by the `--product-id` option 3 | ## Usage 4 | ``` 5 | configcat product rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat product rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-i` | ID of the Product to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat product](configcat-product.md) | Manage Products | 22 | -------------------------------------------------------------------------------- /docs/configcat-segment-rm.md: -------------------------------------------------------------------------------- 1 | # configcat segment rm 2 | Remove a Segment identified by the `--segment-id` option 3 | ## Usage 4 | ``` 5 | configcat segment rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat segment rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--segment-id`, `-i` | ID of the Segment to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat segment](configcat-segment.md) | Manage Segments | 22 | -------------------------------------------------------------------------------- /docs/configcat-webhook-rm.md: -------------------------------------------------------------------------------- 1 | # configcat webhook rm 2 | Remove a Webhook identified by the `--webhook-id` option 3 | ## Usage 4 | ``` 5 | configcat webhook rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat webhook rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--webhook-id`, `-i` | ID of the Webhook to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 22 | -------------------------------------------------------------------------------- /docs/configcat-workspace-clr.md: -------------------------------------------------------------------------------- 1 | # configcat workspace clr 2 | Clear the workspace 3 | ## Usage 4 | ``` 5 | configcat workspace clr 6 | ``` 7 | ## Example 8 | ``` 9 | configcat workspace clr 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 15 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 16 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 17 | ## Parent Command 18 | | Command | Description | 19 | | ------ | ----------- | 20 | | [configcat workspace](configcat-workspace.md) | Manage the CLI workspace. When set, the CLI's interactive mode filters Product and Config selectors by the values set in the workspace | 21 | -------------------------------------------------------------------------------- /choco/VERIFICATION.txt: -------------------------------------------------------------------------------- 1 | VERIFICATION 2 | Verification is intended to assist the Chocolatey moderators and community 3 | in verifying that this package's contents are trustworthy. 4 | 5 | This package is published and maintained by ConfigCat. 6 | 7 | Steps to verify the checksum of the standalone executable (configcat.exe) included: 8 | - Download the zipped executable from the official release page and extract it. 9 | The URL of this version: https://github.com/configcat/cli/releases/download/v#VERSION_PLACEHOLDER#/configcat-cli_#VERSION_PLACEHOLDER#_win-x64.zip 10 | - Execute the 'Get-FileHash' PowerShell command on the extracted 'configcat.exe' to obtain the checksum. 11 | - The printed hash must match with the checksum value for 'configcat.exe' showed on this package's Chocolatey page. -------------------------------------------------------------------------------- /docs/configcat-config-ls.md: -------------------------------------------------------------------------------- 1 | # configcat config ls 2 | List all Configs that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat config ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat config ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Configs | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat config](configcat-config.md) | Manage Configs | 23 | -------------------------------------------------------------------------------- /docs/configcat-member-lsp.md: -------------------------------------------------------------------------------- 1 | # configcat member lsp 2 | List all Members that belongs to a Product 3 | ## Usage 4 | ``` 5 | configcat member lsp [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat member lsp -p 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Members | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat member](configcat-member.md) | Manage Members | 23 | -------------------------------------------------------------------------------- /docs/configcat-segment-ls.md: -------------------------------------------------------------------------------- 1 | # configcat segment ls 2 | List all Segments that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat segment ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat segment ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Segments | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat segment](configcat-segment.md) | Manage Segments | 23 | -------------------------------------------------------------------------------- /docs/configcat-webhook-ls.md: -------------------------------------------------------------------------------- 1 | # configcat webhook ls 2 | List all Webhooks that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat webhook ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat webhook ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Webhooks | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 23 | -------------------------------------------------------------------------------- /docs/configcat-webhook-show.md: -------------------------------------------------------------------------------- 1 | # configcat webhook show 2 | Print a Webhook identified by the `--webhook-id` option 3 | ## Aliases 4 | `sh`, `print` 5 | ## Usage 6 | ``` 7 | configcat webhook show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat webhook sh -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--webhook-id`, `-i` | ID of the Webhook | 17 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 18 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 19 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 20 | ## Parent Command 21 | | Command | Description | 22 | | ------ | ----------- | 23 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 24 | -------------------------------------------------------------------------------- /docs/configcat-flag-rm.md: -------------------------------------------------------------------------------- 1 | # configcat flag rm 2 | Remove a Feature Flag or Setting identified by the `--flag-id` option 3 | ## Usage 4 | ``` 5 | configcat flag rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat flag rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 22 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/FileSystem/Ignore/GlobalIgnorePolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using Ignore; 4 | 5 | namespace ConfigCat.Cli.Services.FileSystem.Ignore; 6 | 7 | internal class GlobalIgnorePolicy : IgnorePolicy 8 | { 9 | private readonly DirectoryInfo rootDirectory; 10 | 11 | public GlobalIgnorePolicy(DirectoryInfo rootDirectory, params string[] patterns) 12 | { 13 | this.rootDirectory = rootDirectory; 14 | foreach (var pattern in patterns) 15 | base.DenyRules.Add(new IgnoreRule(pattern)); 16 | } 17 | 18 | public override bool Handles(FileInfo file) => true; 19 | 20 | protected override string PreProcessFilePath(FileInfo file) => 21 | Path.GetRelativePath(this.rootDirectory.FullName, file.FullName).WithSlashes(); 22 | } -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Api/MeClient.cs: -------------------------------------------------------------------------------- 1 | using ConfigCat.Cli.Models.Api; 2 | using ConfigCat.Cli.Models.Configuration; 3 | using ConfigCat.Cli.Services.Rendering; 4 | using System.Net.Http; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using Trybot; 8 | 9 | namespace ConfigCat.Cli.Services.Api; 10 | 11 | public interface IMeClient 12 | { 13 | Task GetMeAsync(CancellationToken token); 14 | } 15 | 16 | public class MeClient( 17 | IOutput output, 18 | CliConfig config, 19 | IBotPolicy botPolicy, 20 | HttpClient httpClient) 21 | : ApiClient(output, config, botPolicy, httpClient), IMeClient 22 | { 23 | public Task GetMeAsync(CancellationToken token) => 24 | this.GetAsync(HttpMethod.Get, "v1/me", token); 25 | } -------------------------------------------------------------------------------- /docs/configcat-member-lsip.md: -------------------------------------------------------------------------------- 1 | # configcat member lsip 2 | List all pending Invitations that belongs to a Product 3 | ## Usage 4 | ``` 5 | configcat member lsip [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat member lsip -p 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Members | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat member](configcat-member.md) | Manage Members | 23 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V5/RolloutRuleV5.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V5 5 | { 6 | public class RolloutRuleV5 7 | { 8 | [JsonPropertyName("o")] 9 | public short Order { get; set; } 10 | 11 | [JsonPropertyName("a")] 12 | public string ComparisonAttribute { get; set; } 13 | 14 | [JsonPropertyName("t")] 15 | public RolloutRuleComparator Comparator { get; set; } 16 | 17 | [JsonPropertyName("c")] 18 | public string ComparisonValue { get; set; } 19 | 20 | [JsonPropertyName("v")] 21 | public JsonElement Value { get; set; } 22 | 23 | [JsonPropertyName("i")] 24 | public string VariationId { get; set; } 25 | } 26 | } -------------------------------------------------------------------------------- /docs/configcat-environment-rm.md: -------------------------------------------------------------------------------- 1 | # configcat environment rm 2 | Remove an Environment identified by the `--environment-id` option 3 | ## Usage 4 | ``` 5 | configcat environment rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat environment rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--environment-id`, `-i` | ID of the Environment to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat environment](configcat-environment.md) | Manage Environments | 22 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-rm.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 rm 2 | Remove a Feature Flag or Setting identified by the `--flag-id` option 3 | ## Usage 4 | ``` 5 | configcat flag-v2 rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat flag rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 22 | -------------------------------------------------------------------------------- /docs/configcat-member-lso.md: -------------------------------------------------------------------------------- 1 | # configcat member lso 2 | List all Members that belongs to an Organization 3 | ## Usage 4 | ``` 5 | configcat member lso [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat member lso -o 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--organization-id`, `-o` | Show only an Organization's Members | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat member](configcat-member.md) | Manage Members | 23 | -------------------------------------------------------------------------------- /docs/configcat-environment-ls.md: -------------------------------------------------------------------------------- 1 | # configcat environment ls 2 | List all Environments that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat environment ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat environment ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Environments | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat environment](configcat-environment.md) | Manage Environments | 23 | -------------------------------------------------------------------------------- /docs/configcat-member-lsio.md: -------------------------------------------------------------------------------- 1 | # configcat member lsio 2 | List all pending Invitations that belongs to an Organization 3 | ## Usage 4 | ``` 5 | configcat member lsio [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat member lsio -o 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--organization-id`, `-o` | Show only an Organization's Members | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat member](configcat-member.md) | Manage Members | 23 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/ConditionV6.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ConfigCat.Cli.Models.ConfigFile.V6 4 | { 5 | public class ConditionV6 6 | { 7 | /// 8 | /// Classic targeting rule 9 | /// 10 | [JsonPropertyName("u")] 11 | public ComparisonRuleV6 UserCondition { get; set; } 12 | 13 | /// 14 | /// Segment targeting rule 15 | /// 16 | [JsonPropertyName("s")] 17 | public SegmentConditionV6 SegmentCondition { get; set; } 18 | 19 | /// 20 | /// Prerequisite targeting rule 21 | /// 22 | [JsonPropertyName("p")] 23 | public PrerequisiteFlagConditionV6 PrerequisiteFlagCondition { get; set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/configcat-workspace-show.md: -------------------------------------------------------------------------------- 1 | # configcat workspace show 2 | Show the values saved in the workspace 3 | ## Aliases 4 | `sh`, `p`, `print` 5 | ## Usage 6 | ``` 7 | configcat workspace show 8 | ``` 9 | ## Example 10 | ``` 11 | configcat workspace show 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat workspace](configcat-workspace.md) | Manage the CLI workspace. When set, the CLI's interactive mode filters Product and Config selectors by the values set in the workspace | 23 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/FileSystem/Ignore/IgnorePolicy.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using Ignore; 6 | 7 | namespace ConfigCat.Cli.Services.FileSystem.Ignore; 8 | 9 | internal abstract class IgnorePolicy 10 | { 11 | protected readonly List AcceptRules = []; 12 | protected readonly List DenyRules = []; 13 | 14 | public bool IsAccepting(FileInfo file) => AcceptRules.Any(rule => rule.IsMatch(PreProcessFilePath(file))); 15 | 16 | public bool IsIgnoring(FileInfo file) => DenyRules.Any(rule => rule.IsMatch(PreProcessFilePath(file))); 17 | 18 | public abstract bool Handles(FileInfo file); 19 | 20 | protected abstract string PreProcessFilePath(FileInfo file); 21 | 22 | public int Rank { get; protected init; } 23 | } -------------------------------------------------------------------------------- /docs/configcat-member-rm.md: -------------------------------------------------------------------------------- 1 | # configcat member rm 2 | Remove Member from an Organization 3 | ## Usage 4 | ``` 5 | configcat member rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat member rm -o -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--organization-id`, `-o` | The Organization's ID from where the Member must be removed | 15 | | `--user-id`, `-i` | ID of the Member to remove | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat member](configcat-member.md) | Manage Members | 23 | -------------------------------------------------------------------------------- /docs/configcat-webhook-headers-rm.md: -------------------------------------------------------------------------------- 1 | # configcat webhook headers rm 2 | Remove header 3 | ## Usage 4 | ``` 5 | configcat webhook headers rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat webhook headers rm -i -k Authorization 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--webhook-id`, `-i` | ID of the Webhook to update | 15 | | `--key`, `-k` | The Webhook header's key | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat webhook headers](configcat-webhook-headers.md) | Manage Webhook headers | 23 | -------------------------------------------------------------------------------- /docs/configcat-segment-show.md: -------------------------------------------------------------------------------- 1 | # configcat segment show 2 | Show details of a Segment identified by the `--segment-id` option 3 | ## Aliases 4 | `sh`, `pr`, `print` 5 | ## Usage 6 | ``` 7 | configcat segment show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat segment show -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--segment-id`, `-i` | ID of the Segment | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat segment](configcat-segment.md) | Manage Segments | 25 | -------------------------------------------------------------------------------- /docs/configcat-tag-update.md: -------------------------------------------------------------------------------- 1 | # configcat tag update 2 | Update a Tag identified by the `--tag-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat tag update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat tag update -i -n "temp_tag" 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--tag-id`, `-i` | ID of the Tag to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--color`, `-c` | The updated color | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat tag](configcat-tag.md) | Manage Tags | 26 | -------------------------------------------------------------------------------- /docs/configcat-ls.md: -------------------------------------------------------------------------------- 1 | # configcat ls 2 | List all Product, Config, and Environment IDs 3 | ## Usage 4 | ``` 5 | configcat ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--json` | Format the output in JSON | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat](index.md) | This is the Command Line Tool of ConfigCat.
ConfigCat is a hosted feature flag service: https://configcat.com
For more information, see the documentation here: https://configcat.com/docs/advanced/cli | 22 | -------------------------------------------------------------------------------- /docs/configcat-permission-group-rm.md: -------------------------------------------------------------------------------- 1 | # configcat permission-group rm 2 | Remove a Permission Group identified by the `--permission-group-id` option 3 | ## Usage 4 | ``` 5 | configcat permission-group rm [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat permission-group rm -i 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--permission-group-id`, `-i` | ID of the Permission Group to delete | 15 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 16 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 17 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 18 | ## Parent Command 19 | | Command | Description | 20 | | ------ | ----------- | 21 | | [configcat permission-group](configcat-permission-group.md) | Manage Permission Groups | 22 | -------------------------------------------------------------------------------- /docs/configcat-permission-group-ls.md: -------------------------------------------------------------------------------- 1 | # configcat permission-group ls 2 | List all Permission Groups that manageable by the configured user 3 | ## Usage 4 | ``` 5 | configcat permission-group ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat permission-group ls 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--product-id`, `-p` | Show only a Product's Permission Groups | 15 | | `--json` | Format the output in JSON | 16 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 17 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 18 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 19 | ## Parent Command 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat permission-group](configcat-permission-group.md) | Manage Permission Groups | 23 | -------------------------------------------------------------------------------- /docs/configcat-flag-attach.md: -------------------------------------------------------------------------------- 1 | # configcat flag attach 2 | Attach Tag(s) to a Feature Flag or Setting 3 | ## Aliases 4 | `at` 5 | ## Usage 6 | ``` 7 | configcat flag attach [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag attach -i -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to attach Tags | 17 | | `--tag-ids`, `-g` | Tag IDs to attach | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /docs/configcat-flag-detach.md: -------------------------------------------------------------------------------- 1 | # configcat flag detach 2 | Detach Tag(s) from a Feature Flag or Setting 3 | ## Aliases 4 | `dt` 5 | ## Usage 6 | ``` 7 | configcat flag detach [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag detach -i -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to detach Tags | 17 | | `--tag-ids`, `-g` | Tag IDs to detach | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/ConfigFile/V6/ComparisonRuleV6.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace ConfigCat.Cli.Models.ConfigFile.V6 5 | { 6 | public class ComparisonRuleV6 7 | { 8 | /// 9 | /// The attribute of the user object that should be used to evaluate this rule 10 | /// 11 | [JsonPropertyName("a")] 12 | public string ComparisonAttribute { get; set; } 13 | 14 | [JsonPropertyName("c")] 15 | public UserComparator Comparator { get; set; } 16 | 17 | [JsonPropertyName("s")] 18 | public string StringValue { get; set; } 19 | 20 | [JsonPropertyName("d")] 21 | public double? DoubleValue { get; set; } 22 | 23 | [JsonPropertyName("l")] 24 | public List StringListValue { get; set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/configcat-product-preferences-show.md: -------------------------------------------------------------------------------- 1 | # configcat product preferences show 2 | Show a Product's preferences 3 | ## Aliases 4 | `sh`, `print` 5 | ## Usage 6 | ``` 7 | configcat product preferences show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat product preferences show -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--product-id`, `-i` | ID of the Product | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat product preferences](configcat-product-preferences.md) | Manage Product preferences | 25 | -------------------------------------------------------------------------------- /docs/configcat-webhook-headers.md: -------------------------------------------------------------------------------- 1 | # configcat webhook headers 2 | Manage Webhook headers 3 | ## Aliases 4 | `he` 5 | ## Usage 6 | ``` 7 | configcat webhook headers [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat webhook headers add](configcat-webhook-headers-add.md) | Add new header | 23 | | [configcat webhook headers rm](configcat-webhook-headers-rm.md) | Remove header | 24 | -------------------------------------------------------------------------------- /test/ConfigCat.Cli.Tests/GitClientTests.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Threading.Tasks; 3 | using ConfigCat.Cli.Models; 4 | using ConfigCat.Cli.Services.Git; 5 | using ConfigCat.Cli.Services.Rendering; 6 | using Xunit; 7 | 8 | namespace ConfigCat.Cli.Tests; 9 | 10 | public class GitClientTests 11 | { 12 | [Fact] 13 | public async Task Test_GitClient() 14 | { 15 | var client = new GitClient(new Output(new CliOptions())); 16 | var executingDir = new DirectoryInfo(Directory.GetCurrentDirectory()); 17 | var info = await client.GetRepoDetailsOrNull(executingDir); 18 | var repoDir = await client.GetRepoRootDirectoryOrNull(executingDir); 19 | 20 | Assert.NotEmpty(repoDir.FullName); 21 | Assert.NotEmpty(info.Branch); 22 | Assert.NotEmpty(info.ActiveBranches); 23 | Assert.NotEmpty(info.CurrentCommitHash); 24 | } 25 | } -------------------------------------------------------------------------------- /docs/configcat-flag-v2-attach.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 attach 2 | Attach Tag(s) to a Feature Flag or Setting 3 | ## Aliases 4 | `at` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 attach [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag attach -i -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to attach Tags | 17 | | `--tag-ids`, `-g` | Tag IDs to attach | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-detach.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 detach 2 | Detach Tag(s) from a Feature Flag or Setting 3 | ## Aliases 4 | `dt` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 detach [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag detach -i -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to detach Tags | 17 | | `--tag-ids`, `-g` | Tag IDs to detach | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /docs/configcat-tag-create.md: -------------------------------------------------------------------------------- 1 | # configcat tag create 2 | Create a new Tag in a specified Product identified by the `--product-id` option 3 | ## Aliases 4 | `cr` 5 | ## Usage 6 | ``` 7 | configcat tag create [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat tag create -n "temp_tag" 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--product-id`, `-p` | ID of the Product where the Tag must be created | 17 | | `--name`, `-n` | The name of the new Tag | 18 | | `--color`, `-c` | The color of the new Tag | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat tag](configcat-tag.md) | Manage Tags | 26 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Utilities/TokenGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | 4 | namespace ConfigCat.Cli.Services.Utilities 5 | { 6 | public interface ITokenGenerator 7 | { 8 | string GenerateTokenString(int length); 9 | 10 | byte[] GenerateToken(int length); 11 | } 12 | 13 | public class TokenGenerator(RandomNumberGenerator randomNumberGenerator) : ITokenGenerator 14 | { 15 | public byte[] GenerateToken(int length) 16 | { 17 | var bytes = new byte[length]; 18 | randomNumberGenerator.GetBytes(bytes); 19 | return bytes; 20 | } 21 | 22 | public string GenerateTokenString(int length) 23 | { 24 | var bytes = new byte[length]; 25 | randomNumberGenerator.GetBytes(bytes); 26 | return Convert.ToBase64String(bytes); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /docs/configcat-flag-ls.md: -------------------------------------------------------------------------------- 1 | # configcat flag ls 2 | List all Feature Flags & Settings that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat flag ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat flag ls -n my_tag 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--config-id`, `-c` | Show only a Config's Flags & Settings | 15 | | `--tag-name`, `-n` | Filter by a Tag's name | 16 | | `--tag-id`, `-t` | Filter by a Tag's ID | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /.github/workflows/publish-net-tool.yml: -------------------------------------------------------------------------------- 1 | name: ConfigCat CLI Publish as .NET Tool 2 | 3 | on: 4 | push: 5 | tags: ['v[0-9]+.[0-9]+.[0-9]+'] 6 | 7 | workflow_dispatch: 8 | 9 | jobs: 10 | nuget: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v6 14 | - name: Setup dotnet 15 | uses: actions/setup-dotnet@v5 16 | with: 17 | dotnet-version: '8.0.x' 18 | 19 | - name: Get version from tag 20 | run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV 21 | 22 | - name: Pack 23 | run: | 24 | dotnet pack src/ConfigCat.Cli/ConfigCat.Cli.csproj -c Release -p:Version=${{ env.VERSION }} -o publish/nuget -p:NetToolPack=true 25 | 26 | - name: Publish to NuGet.org 27 | run: dotnet nuget push publish/nuget/configcat-cli.${{ env.VERSION }}.nupkg -k ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json -------------------------------------------------------------------------------- /docs/configcat-config-update.md: -------------------------------------------------------------------------------- 1 | # configcat config update 2 | Update a Config identified by the `--config-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat config update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat config update -i -n "NewConfig" -d "Config description" 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--config-id`, `-i` | ID of the Config to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--description`, `-d` | The updated description | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat config](configcat-config.md) | Manage Configs | 26 | -------------------------------------------------------------------------------- /docs/configcat-workspace-set.md: -------------------------------------------------------------------------------- 1 | # configcat workspace set 2 | Set the workspace 3 | ## Aliases 4 | `s` 5 | ## Usage 6 | ``` 7 | configcat workspace set [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat workspace set -p -c 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--product-id`, `-p` | ID of the Product | 17 | | `--config-id`, `-c` | ID of the Config | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat workspace](configcat-workspace.md) | Manage the CLI workspace. When set, the CLI's interactive mode filters Product and Config selectors by the values set in the workspace | 25 | -------------------------------------------------------------------------------- /docs/configcat-flag-percentage.md: -------------------------------------------------------------------------------- 1 | # configcat flag percentage 2 | Manage percentage rules 3 | ## Aliases 4 | `%` 5 | ## Usage 6 | ``` 7 | configcat flag percentage [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat flag percentage update](configcat-flag-percentage-update.md) | Update percentage rules | 23 | | [configcat flag percentage clear](configcat-flag-percentage-clear.md) | Delete all percentage rules | 24 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-ls.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 ls 2 | List all Feature Flags & Settings that belongs to the configured user 3 | ## Usage 4 | ``` 5 | configcat flag-v2 ls [options] 6 | ``` 7 | ## Example 8 | ``` 9 | configcat flag ls -n my_tag 10 | ``` 11 | ## Options 12 | | Option | Description | 13 | | ------ | ----------- | 14 | | `--config-id`, `-c` | Show only a Config's Flags & Settings | 15 | | `--tag-name`, `-n` | Filter by a Tag's name | 16 | | `--tag-id`, `-t` | Filter by a Tag's ID | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 25 | -------------------------------------------------------------------------------- /docs/configcat-product-update.md: -------------------------------------------------------------------------------- 1 | # configcat product update 2 | Update a Product identified by the `--product-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat product update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat product update -i -n "My Product" -d "Product Description" 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--product-id`, `-i` | ID of the Product to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--description`, `-d` | The updated description | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat product](configcat-product.md) | Manage Products | 26 | -------------------------------------------------------------------------------- /docs/configcat-permission-group-show.md: -------------------------------------------------------------------------------- 1 | # configcat permission-group show 2 | Show details of a Permission Group identified by the `--permission-group-id` option 3 | ## Aliases 4 | `sh`, `pr`, `print` 5 | ## Usage 6 | ``` 7 | configcat permission-group show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat permission-group show -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--permission-group-id`, `-i` | ID of the Permission Group | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat permission-group](configcat-permission-group.md) | Manage Permission Groups | 25 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Api/SdkKeyClient.cs: -------------------------------------------------------------------------------- 1 | using ConfigCat.Cli.Models.Api; 2 | using ConfigCat.Cli.Models.Configuration; 3 | using ConfigCat.Cli.Services.Rendering; 4 | using System.Net.Http; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using Trybot; 8 | 9 | namespace ConfigCat.Cli.Services.Api; 10 | 11 | public interface ISdkKeyClient 12 | { 13 | Task GetSdkKeyAsync(string configId, string environmentId, CancellationToken token); 14 | } 15 | 16 | public class SdkKeyClient( 17 | IOutput output, 18 | CliConfig config, 19 | IBotPolicy botPolicy, 20 | HttpClient httpClient) 21 | : ApiClient(output, config, botPolicy, httpClient), ISdkKeyClient 22 | { 23 | public Task GetSdkKeyAsync(string configId, string environmentId, CancellationToken token) => 24 | this.GetAsync(HttpMethod.Get, $"v1/configs/{configId}/environments/{environmentId}", token); 25 | } -------------------------------------------------------------------------------- /docs/configcat-product-preferences.md: -------------------------------------------------------------------------------- 1 | # configcat product preferences 2 | Manage Product preferences 3 | ## Aliases 4 | `pr` 5 | ## Usage 6 | ``` 7 | configcat product preferences [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat product](configcat-product.md) | Manage Products | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat product preferences show](configcat-product-preferences-show.md) | Show a Product's preferences | 23 | | [configcat product preferences update](configcat-product-preferences-update.md) | Update a Product's preferences | 24 | -------------------------------------------------------------------------------- /docs/configcat-flag-value-show.md: -------------------------------------------------------------------------------- 1 | # configcat flag value show 2 | Show Feature Flag or Setting values, targeting, and percentage rules for each environment 3 | ## Aliases 4 | `sh`, `pr`, `print` 5 | ## Usage 6 | ``` 7 | configcat flag value show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag value show -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag value](configcat-flag-value.md) | Manage Feature Flag & Setting values in different Environments | 25 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Services/Api/OrganizationClient.cs: -------------------------------------------------------------------------------- 1 | using ConfigCat.Cli.Models.Api; 2 | using ConfigCat.Cli.Models.Configuration; 3 | using ConfigCat.Cli.Services.Rendering; 4 | using System.Collections.Generic; 5 | using System.Net.Http; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using Trybot; 9 | 10 | namespace ConfigCat.Cli.Services.Api; 11 | 12 | public interface IOrganizationClient 13 | { 14 | Task> GetOrganizationsAsync(CancellationToken token); 15 | } 16 | 17 | public class OrganizationClient( 18 | IOutput output, 19 | CliConfig config, 20 | IBotPolicy botPolicy, 21 | HttpClient httpClient) 22 | : ApiClient(output, config, botPolicy, httpClient), IOrganizationClient 23 | { 24 | public Task> GetOrganizationsAsync(CancellationToken token) => 25 | this.GetAsync>(HttpMethod.Get, "v1/organizations", token); 26 | } -------------------------------------------------------------------------------- /docs/configcat-environment-update.md: -------------------------------------------------------------------------------- 1 | # configcat environment update 2 | Update environment 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat environment update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat environment update -i -n Test -d "Test Environment" -c #7D3C98 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--environment-id`, `-i` | ID of the environment to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--description`, `-d` | The updated description | 19 | | `--color`, `-c` | The updated color | 20 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 21 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 22 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 23 | ## Parent Command 24 | | Command | Description | 25 | | ------ | ----------- | 26 | | [configcat environment](configcat-environment.md) | Manage Environments | 27 | -------------------------------------------------------------------------------- /docs/configcat-product-preferences-update-env.md: -------------------------------------------------------------------------------- 1 | # configcat product preferences update env 2 | Update per-environment required reason 3 | ## Aliases 4 | `e` 5 | ## Usage 6 | ``` 7 | configcat product preferences update env [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat product preferences update env -i -ei :true 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--product-id`, `-i` | ID of the Product | 17 | | `--environments`, `-ei` | Format: `:`. | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat product preferences update](configcat-product-preferences-update.md) | Update a Product's preferences | 25 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-value-show.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 value show 2 | Show Feature Flag or Setting values, targeting, and percentage rules for each environment 3 | ## Aliases 4 | `sh`, `pr`, `print` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 value show [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag-v2 value show -i 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting | 17 | | `--json` | Format the output in JSON | 18 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 19 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 20 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 21 | ## Parent Command 22 | | Command | Description | 23 | | ------ | ----------- | 24 | | [configcat flag-v2 value](configcat-flag-v2-value.md) | Manage V2 Feature Flag & Setting default values in different Environments | 25 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: configcat 2 | version: '#VERSION_PLACEHOLDER#' 3 | base: core20 4 | summary: Command Line Interface for ConfigCat 5 | description: | 6 | The ConfigCat Command Line Interface allows you to interact with the ConfigCat Management API via the command line. 7 | It supports most functionality found on the ConfigCat Dashboard. You can manage ConfigCat 8 | resources like Feature Flags, Targeting / Percentage rules, Products, Configs, Environments, and more. 9 | license: MIT 10 | 11 | grade: stable 12 | confinement: strict 13 | 14 | parts: 15 | configcat: 16 | plugin: dump 17 | source: linux-x64/ 18 | organize: 19 | configcat: bin/ 20 | stage: 21 | - bin/configcat 22 | - LICENSE 23 | - README.md 24 | override-build: | 25 | cd $SNAPCRAFT_PART_BUILD 26 | chmod +x configcat 27 | snapcraftctl build 28 | 29 | apps: 30 | configcat: 31 | command: bin/configcat 32 | plugs: 33 | - home 34 | - network 35 | -------------------------------------------------------------------------------- /docs/configcat-member-add-permission.md: -------------------------------------------------------------------------------- 1 | # configcat member add-permission 2 | Add Member to Permission Groups 3 | ## Aliases 4 | `a` 5 | ## Usage 6 | ``` 7 | configcat member add-permission [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat member add-permission -o -i -pgi 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--organization-id`, `-o` | ID of the Organization | 17 | | `--user-id`, `-i` | ID of the Member to add | 18 | | `--permission-group-ids`, `-pgi` | Permission Group IDs the Member must be put into | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat member](configcat-member.md) | Manage Members | 26 | -------------------------------------------------------------------------------- /docs/configcat-flag-value.md: -------------------------------------------------------------------------------- 1 | # configcat flag value 2 | Manage Feature Flag & Setting values in different Environments 3 | ## Aliases 4 | `v` 5 | ## Usage 6 | ``` 7 | configcat flag value [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat flag value show](configcat-flag-value-show.md) | Show Feature Flag or Setting values, targeting, and percentage rules for each environment | 23 | | [configcat flag value update](configcat-flag-value-update.md) | Update the value of a Feature Flag or Setting | 24 | -------------------------------------------------------------------------------- /docs/configcat-member-rm-permission.md: -------------------------------------------------------------------------------- 1 | # configcat member rm-permission 2 | Remove Member from Permission Groups 3 | ## Aliases 4 | `rmp` 5 | ## Usage 6 | ``` 7 | configcat member rm-permission [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat member rm-permission -o -i -pgi 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--organization-id`, `-o` | ID of the Organization | 17 | | `--user-id`, `-i` | ID of the Member to remove | 18 | | `--permission-group-ids`, `-pgi` | Permission Group IDs the Member must be removed from | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat member](configcat-member.md) | Manage Members | 26 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-targeting-condition.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 targeting condition 2 | Manage conditions 3 | ## Aliases 4 | `c` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 targeting condition [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat flag-v2 targeting](configcat-flag-v2-targeting.md) | Manage V2 Feature Flag & Setting targeting options | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat flag-v2 targeting condition add](configcat-flag-v2-targeting-condition-add.md) | Add new condition | 23 | | [configcat flag-v2 targeting condition rm](configcat-flag-v2-targeting-condition-rm.md) | Remove condition | 24 | -------------------------------------------------------------------------------- /docs/configcat-product-create.md: -------------------------------------------------------------------------------- 1 | # configcat product create 2 | Create a new Product in a specified Organization identified by the `--organization-id` option 3 | ## Aliases 4 | `cr` 5 | ## Usage 6 | ``` 7 | configcat product create [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat product create -o -n "My Product" -d "Product Description" 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--organization-id`, `-o` | The Organization's ID where the Product must be created | 17 | | `--name`, `-n` | Name of the new Product | 18 | | `--description`, `-d` | Description of the new Product | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat product](configcat-product.md) | Manage Products | 26 | -------------------------------------------------------------------------------- /docs/configcat-sdk-key.md: -------------------------------------------------------------------------------- 1 | # configcat sdk-key 2 | List SDK Keys 3 | ## Aliases 4 | `k` 5 | ## Usage 6 | ``` 7 | configcat sdk-key [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat sdk-key 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--environment-id`, `-e` | (Optional) Filter for the SDK key's environment | 17 | | `--config-id`, `-c` | (Optional) Filter for the SDK key's config | 18 | | `--json` | Format the output in JSON | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat](index.md) | This is the Command Line Tool of ConfigCat.
ConfigCat is a hosted feature flag service: https://configcat.com
For more information, see the documentation here: https://configcat.com/docs/advanced/cli | 26 | -------------------------------------------------------------------------------- /docs/configcat-webhook-update.md: -------------------------------------------------------------------------------- 1 | # configcat webhook update 2 | Update a Webhook identified by the `--webhook-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat webhook update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat webhook update -i -u "https://example.com/hook" -m get 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--webhook-id`, `-i` | ID of the Webhook to update | 17 | | `--url`, `-u` | The Webhook's URL | 18 | | `--http-method`, `-m` | The Webhook's HTTP method

*Possible values*: `get`, `post` | 19 | | `--content`, `-co` | The Webhook's HTTP body | 20 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 21 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 22 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 23 | ## Parent Command 24 | | Command | Description | 25 | | ------ | ----------- | 26 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 27 | -------------------------------------------------------------------------------- /brew/fromula-template.rb: -------------------------------------------------------------------------------- 1 | class Configcat < Formula 2 | desc "The ConfigCat Command Line Interface allows you to interact with the ConfigCat Management API via the command line. It supports most functionality found on the ConfigCat Dashboard. You can manage ConfigCat resources like Feature Flags, Targeting / Percentage rules, Products, Configs, Environments, and more." 3 | homepage "https://configcat.com" 4 | version "#VERSION_PLACEHOLDER#" 5 | license "MIT" 6 | 7 | if OS.mac? && Hardware::CPU.intel? 8 | url "#OSX-TAR-PATH#" 9 | sha256 "#OSX-TAR-SUM#" 10 | end 11 | if OS.mac? && Hardware::CPU.arm? 12 | url "#OSX-ARM-TAR-PATH#" 13 | sha256 "#OSX-ARM-TAR-SUM#" 14 | end 15 | if OS.linux? && Hardware::CPU.intel? 16 | url "#LINUX-TAR-PATH#" 17 | sha256 "#LINUX-TAR-SUM#" 18 | end 19 | 20 | def install 21 | bin.install "configcat" 22 | end 23 | 24 | test do 25 | assert_match "#VERSION_PLACEHOLDER#", shell_output("#{bin}/configcat --version") 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /docs/configcat-webhook-headers-add.md: -------------------------------------------------------------------------------- 1 | # configcat webhook headers add 2 | Add new header 3 | ## Aliases 4 | `a` 5 | ## Usage 6 | ``` 7 | configcat webhook headers add [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat webhook headers add -i -k Authorization -val "Bearer ..." --secure 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--webhook-id`, `-i` | ID of the Webhook to update | 17 | | `--key`, `-k` | The Webhook header's key | 18 | | `--value`, `-val` | The Webhook header's value | 19 | | `--secure`, `-s` | If it's true, the Webhook header's value will kept as a secret | 20 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 21 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 22 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 23 | ## Parent Command 24 | | Command | Description | 25 | | ------ | ----------- | 26 | | [configcat webhook headers](configcat-webhook-headers.md) | Manage Webhook headers | 27 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli.Models/Api/ProductModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace ConfigCat.Cli.Models.Api; 4 | 5 | public class ProductModel 6 | { 7 | public OrganizationModel Organization { get; set; } 8 | 9 | public string ProductId { get; set; } 10 | 11 | public string Name { get; set; } 12 | 13 | public string Description { get; set; } 14 | 15 | public int Order { get; set; } 16 | } 17 | 18 | public class ProductPreferencesModel 19 | { 20 | public bool ReasonRequired { get; set; } 21 | 22 | public string KeyGenerationMode { get; set; } 23 | 24 | public bool ShowVariationId { get; set; } 25 | 26 | public bool MandatorySettingHint { get; set; } 27 | 28 | public IEnumerable ReasonRequiredEnvironments { get; set; } 29 | } 30 | 31 | public class ReasonRequiredEnvironmentModel 32 | { 33 | public string EnvironmentId { get; set; } 34 | 35 | public bool ReasonRequired { get; set; } 36 | 37 | public string EnvironmentName { get; set; } 38 | } 39 | -------------------------------------------------------------------------------- /docs/configcat-flag-update.md: -------------------------------------------------------------------------------- 1 | # configcat flag update 2 | Update a Feature Flag or Setting identified by the `--flag-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat flag update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag update -i -n "My awesome flag" -H "This is the most awesome flag." -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--hint`, `-H` | The updated hint | 19 | | `--tag-ids`, `-g` | The updated Tag list | 20 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 21 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 22 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 23 | ## Parent Command 24 | | Command | Description | 25 | | ------ | ----------- | 26 | | [configcat flag](configcat-flag.md) | Manage Feature Flags & Settings | 27 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-value.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 value 2 | Manage V2 Feature Flag & Setting default values in different Environments 3 | ## Aliases 4 | `v` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 value [command] 8 | ``` 9 | ## Options 10 | | Option | Description | 11 | | ------ | ----------- | 12 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 13 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 14 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 15 | ## Parent Command 16 | | Command | Description | 17 | | ------ | ----------- | 18 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 19 | ## Subcommands 20 | | Command | Description | 21 | | ------ | ----------- | 22 | | [configcat flag-v2 value show](configcat-flag-v2-value-show.md) | Show Feature Flag or Setting values, targeting, and percentage rules for each environment | 23 | | [configcat flag-v2 value update](configcat-flag-v2-value-update.md) | Update the value of a Feature Flag or Setting | 24 | -------------------------------------------------------------------------------- /docs/configcat-webhook-create.md: -------------------------------------------------------------------------------- 1 | # configcat webhook create 2 | Create a new Webhook 3 | ## Aliases 4 | `cr` 5 | ## Usage 6 | ``` 7 | configcat webhook create [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat webhook create -c -e -u "https://example.com/hook" -m get 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--config-id`, `-c` | ID of the Config | 17 | | `--environment-id`, `-e` | ID of the Environment | 18 | | `--url`, `-u` | The Webhook's URL | 19 | | `--http-method`, `-m` | The Webhook's HTTP method

*Possible values*: `get`, `post` | 20 | | `--content`, `-co` | The Webhook's HTTP body | 21 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 22 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 23 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 24 | ## Parent Command 25 | | Command | Description | 26 | | ------ | ----------- | 27 | | [configcat webhook](configcat-webhook.md) | Manage Webhooks | 28 | -------------------------------------------------------------------------------- /docs/configcat-flag-v2-update.md: -------------------------------------------------------------------------------- 1 | # configcat flag-v2 update 2 | Update a Feature Flag or Setting identified by the `--flag-id` option 3 | ## Aliases 4 | `up` 5 | ## Usage 6 | ``` 7 | configcat flag-v2 update [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag update -i -n "My awesome flag" -H "This is the most awesome flag." -g 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting to update | 17 | | `--name`, `-n` | The updated name | 18 | | `--hint`, `-H` | The updated hint | 19 | | `--tag-ids`, `-g` | The updated Tag list | 20 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 21 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 22 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 23 | ## Parent Command 24 | | Command | Description | 25 | | ------ | ----------- | 26 | | [configcat flag-v2](configcat-flag-v2.md) | Manage V2 Feature Flags & Settings | 27 | -------------------------------------------------------------------------------- /docs/configcat-config-json.md: -------------------------------------------------------------------------------- 1 | # configcat config-json 2 | Config JSON-related utilities 3 | ## Usage 4 | ``` 5 | configcat config-json [command] 6 | ``` 7 | ## Options 8 | | Option | Description | 9 | | ------ | ----------- | 10 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 11 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 12 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 13 | ## Parent Command 14 | | Command | Description | 15 | | ------ | ----------- | 16 | | [configcat](index.md) | This is the Command Line Tool of ConfigCat.
ConfigCat is a hosted feature flag service: https://configcat.com
For more information, see the documentation here: https://configcat.com/docs/advanced/cli | 17 | ## Subcommands 18 | | Command | Description | 19 | | ------ | ----------- | 20 | | [configcat config-json convert](configcat-config-json-convert.md) | Convert between config JSON versions | 21 | | [configcat config-json get](configcat-config-json-get.md) | Download a config JSON from the CDN servers. | 22 | -------------------------------------------------------------------------------- /docs/configcat-flag-percentage-clear.md: -------------------------------------------------------------------------------- 1 | # configcat flag percentage clear 2 | Delete all percentage rules 3 | ## Aliases 4 | `clr` 5 | ## Usage 6 | ``` 7 | configcat flag percentage clear [options] 8 | ``` 9 | ## Example 10 | ``` 11 | configcat flag % clear -i -e 12 | ``` 13 | ## Options 14 | | Option | Description | 15 | | ------ | ----------- | 16 | | `--flag-id`, `-i`, `--setting-id` | ID of the Feature Flag or Setting | 17 | | `--environment-id`, `-e` | ID of the Environment from where the rules must be deleted | 18 | | `--reason`, `-r` | The reason note for the Audit Log if the Product's 'Config changes require a reason' preference is turned on | 19 | | `--verbose`, `-v`, `/v` | Print detailed execution information | 20 | | `--non-interactive`, `-ni` | Turn off progress rendering and interactive features | 21 | | `-h`, `/h`, `--help`, `-?`, `/?` | Show help and usage information | 22 | ## Parent Command 23 | | Command | Description | 24 | | ------ | ----------- | 25 | | [configcat flag percentage](configcat-flag-percentage.md) | Manage percentage rules | 26 | -------------------------------------------------------------------------------- /src/ConfigCat.Cli/CommandDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.CommandLine; 4 | using System.Linq; 5 | using System.Reflection; 6 | 7 | namespace ConfigCat.Cli; 8 | 9 | public class CommandDescriptor(string name, string description, string example = null) 10 | { 11 | public string Name { get; } = name; 12 | 13 | public string Description { get; } = description; 14 | 15 | public string Example { get; } = example; 16 | 17 | public bool IsHidden { get; init; } 18 | 19 | public IEnumerable