# analyze (Experimental)

## abtasty-cli feature-experimentation analyze flag

#### NAME

`abtasty-cli feature-experimentation analyze flag` - Analyze your codebase and detect the usage of Flagship or custom flags.

#### SYNOPSIS

`abtasty-cli feature-experimentation analyze flag [--directory=DIRECTORY --repository-url=REPOSITORY_URL --repository-branch=REPOSITORY_BRANCH --code-edge=CODE_EDGE --files-exclude=FILES_EXCLUDE [--custom-regex=CUSTOM_REGEX | --custom-regex-json=CUSTOM-REGEX-JSON]]`

#### DESCRIPTION

Analyze your codebase and detect the usage of Flagship flags or custom flags.

#### EXAMPLES

```shell
abtasty-cli feature-experimentation analyze flag --directory="./" --repository-url="https://github.com/org/repo" --repository-branch="main" --files-exclude="[\".git\", \".github\", \".vscode\", \".idea\"]" --custom-regex="[{\"file_extension\":\".go?\",\"regexes\":[\"(?:Bool|String|Float64)Variation[(](?:\\\\s*[\\\"\\\\'](.*)[\\\"\\\\']\\\\s*,\\\\s*([\\\"\\\\'].*\\\\s*[^\\\"]*[\\\"\\\\']|[^)]*))\\\\s*[)]\"]}]"
```

#### FLAGS

`--directory = _DIRECTORY_`

Directory to analyze in your codebase. The default value is ".".

`--repository-url= _REPOSITORY_URL_`

The root URL of your repository, it's used to track the links of the files where your flags are used. The default value is "[https://github.com/org/repo"](https://github.com/org/repo%22).

`--repository-branch= _REPOSITORY_BRANCH_`

Branch of the code you want to analyze, it's used to track the links of the files where your flags are used. The default is "main".

`--code-edge= _CODE_EDGE_`

Number of lines of code you want to capture before and after the line that contains the flag. The default is 1.

`--files-exclude= _FILES_EXCLUDE_`

List of files to exclude in the analysis. The default are "\[\\".git\\", \\".github\\", \\".vscode\\", \\".idea\\"]".

`--custom-regex= _CUSTOM_REGEX_`

If you are not using Flagship, you can put a custom regex for the pattern you want to analyze.

`--custom-regex-json= _CUSTOM_REGEX_JSON_`

JSON file where you put the custom regex for the pattern you want to analyze.

`--origin-platform= _ORIGIN_PLATFORM_`

The name of the feature flag platform you want to analyze, we support launchdarkly, optimizely, split, vwo.

{% hint style="danger" %}
❗️ Custom regex format

