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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

codesecure_cli-1.0.11-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file codesecure_cli-1.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for codesecure_cli-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 830eadbad9b06a4a112ae4be2b7d54eea6eda0216fa9c550886fea14595dc17d
MD5 63788363d3b0a8509d3130cd57cb9c2f
BLAKE2b-256 a0b1ba4319d772e784aebf12fa658cc0fb024459d0d8f9f02c7d7e6652418083

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