| Crates.io | aikido-api-client |
| lib.rs | aikido-api-client |
| version | 1.0.0 |
| created_at | 2025-12-11 11:04:26.07707+00 |
| updated_at | 2025-12-11 11:04:26.07707+00 |
| description | A Rust CLI client for the Aikido Security CI API integration |
| homepage | |
| repository | https://github.com/michallis/aikido-api-client.git |
| max_upload_size | |
| id | 1979508 |
| size | 208,946 |
A comprehensive Rust CLI client and library for the Aikido Security API. This tool supports both the CI API for pipeline integrations and the Public API for full workspace management.
cargo build --release
The binary will be available at ./target/release/aikido-api-client.
cargo install aikido-api-client
Get your API key from Aikido Settings
Store your API key:
aikido-api-client apikey <your-api-key>
Run a scan:
aikido-api-client scan <repository_id> <base_commit> <head_commit>
Get your OAuth2 credentials from API Settings
Store your credentials:
aikido-api-client auth <client_id> <client_secret>
Access your workspace:
aikido-api-client workspace
aikido-api-client repos
aikido-api-client issues
apikey - Configure API Keyaikido-api-client apikey AIK_CI_EU_xxxxx
scan - Differential ScanRun a scan comparing two commits to find new security issues:
aikido-api-client scan <repository_id> <base_commit> <head_commit> [options]
Options:
--branch <name> - Branch name being scanned--pr-title <title> - Pull request title--pr-url <url> - Pull request URL--fail-on-sast - Fail if SAST issues found--fail-on-iac - Fail if IaC issues found--fail-on-secrets - Fail if secrets found--minimum-severity <level> - Minimum severity (LOW, MEDIUM, HIGH, CRITICAL)--self-managed <scanners> - Comma-separated list of self-managed scannersscan-release - Release Gating ScanCheck for open security issues before release:
aikido-api-client scan-release <repository_id> <head_commit> [options]
Options:
--branch <name> - Branch name--base-branch <name> - Base branch to compare--fail-on-sast, --fail-on-iac, --fail-on-secrets - Fail on specific issue types--minimum-severity <level> - Minimum severity levelupload - Upload Custom ResultsUpload results from external scanners:
aikido-api-client upload <repository_id> <payload_type> <payload_file> [options]
Payload Types: checkov, json-sbom
Options:
--scan-id <id> - Associate with an existing scan--container-image <name> - Container image nameauth - Configure OAuth2 Credentialsaikido-api-client auth <client_id> <client_secret>
workspace - Get Workspace Informationaikido-api-client workspace
repos - List Code Repositoriesaikido-api-client repos [options]
Options:
--page <n> - Page number (default: 0)--per-page <n> - Results per page (default: 20)--include-inactive - Include inactive repositories--filter-name <name> - Filter by repository name--filter-branch <branch> - Filter by branch nameissues - List Issue Groupsaikido-api-client issues [options]
Options:
--page <n> - Page number (default: 0)--per-page <n> - Results per page (default: 20)--group-id <id> - Get details for a specific issue groupcontainers - List Containersaikido-api-client containers [options]
Options:
--page <n>, --per-page <n> - Pagination--container-id <id> - Get details for a specific containerdomains - Manage Domains and APIs# Create a new domain
aikido-api-client domains create <name> [--domain-type <type>] [--url <url>]
# Remove a domain
aikido-api-client domains remove <domain_id>
# Start a domain scan
aikido-api-client domains scan <domain_id>
teams - List Teamsaikido-api-client teams [--page <n>] [--per-page <n>]
users - List Usersaikido-api-client users [options]
Options:
--page <n>, --per-page <n> - Pagination--user-id <id> - Get details for a specific usercompliance - Get Compliance Statusaikido-api-client compliance [framework]
Frameworks: soc2, iso27001, nis2, all (default)
reports - Access Reports# Export PDF report
aikido-api-client reports pdf [--output <filename>]
# List CI scans
aikido-api-client reports ci-scans [--page <n>] [--per-page <n>]
# View activity log
aikido-api-client reports activity-log [--page <n>] [--per-page <n>]
clouds - List Connected Cloudsaikido-api-client clouds
-q, --quiet - Disable console output--debug - Enable debug output--plain-output - Disable colored output--apikey <key> - Use specific API key (overrides stored key)| Code | Meaning |
|---|---|
| 0 | Success - scan passed or command completed |
| 1 | Error - API unavailable, invalid arguments, etc. |
| 10 | Gate failed - issues found that block the build |
Add to your Cargo.toml:
[dependencies]
aikido-api-client = "2.0"
tokio = { version = "1", features = ["full"] }
use aikido_api_client::api::{AikidoClient, ScanOptions};
#[tokio::main]
async fn main() {
let client = AikidoClient::new("AIK_CI_...");
let options = ScanOptions {
repository_id: "12345".to_string(),
base_commit_id: Some("abc123".to_string()),
head_commit_id: Some("def456".to_string()),
// ... other options
};
let result = client.start_scan(options).await.unwrap();
println!("Scan started: {}", result.scan_id);
}
use aikido_api_client::public_api::PublicApiClient;
#[tokio::main]
async fn main() {
let mut client = PublicApiClient::new("client_id", "client_secret");
// Get workspace info
let workspace = client.get_workspace_info().await.unwrap();
println!("Workspace: {}", workspace.name);
// List repositories
let repos = client.list_code_repositories(Default::default()).await.unwrap();
for repo in repos {
println!("Repo: {}", repo.name);
}
}
The client automatically detects your region from the API key prefix:
AIK_CI_US_* - US region (app.us.aikido.dev)AIK_CI_ME_* - Middle East region (app.me.aikido.dev)Credentials are stored in ~/.config/aikido-api-client/config.toml:
[auth]
api_key = "AIK_CI_..." # CI API key
client_id = "..." # OAuth2 client ID
client_secret = "..." # OAuth2 client secret
- name: Run Aikido Scan
env:
AIKIDO_API_KEY: ${{ secrets.AIKIDO_API_KEY }}
run: |
aikido-api-client apikey $AIKIDO_API_KEY
aikido-api-client scan ${{ github.repository_id }} \
${{ github.event.pull_request.base.sha }} \
${{ github.sha }}
stage('Security Scan') {
environment {
AIKIDO_API_KEY = credentials('aikido-api-key')
}
steps {
sh 'aikido-api-client apikey ${AIKIDO_API_KEY}'
sh 'aikido-api-client scan ${REPO_ID} ${GIT_PREVIOUS_COMMIT} ${GIT_COMMIT}'
}
}
security_scan:
script:
- aikido-api-client apikey $AIKIDO_API_KEY
- aikido-api-client scan $CI_PROJECT_ID $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_COMMIT_SHA
only:
- merge_requests
- run:
name: Security Scan
command: |
aikido-api-client apikey $AIKIDO_API_KEY
aikido-api-client scan $CIRCLE_PROJECT_REPONAME $CIRCLE_SHA1~1 $CIRCLE_SHA1
See the examples directory for complete working examples:
ci_pipeline.rs - CI/CD pipeline integrationrelease_gate.rs - Release gating workflowupload_sbom.rs - SBOM upload for container scanningpublic_api_client.rs - Public API usagecompliance_check.rs - Compliance status checkingMIT License - See LICENSE for details.