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.10.tar.gz (14.0 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.10-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file codesecure_cli-1.0.10.tar.gz.

File metadata

  • Download URL: codesecure_cli-1.0.10.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for codesecure_cli-1.0.10.tar.gz
Algorithm Hash digest
SHA256 72c3a44d37cc97ce45e54f771b8221db74f5b3c22f0b6b647343686f5a2b4fa4
MD5 e6ecc3e40d1538d520ce21c52991e33d
BLAKE2b-256 214a735709110d8ee98589d98647454658f7cd08affc858804f8b477fdead42a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codesecure_cli-1.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 44205484ff12289b4b8b00e4ed11f5298e63fd5961a8fd6bc960b1310a4fe156
MD5 f5aff03040ee8a8304fc865296f5dd9d
BLAKE2b-256 2911fe3493ce025ab1d75bc5b0e84f3c12207d801bb0502e87ac670df183c747

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