Skip to main content

Alprina CLI - AI-powered cybersecurity command-line tool for developers

Project description

๐Ÿ›ก๏ธ Alprina CLI

AI-powered cybersecurity command-line tool for developers

"Build fast. Guard faster."

Alprina CLI merges intelligent security scanning with developer-friendly tooling, combining the power of Kimi CLI and CAI (Cybersecurity AI).

Features

  • ๐Ÿ’ฌ Interactive AI Chat - Conversational security assistant powered by Claude/GPT
  • ๐Ÿ” Remote & Local Scanning - Scan APIs, websites, and local codebases
  • ๐Ÿง  AI-Powered Analysis - Smart vulnerability detection and risk assessment
  • ๐Ÿ› ๏ธ Automated Mitigation - Get actionable remediation guidance
  • ๐Ÿ“Š Rich Reporting - HTML, PDF, and JSON reports
  • ๐Ÿ” Policy-Based Security - Enforce scope and guardrails
  • ๐Ÿ’ณ Usage-Based Billing - Flexible plans with Stripe integration
  • ๐Ÿ”Œ IDE Integration - Works with Zed, VSCode via ACP

Quick Start

Installation

# Install from PyPI
pip install alprina-cli

Development Installation

# Clone the repository
git clone https://github.com/alprina/alprina-cli
cd alprina-cli/cli

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .

Authentication

# Login with API key
alprina auth login --api-key YOUR_API_KEY

# Check authentication status
alprina auth status

Basic Usage

# Interactive AI chat (NEW!)
alprina chat

# Scan local code
alprina scan ./src --profile code-audit

# Scan remote endpoint
alprina scan https://api.example.com --profile web-recon

# Generate report
alprina report --format html

# Get mitigation suggestions
alprina mitigate

# Check billing status
alprina billing status

๐Ÿ’ฌ Chat with Alprina AI

The new interactive chat interface lets you scan, analyze, and fix vulnerabilities conversationally:

# Start chat session
alprina chat

# Chat with scan context
alprina scan ./src --output results.json
alprina chat --load results.json

# Use different AI models
alprina chat --model gpt-4
alprina chat --model claude-3-opus-20240229

Chat Examples:

You: Scan my Python Flask app for SQL injection vulnerabilities
Alprina: [Performs targeted scan and explains findings]

You: Show me how to fix the issue in login.py
Alprina: [Provides code examples and step-by-step guidance]

You: Generate a security report
Alprina: [Creates comprehensive report]

Special Commands:

  • /scan <target> - Run security scan
  • /explain <id> - Explain vulnerability
  • /fix <id> - Get mitigation steps
  • /report - Generate report
  • /help - Show all commands

CLI Commands

Command Description
alprina chat ๐Ÿ’ฌ Interactive AI security assistant
alprina auth login Authenticate with Alprina
alprina auth logout Logout from Alprina
alprina auth status Check authentication status
alprina scan <target> Run security scan on target
alprina recon <target> Perform reconnaissance
alprina mitigate Get mitigation suggestions
alprina report Generate security report
alprina policy init Initialize policy configuration
alprina policy test <target> Test target against policy
alprina config --init Initialize configuration
alprina billing status View billing and usage
alprina --acp Start ACP mode for IDE integration

Configuration

Policy Configuration

Create ~/.alprina/policy.yml:

project: "My Project Security Audit"

scope:
  allow_domains:
    - "example.com"
    - "api.example.com"

  allow_cidrs:
    - "192.168.0.0/16"

  forbid_ports:
    - 22
    - 3389

policies:
  allow_intrusive: false
  require_terms_ack: true
  max_concurrent_scans: 5

billing:
  plan: "free"
  max_scans_per_day: 10

Environment Variables

# Backend API URL
export ALPRINA_BACKEND="https://api.alprina.ai"

# JWT Secret (for local development)
export JWT_SECRET_KEY="your-secret-key"

Development

Setup Development Environment

# Install development dependencies
make dev

# Or manually
pip install -e ".[dev]"

Run Tests

make test

# Or
pytest

Code Formatting

make format

Linting

make lint

Architecture

User
โ”‚
โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Alprina CLI Shell           โ”‚
โ”‚ (Typer + Rich UI)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚                     โ”‚
โ”Œโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”
โ”‚ Policy  โ”‚    โ”‚ Auth & Billingโ”‚
โ”‚ Layer   โ”‚    โ”‚ (FastAPI)     โ”‚
โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ”‚
    โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ CAI Framework (Agents)      โ”‚
โ”‚ Recon, Scan, Mitigation     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
               โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Reporting Layer             โ”‚
โ”‚ JSONL, HTML, PDF            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Example Workflow

# 1. Authenticate
alprina auth login --api-key test-api-key-123

# 2. Initialize policy
alprina policy init

# 3. Scan local project
alprina scan ./my-app --profile code-audit

# 4. Scan remote API
alprina scan https://api.myapp.com --profile web-recon --safe-only

# 5. Generate report
alprina report --format html --output report.html

# 6. Get mitigation guidance
alprina mitigate

# 7. Check usage
alprina billing status

Scan Profiles

  • code-audit - Static analysis of source code
  • web-recon - Passive reconnaissance of web targets
  • vuln-scan - Active vulnerability scanning (requires policy approval)
  • secret-detection - Find hardcoded secrets and credentials
  • config-audit - Analyze configuration files

IDE Integration

Zed Editor

Add to your Zed assistant configuration:

{
  "assistant": {
    "agents": [
      {
        "name": "Alprina",
        "command": "alprina",
        "args": ["--acp"]
      }
    ]
  }
}

VSCode

Install the Alprina extension (coming soon) or use ACP integration.

License

Copyright ยฉ 2025 Alprina All rights reserved. Licensed under a proprietary commercial license.

Support

Roadmap

  • Full CAI integration
  • Stripe billing implementation
  • OAuth providers (GitHub, Google)
  • Web dashboard
  • VSCode extension
  • CI/CD integrations
  • Custom agent marketplace
  • Team collaboration features

Build fast. Guard faster. ๐Ÿ›ก๏ธ

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alprina_cli-0.1.1.tar.gz (149.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alprina_cli-0.1.1-py3-none-any.whl (170.3 kB view details)

Uploaded Python 3

File details

Details for the file alprina_cli-0.1.1.tar.gz.

File metadata

  • Download URL: alprina_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 149.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for alprina_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ccbf242fc4b018250d9a8b58f87801d1d8acff525dcc87acd85b8cdfce68ecca
MD5 d0e3ab5b9c56355efd40ddaa6ce15bc8
BLAKE2b-256 fe6912ab3807fafd0bb59c1fe8bcb1ce8f78a0aff943e28bf12d6dfe9ba2e7a7

See more details on using hashes here.

File details

Details for the file alprina_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: alprina_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 170.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for alprina_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d56cbdf352c67270a7627f074ca84d211252176bb5f02ee5bed8ccc8b6ca541c
MD5 edd0c2004c8ac564eea1893a20060cad
BLAKE2b-256 3f63cb172c042095c733a803c2a6c6cc05a1047230efe7b0a4d786fca3da4e79

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page