From d77f21ce8b63aa72abf054d7ae7953760a8c0206 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 17:25:35 +0000 Subject: [PATCH] docs: document --include-regex and --exclude-regex for snapshot s3 --- client_reference/kosli_snapshot_s3.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/client_reference/kosli_snapshot_s3.md b/client_reference/kosli_snapshot_s3.md index 834f20c..c60d7ca 100644 --- a/client_reference/kosli_snapshot_s3.md +++ b/client_reference/kosli_snapshot_s3.md @@ -21,7 +21,7 @@ To authenticate to AWS, you can either: Option 1 takes highest precedence, while option 3 is the lowest. More details can be found here: https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/#specifying-credentials -You can report the entire bucket content, or filter some of the content using `--include` and `--exclude`. +You can report the entire bucket content, or filter some of the content using `--include`/`--exclude` (literal prefix match) or `--include-regex`/`--exclude-regex` (Go regular expressions matched against the full object key). In all cases, the content is reported as one artifact. If you wish to report separate files/dirs within the same bucket as separate artifacts, you need to run the command twice. To specify paths in a directory artifact that should always be excluded from the SHA256 calculation, you can add a `.kosli_ignore` file to the root of the artifact. @@ -36,9 +36,11 @@ The `.kosli_ignore` will be treated as part of the artifact like any other file, | --aws-secret-key string | The AWS secret access key. | | --bucket string | The name of the S3 bucket. | | -D, --dry-run | [optional] Run in dry-run mode. When enabled, no data is sent to Kosli and the CLI exits with 0 exit code regardless of any errors. | -| -x, --exclude strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to exclude when fingerprinting. Cannot be used together with --include. | +| -x, --exclude strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to exclude when fingerprinting. Paths match by literal prefix. Cannot be used together with --include or --include-regex. | +| --exclude-regex strings | [optional] The comma separated list of Go regular expressions matched against object keys in the S3 bucket to exclude when fingerprinting. Cannot be used together with --include or --include-regex. | | -h, --help | help for s3 | -| -i, --include strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to include when fingerprinting. Cannot be used together with --exclude. | +| -i, --include strings | [optional] The comma separated list of file and/or directory paths in the S3 bucket to include when fingerprinting. Paths match by literal prefix. Cannot be used together with --exclude or --exclude-regex. | +| --include-regex strings | [optional] The comma separated list of Go regular expressions matched against object keys in the S3 bucket to include when fingerprinting. Cannot be used together with --exclude or --exclude-regex. | ## Flags inherited from parent commands @@ -102,5 +104,12 @@ kosli snapshot s3 yourEnvironmentName --exclude file.txt,path/within/bucket ``` + +```shell +kosli snapshot s3 yourEnvironmentName + --bucket yourBucketName + --exclude-regex '.*\.png$' +``` +