- Checkmarx Documentation
- Checkmarx One
- Checkmarx One CLI Tool
- Checkmarx One CLI Commands
- project
project
The configure
command can be used by itself or with a sub-command.
Usage
./cx project [command] [flags]
Help
- --help, -h
Help for the project command.
Project Commands
project
can be used with the following commands:
project create
The project create
command enables the ability to create a new project in Checkmarx One.
Usage
./cx project create [flags]
Flags
- --application-name <string>
Specify an application to which this project will be assigned.
Note: This flag can only be used to assign a project to an application that already exists, not to create a new application.
- --branch <string> (Default: main)
The name of the branch.
- --format <string> (Default: table)
The output format for the response. Possible values are
json
,list
ortable
.- --groups
List of groups.
- --help
Help for the create command.
- --project-name <string>
Name of the project.
- --repo-url <string>
Project Repository URL.
- --ssh-key <string>
Path to ssh private key.
- --tags <string>
List of tags. For example: tagA, tagB:value
Workflow Examples
Create a New Project
./cx project create --project-name <Project Name>
ophir@OphirS-Laptop:~/ast-cli$ ./cx project create --project-name "Test1" Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ ce46df28-7f33-49fe-88cb-337fe8eb2c39 Test1 09-29-21 [] []
ophir@OphirS-Laptop:~/ast-cli$ ./cx project list Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ ce46df28-7f33-49fe-88cb-337fe8eb2c39 Test1 09-29-21 [] [] d7b56888-8407-4e9b-ae5b-7fc43233a497 Test111 08-25-21 [] [] d6fe8ab4-becd-49ff-987f-ec5ee02cc614 EffProj 09-22-21 [] []
project delete
The project delete
is used to delete a project in Checkmarx One.
Usage
./cx project delete --project-id <project-id> [flags]
Flags
- --help, -h
Help for the delete command.
- --project-id
Project ID to delete.
Workflow Example
user@laptop:/AST$ ./cx.exe project list Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ fa5eeaac-2ec7-4fa7-946e-ed2f2e5ff8cd test-proj-del 08-24-21 [] []
Delete a Project
user@laptop:/AST$ ./cx.exe project delete --project-id fa5eeaac-2ec7-4fa7-946e-ed2f2e5ff8cd
user@laptop:/AST$ ./cx.exe project list Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------
project list
The project list
command provides a list of all the projects in Checkmarx One.
Usage
./cx project list [flags]
Flags
- --filter <string> (Default: return the first 20 records.)
Tip
You can set the
limit
value as 0 in order to return all records.Filter the projects list.
Use the ";" sign as the delimiter for arrays.
Available filters are: limit, offset, id, ids, id-regex, tags-keys, tags-values
- --format <string> (Default: table)
The output format for the response.
Possible values are
json
,list
ortable
.- --help, -h
Help for the list command.
Pagination
This command uses pagination. By default it returns the first 20 results (i.e., limit=20,offset=0
). Use limit
to adjust the maximum number of results to return and offset
to specify the number of results to skip before starting to return results. You can use offset=0
and limit=0
to get all results.
Example: The following command returns records 21-30
./cx project list --filter "limit=10,offset=20"
Applying Filters
You can limit results by using pagination and/or by filtering by various project attributes such as project IDs and project tags.
Filters are applied using the following syntax:
./cx project list --filter "attributeA=value1,attributeB=value1;value2;value3,..."
Example: The following command returns records for specific projects, based on project IDs.
./cx project list --filter "ids=7b70e4b6-4288-467b-8fa2-9c6c0ad0bd08;e231cf6d-f031-4290-b014-7c6ec343f793"
When multiple filter attributes are used, an AND operator is applied between attributes. When multiple values are given for an attribute, an OR operator is used between values.
Example: The following command returns records for all projects that have the tag key "product" and a tag value of either "AppA", "AppB" or "AppC".
./cx project list --filter "tags-keys=product,tags-values=AppA;AppB;AppC,limit=0"
Results
For each project, the following items are returned: Project ID, Project Name, Date that the project was created, and Tags and Groups associated with the project.
When results are returned in json format, an additional item updatedAt
is returned, giving the date of the most recent edit of the project settings.
Notice
The date given for updatedAt
relates only to editing the project settings and not to running scans, generating reports or other activities on the project.
Examples
Using the project list
command with various --format
flags
ophir@OphirS-Laptop:~/ast-cli$ ./cx project list --format table Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ ce46df28-7f33-49fe-88cb-337fe8eb2c39 Test1 09-29-21 [] [] d7b56888-8407-4e9b-ae5b-7fc43233a497 Test111 08-25-21 [] [] d6fe8ab4-becd-49ff-987f-ec5ee02cc614 EffProj 09-22-21 [] []
ophir@OphirS-Laptop:~/ast-cli$ ./cx project list --format list Project ID : ce46df28-7f33-49fe-88cb-337fe8eb2c39 Name : Test1 Created at : 09-29-21 Tags : [] Groups : [] Project ID : d7b56888-8407-4e9b-ae5b-7fc43233a497 Name : Test111 Created at : 08-25-21 Tags : [] Groups : [] Project ID : d6fe8ab4-becd-49ff-987f-ec5ee02cc614 Name : EffProj Created at : 09-22-21 Tags : [] Groups : []
project show
The project show
command provides information about a project in Checkmarx One.
Usage
./cx project show --project-id <project-id> [flags]
Flags
- --format <string> (Default: table)
The output format for the response. Possible values are
json
,list
ortable
.- ---help, -h
Help for the show command.
- --project-id <string> (Required)
Project ID to show.
Results
For each project, the following items are returned: Project ID, Project Name, Date that the project was created, and Tags and Groups associated with the project.
If the project configuration has been edited after the initial creation, then an additional item updatedAt
is returned, giving the date of the most recent edit.
Notice
The date given for updatedAt
relates only to project configuration and not to running of scans, generating reports or other activities.
Workflow Examples
ophir@OphirS-Laptop:~/ast-cli$ ./cx project list --format table Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ ce46df28-7f33-49fe-88cb-337fe8eb2c39 Test1 09-29-21 [] [] d7b56888-8407-4e9b-ae5b-7fc43233a497 Test111 08-25-21 [] [] d6fe8ab4-becd-49ff-987f-ec5ee02cc614 EffProj 09-22-21 [] []
Use the project show command with various format flags
ophir@OphirS-Laptop:~/ast-cli$ ./cx project show --project-id ce46df28-7f33-49fe-88cb-337fe8eb2c39 --format table Project ID Name Created at Tags Groups ---------- ---- ---------- ---- ------ ce46df28-7f33-49fe-88cb-337fe8eb2c39 Test1 09-29-21 [] []
ophir@OphirS-Laptop:~/ast-cli$ ./cx project show --project-id ce46df28-7f33-49fe-88cb-337fe8eb2c39 --format list Project ID : ce46df28-7f33-49fe-88cb-337fe8eb2c39 Name : Test1 Created at : 09-29-21 Tags : [] Groups : []
ophir@OphirS-Laptop:~/ast-cli$ ./cx project show --project-id ce46df28-7f33-49fe-88cb-337fe8eb2c39 --format json {"ID":"ce46df28-7f33-49fe-88cb-337fe8eb2c39","Name":"Test1","CreatedAt":"2021-09-29T11:52:15.924297Z","UpdatedAt":"2021-09-29T11:52:15.924297Z","Tags":{},"Groups":[]}
project tags
The tags
command provides a list of all the available tags in your tenant.
Tags are also used for overriding Jira feedback apps fields values. For additional information see:
Usage
./cx project tags [flags]
Flags
- ---help, -h
Help for the tags command.
Examples
Using the tags Command
ophir@OphirS-Laptop:~/ast-cli$ ./cx project tags {"Demo":[""],"QA":["Automation","Manual"],"test":[""]}{"insecure-bank":[""],"insecure-bank-app":[""],"rwwr":[""],"wrwr":[""]}
project branches
The branches
command provides a list of all the available branches in Checkmarx One.
Usage
./cx project branches [flags]
Flags
- --filter <string> (Default: return the first 20 records.)
Tip
You can set the
limit
value as 0 in order to return all records.Filter the branches returned within the specified project. Options are:
branch-name
,limit
, andoffset
Use the ";" sign as the delimiter for arrays.
Available filters are:
branch-name
,limit
, andoffset
- ---help, -h
Help for the branches command.
- --project-id <string> (Required)
Project ID of the project for which you would like to retrieve the branches.
Example
Using the project branches command
ophir@OphirS-Laptop:~/ast-cli$ ./cx project branches --project-id 5a529813-62bc-4d56-89a0-11ffc37b3bc6 ["dev","main"]