CHAMPREP QA commands
champrep qa works with CHAMPREP QA from your terminal: activate
repositories, run scans and watch them finish, filter and triage findings,
check a quality gate, start preview environments, and open cloud IDE
workspaces. It acts as you, with your normal CLI sign-in. QA checks your role
in the repository at its source (CHAMPREP Code, GitHub, GitLab or Bitbucket)
on every call, and your plan’s allowances apply.
Before you start
Section titled “Before you start”- Install the CLI and sign in with
champrep auth login. - Your plan must include CHAMPREP QA. Connect GitHub, GitLab or Bitbucket in the QA web app first if you use them; CHAMPREP Code repositories need no extra connection.
Repository keys and workspaces
Section titled “Repository keys and workspaces”QA names a repository by its key, which champrep qa repos ls and
champrep qa repos available print:
| Source | Key |
|---|---|
| CHAMPREP Code | code:<project-uuid> |
| GitHub | github:<id> |
| GitLab | gitlab:<id> |
| Bitbucket | bitbucket:<workspace>/<slug> |
--workspace picks the QA workspace to act in: personal,
organization:<id> or team:<id>. It decides which workspace’s repositories
you see and which workspace a scan, an activation, a preview or an IDE
workspace is charged to. Without it, QA uses your default workspace, as the
web app does.
Commands
Section titled “Commands”Repositories
Section titled “Repositories”| Command | Purpose |
|---|---|
champrep qa repos ls | List the workspace’s active repositories with their gate and last scan. --source code|github|gitlab|bitbucket, --gate passed|failed|not_scanned|scanning, --search, --all (also inactive), --limit (1-100). |
champrep qa repos available --provider P | List the repositories a source offers you and whether each is active. |
champrep qa repos activate REPO... | Start analysing up to 100 repositories. Each counts toward your repository allowance. |
champrep qa repos deactivate REPO... | Stop analysing repositories. |
champrep qa repos sync --provider gitlab|bitbucket | Read GitLab projects or Bitbucket repositories again from your connected account. |
champrep qa repos sync code:<uuid> | Refresh one CHAMPREP Code project’s default-branch head. GitHub repositories sync on their own. |
| Command | Purpose |
|---|---|
champrep qa scan REPO | Start a scan of the default branch, or --ref BRANCH. --watch (-w) follows it to the end; --timeout (default 30m) limits the wait; --profile picks a scan profile when your organization asks each time. |
champrep qa scans ls | List the scans you started, a repository’s (--repo REPO), or the workspace’s (--org). --run queued,running,held,passed,failed,canceled; --limit. |
champrep qa scans show SCAN_ID | Show a scan: branch, commit, run state, gate, new and fixed findings, minutes, any error or hold. |
Scans of CHAMPREP Code and GitHub repositories run from the CLI. A scan is
charged to you once. When CHAMPREP Code handles the request as its own
CHAMPREP QA check, the CLI says so and you follow it with
champrep qa scans ls --repo REPO.
Findings
Section titled “Findings”| Command | Purpose |
|---|---|
champrep qa findings ls | List findings, open ones by default. Filters below. --page, --limit (1-100). |
champrep qa findings show FINDING | Show one finding by ID or QA number, such as QA-0970: severity, state, rule, CWE, location, snippet. |
champrep qa findings dismiss FINDING --reason R | Dismiss a finding. --comment; --secret-revoked for secrets. |
champrep qa findings reopen FINDING | Undo a dismissal, acceptance or resolution: the finding goes back to Needs triage. |
| Filter | Values |
|---|---|
--repo REPO | One repository; without it, the whole workspace. |
--severity | critical, high, medium, low, info, unknown (comma separated) |
--cwe | One CWE, such as 79 or CWE-79 |
--branch | Findings on this branch |
--state | detected (Needs triage), confirmed, dismissed, accepted, resolved, or all. Default: detected,confirmed |
--type | sast, secret, iac, dependency |
--search | Text search, 3 characters or more |
--mine | Findings assigned to you |
Dismissal reasons are false_positive, acceptable_risk,
mitigating_control, used_in_tests and not_applicable. Dismissing needs
the Maintainer role or above. Dismissing a secret also needs
--secret-revoked: confirm the secret was revoked or was never valid.
Quality gates
Section titled “Quality gates”| Command | Purpose |
|---|---|
champrep qa gates status REPO | Show whether the repository passes its quality gate on the default branch or --branch, with each condition’s count and limit. |
gates status exits with code 1 when the gate fails, so you can use it to
guard a script or a deployment step.
Previews
Section titled “Previews”| Command | Purpose |
|---|---|
champrep qa previews ls | List your live previews. --ended, --org (the whole workspace), --repo REPO, --limit. |
champrep qa previews show PREVIEW_ID | Show a preview, its address and when it expires. |
champrep qa previews create | Build and start a preview. Requires --provider and --repo owner/name; also --branch, --code-project ID, --port. |
champrep qa previews extend PREVIEW_ID --minutes N | Keep a preview running longer: 5 to 1440 minutes, up to its hard expiry. |
champrep qa previews stop PREVIEW_ID | Stop a preview. |
For CHAMPREP Code, --repo is the project path, such as acme/web.
IDE workspaces
Section titled “IDE workspaces”| Command | Purpose |
|---|---|
champrep qa ide ls | List your running IDE workspaces (--ended for past ones). --json leaves out each workspace’s idePath, which holds its session token. |
champrep qa ide start | Start a workspace on --provider and --repo owner/name (--branch, --work-branch, --code-project), or an empty one with --scratch. |
champrep qa ide open SESSION_ID | Print the workspace’s address; --browser opens it. |
champrep qa ide stop SESSION_ID | Stop a workspace. Changes not pushed are kept for recovery for a while. |
ide open prints https://qa.champrep.com/workspaces/<id>. The address
carries no credential: you sign in to CHAMPREP QA in the browser as usual.
Examples
Section titled “Examples”Activate a CHAMPREP Code repository and scan it:
champrep qa repos available --provider codechamprep qa repos activate code:7d0c5c6e-0b6a-4e2b-9a55-0f8e6c1d2a10 --yeschamprep qa scan code:7d0c5c6e-0b6a-4e2b-9a55-0f8e6c1d2a10 --ref main --watch --yesReview the most serious findings and dismiss a test fixture:
champrep qa findings ls --repo code:7d0c5c6e-0b6a-4e2b-9a55-0f8e6c1d2a10 --severity critical,highchamprep qa findings ls --cwe 89 --branch mainchamprep qa findings show QA-0970champrep qa findings dismiss QA-0970 --reason used_in_tests --comment "fixture key" --yeschamprep qa findings reopen QA-0970 --yesStop a deployment when the gate fails:
champrep qa gates status code:7d0c5c6e-0b6a-4e2b-9a55-0f8e6c1d2a10 --branch main \ && ./deploy.shPreview a branch, then open an IDE on it:
champrep qa previews create --provider code --repo acme/web --branch feature/login --yeschamprep qa previews extend 6731c0ffee0000000000abcd --minutes 60 --yeschamprep qa ide start --provider code --repo acme/web --branch feature/login --yeschamprep qa ide open 6731c0ffee0000000000beef --browserConfirmation and scripting
Section titled “Confirmation and scripting”Commands that change something or spend your allowance ask first:
repos activate and deactivate, scan, findings dismiss and reopen,
previews create, extend and stop, and ide start and stop. Answer y
on a terminal, or pass --yes (-y) in a script. Without a terminal and
without --yes the command refuses and changes nothing. scan, previews create and ide start carry an idempotency key, so the CLI’s automatic retry
after a network error never starts two.
Add --json to print what QA returned. The exit code stays the same with
--json: scan --watch --json prints the finished scan and exits 1 when the
scan or its gate fails, gates status --json exits 1 on a failing gate, and
repos activate --json exits 1 when a repository was refused. IDE workspace
answers are printed without idePath: it holds the workspace’s session token.
Open a workspace with ide open instead.
champrep qa findings ls --severity critical --json | jq -r '.[] | "\(.qaId) \(.title)"'scan --watch exits with code 1 when the scan fails or its gate fails.
Errors you may see
Section titled “Errors you may see”| Message | What to do |
|---|---|
payment required … (REPOSITORY_ALLOWANCE_EXCEEDED) | Your plan’s repository allowance is used. Deactivate a repository or add capacity in CHAMPREP Billing. Exit code 1. |
not allowed for your role … (SOURCE_ROLE_REQUIRED), (SECURITY_MANAGE_REQUIRED), (ROLE_REQUIRED) | Your role at the source or in the workspace does not allow it. Dismissing and accepting findings needs Maintainer or above. |
needs your web session … (SESSION_REQUIRED), (IMPERSONATION_NOT_ALLOWED) | Only you, signed in to the QA web app, can take this decision. |
not available to your account … | Your plan or organization policy does not include CHAMPREP QA or this feature. |
http 422 … (QA_PROVIDER_NOT_SCANNABLE_YET) | Scans of GitLab and Bitbucket repositories are not available yet. |
not found … (REPO_NOT_FOUND), (SCAN_NOT_FOUND) | The repository is not active in this workspace, or you cannot open it. |
Every refusal above exits with code 1; a gateway rate limit exits 5. A
refused repos activate prints each refused repository with its reason and
exits 1; the others are still activated.