Need help for Checkmarx.Api cake plugin

As answered in the GitHub discussion where you asked the same question:

Cake scripts based on "normal" C#, so whatever the usage of Checkmarx.API, you can simply incorporate that in your cake scripts. Probably something like:

Task("Scan")
 .Does(() => 
{
  // place your code here..
});

As for using Checkmarx.API, I would suggest asking in the Checkmarx.API repo.

Alternatively, it seems that there is a CLI available. You can use that using the one of the process aliases.

Probably something like:

Task("Scan")
 .Does(() => 
{
  StartProcess("runCxConsole.cmd", new ProcessSettings
  { 
    Arguments = @"Scan -v -ProjectName ""CxServer/bookname j2"" -CxServer http://localhost -CxUser username -CxPassword admin -LocationType folder -LocationPath ""C:\Data\Projects\Java\bs java"" -preset ""Checkmarx Default""" 
  });
});

(Note: I took the Arguments to runCxConsole.cmd from the documentation - I did not test that.)