Skip to main content

Advanced CLI Usage

Once you’re comfortable with the basics, explore these advanced features to enhance your security scanning workflows.

Advanced Command Options

rafter run - Scanning Options

--mode plus spends credits. If the approval gate is enabled — scan.plus_requires_approval in .rafter.yml, or agent.scan.plusRequiresApproval in the global config (off by default) — a non-interactive --mode plus run like the one above refuses with exit code 5 unless you add -y/--yes or set RAFTER_CONFIRM=1.

rafter get - Retrieval Options

Common Use Cases

Local Development

Feature Branch Workflow

CI/CD Integration

See more on our CD/CI page.

Automation Techniques

Shell Scripting

Create reusable scripts for common workflows:

Pipeline Integration

Integrate with your existing development pipelines:

Output Processing

--format json returns results following our API Schema, which makes them easy to process with jq. The CLI’s own default format is md, so pass --format json explicitly for scripting. At the top level is various details about the scan, including a vulnerabilities array. Each finding’s severity is one of the SARIF levels error, warning or note.

Setup for JSON Processing

First, set up your results object either from a scan run or by getting existing results.
Next, we’ll demonstrate many common use cases for processing the results object.

Basic Analysis

Summary Reports

Data Extraction

Complete Analysis Processing Script

Below is a complete script that runs a Rafter security scan and processes the JSON results.

Markdown Processing

Process Markdown output for documentation:

Next Steps

CLI Basics

Learn the fundamentals of using the Rafter CLI.

Advanced CLI

Master advanced CLI features and automation.

API Reference

Build custom integrations with the REST API.

CI/CD Integration

Set up automated scanning in your pipelines.