Note that you should insert data without spaces, line breaks, tabulation etc... check this section in codebase analyzer doc [section](https://docs.developers.flagship.io/docs/codebase-analyzer#custom-regexes)
{% endhint %}

***

## abtasty-cli feature-experimentation analyze flag create

{% hint style="danger" %}
❗️ This command will automatically create flag detected !

There is no confirmation step to create flag detected, so we recommend using `flagship analyze flag list` to check detected flags and their properties.
{% endhint %}

#### NAME

`abtasty-cli feature-experimentation analyze flag create` - Analyze your codebase and automatically create flags detected

#### SYNOPSIS

`abtasty-cli feature-experimentation analyze flag create [--directory=DIRECTORY --repository-url=REPOSITORY_URL --repository-branch=REPOSITORY_BRANCH --code-edge=CODE_EDGE --files-exclude=FILES_EXCLUDE [--custom-regex=CUSTOM_REGEX | --custom-regex-json=CUSTOM-REGEX-JSON]]`

#### DESCRIPTION

Analyze your codebase and automatically create the flags detected to the Flagship platform.

#### EXAMPLES

```shell
abtasty-cli feature-experimentation analyze flag create --directory="./" --repository-url="https://github.com/org/repo" --repository-branch="main" --files-exclude="[\".git\", \".github\", \".vscode\", \".idea\"]" --custom-regex="[{\"file_extension\":\".go?\",\"regexes\":[\"(?:Bool|String|Float64)Variation[(](?:\\\\s*[\\\"\\\\'](.*)[\\\"\\\\']\\\\s*,\\\\s*([\\\"\\\\'].*\\\\s*[^\\\"]*[\\\"\\\\']|[^)]*))\\\\s*[)]\"]}]"
```

#### FLAGS

`--directory = _DIRECTORY_`

Directory to analyze in your codebase. The default value is ".".

`--repository-url= _REPOSITORY_URL_`

The root URL of your repository, it's used to track the links of the files where your flags are used. The default value is "[https://github.com/org/repo"](https://github.com/org/repo%22).

`--repository-branch= _REPOSITORY_BRANCH_`

Branch of the code you want to analyze, it's used to track the links of the files where your flags are used. The default is "main".

`--code-edge= _CODE_EDGE_`

Number of lines of code you want to capture before and after the line that contains the flag. The default is 1.

`--files-exclude= _FILES_EXCLUDE_`

List of files to exclude in analysis. The default are "\[\\".git\\", \\".github\\", \\".vscode\\", \\".idea\\"]".

`--custom-regex= _CUSTOM_REGEX_`

If you are not using Flagship, you can put a custom regex for the pattern you want to analyze.

`--custom-regex-json= _CUSTOM_REGEX_JSON_`

JSON file where you put the custom regex for the pattern you want to analyze.

`--origin-platform= _ORIGIN_PLATFORM_`

The name of the feature flag platform you want to analyze, we support launchdarkly, optimizely, split, vwo.

{% hint style="danger" %}
❗️ Custom regex format

Note that you should insert data without spaces, line breaks, tabulation etc... check this section in codebase analyzer doc [section](https://docs.developers.flagship.io/docs/codebase-analyzer#custom-regexes)
{% endhint %}

***

## abtasty-cli feature-experimentation analyze flag list

#### NAME

`abtasty-cli feature-experimentation analyze flag list` - Analyze your codebase and list flags detected

#### SYNOPSIS

`abtasty-cli feature-experimentation analyze flag list [--directory=DIRECTORY --repository-url=REPOSITORY_URL --repository-branch=REPOSITORY_BRANCH --code-edge=CODE_EDGE --files-exclude=FILES_EXCLUDE [--custom-regex=CUSTOM_REGEX | --custom-regex-json=CUSTOM-REGEX-JSON]]`

#### DESCRIPTION

Analyze your codebase and list flags detected, and check if they exist in the flagship platform

#### EXAMPLES

```shell
abtasty-cli feature-experimentation analyze flag list --directory="./" --repository-url="https://github.com/org/repo" --repository-branch="main" --files-exclude="[\".git\", \".github\", \".vscode\", \".idea\"]" --custom-regex="[{\"file_extension\":\".go?\",\"regexes\":[\"(?:Bool|String|Float64)Variation[(](?:\\\\s*[\\\"\\\\'](.*)[\\\"\\\\']\\\\s*,\\\\s*([\\\"\\\\'].*\\\\s*[^\\\"]*[\\\"\\\\']|[^)]*))\\\\s*[)]\"]}]"
```

#### FLAGS

`--directory = _DIRECTORY_`

Directory to analyze in your codebase. The default value is ".".

`--repository-url= _REPOSITORY_URL_`

The root URL of your repository, it's used to track the links of the files where your flags are used. The default value is "[https://github.com/org/repo"](https://github.com/org/repo%22).

`--repository-branch= _REPOSITORY_BRANCH_`

Branch of the code you want to analyze, it's used to track the links of the files where your flags are used. The default is "main".

`--code-edge= _CODE_EDGE_`

Number of lines of code you want to capture before and after the line that contains the flag. The default is 1.

`--files-exclude= _FILES_EXCLUDE_`

List of files to exclude in analysis. The default are "\[\\".git\\", \\".github\\", \\".vscode\\", \\".idea\\"]".

`--custom-regex= _CUSTOM_REGEX_`

If you are not using Flagship, you can put a custom regex for the pattern you want to analyze.

`--custom-regex-json= _CUSTOM_REGEX_JSON_`

JSON file where you put the custom regex for the pattern you want to analyze.

`--origin-platform= _ORIGIN_PLATFORM_`

The name of the feature flag platform you want to analyze, we support launchdarkly, optimizely, split, vwo.

`--codebase-analyzer`

List codebase analyzer extract information.

{% hint style="danger" %}
❗️ Custom regex format

Note that you should insert data without spaces, line breaks, tabulation etc... check this section in codebase analyzer doc [section](https://docs.developers.flagship.io/docs/codebase-analyzer#custom-regexes)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/server-side/command-line-interface/ab-tasty-cli-reference-v1xx/feature-experimentation/feature-experimentation-analyze.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
