Skip to main content

CodeSecure Command Line Interface

Project description

CodeSecure CLI (codesecure-cli)

The codesecure-cli package is the user-facing terminal interface for the CodeSecure monorepo. It wraps the functionality of the core orchestration engine within an interactive, rich terminal application.

🎯 Module Purpose

This package focuses entirely on Developer Experience (DX) inside the terminal and CI/CD environments. It parses CLI arguments using Click, dynamically structures interactive menus with Rich, and connects seamlessly to the Python business logic embedded in codesecure-core.

Note: The CLI is designed to be a "Thin Wrapper". Core scanning logic does not exist in this package.

📦 Local Installation

Installing the CLI relies on standard Python setups but requires the workspace dependency mapped to codesecure-core.

cd packages/cli
python -m venv .venv
source .venv/bin/activate

# Recommended: Install via pip from the project root rather than locally
# This dynamically resolves workspace dependencies
cd ../../
pip install -e ./packages/cli

🔌 Exported Commands & Features

The entry point script installs a global binary command: codesecure. Check the top-level commands below.

# Validates the active scanners provided by Core
codesecure list-scanners

# Initializes Beta agreements
codesecure init

# Prompts setup for Gemini or Kiro CLI
codesecure login

# The main workhorse: Initiates an interactive async scan on a target path
codesecure scan ./my-project --provider kiro --output json,html

🛠️ Integration Example

Since the CLI is a consumption edge-node in the monorepo architecture, its integrations primarily concern reading from core. Below is a snippet of how the CLI bypasses MCP overhead to list scanners efficiently from the programmatic core.

import click
from codesecure.common.models import ScanMode

@click.command()
def list_scanners():
    """List available security scanners from Core."""
    from codesecure.scanners.engine import get_scanner_engine
    engine = get_scanner_engine()
    
    try:
        local_scanners = engine.get_available_scanners(ScanMode.LOCAL)
        print(f"Available Local Scanners: {', '.join(local_scanners)}")
    except Exception as e:
        print(f"Failed to list scanners: {e}")

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

codesecure_cli-1.0.0b10.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

codesecure_cli-1.0.0b10-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file codesecure_cli-1.0.0b10.tar.gz.

File metadata

  • Download URL: codesecure_cli-1.0.0b10.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for codesecure_cli-1.0.0b10.tar.gz
Algorithm Hash digest
SHA256 1fc4f0f62cdca983dd38311d3e06daad183c37010a77fb2fc2ce3cd327a5d2bd
MD5 6014473186020e9bdf259848cae60dfb
BLAKE2b-256 cbd87950276d6f1e07baab1907e8ae798a255d3c78683857a83c5157469dc08a

See more details on using hashes here.

File details

Details for the file codesecure_cli-1.0.0b10-py3-none-any.whl.

File metadata

File hashes

Hashes for codesecure_cli-1.0.0b10-py3-none-any.whl
Algorithm Hash digest
SHA256 c7f987874bc12fd90ee9316e51d3a4faa1883f53d6d5cd2cc6dfa2861f8bb9cc
MD5 3532c75143c4028407092ea00b12e419
BLAKE2b-256 1f7883d9b26a71833abb234bbacdd72544f686fedaea1850cd3e5a6cf16e9460

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