appsentinels-cli


Nameappsentinels-cli JSON
Version 2.2.6 PyPI version JSON
download
home_pageNone
SummaryAppSentinels CLI - Modular API Security Management Tool with Plugin Architecture
upload_time2025-07-08 11:33:13
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords api security cli appsentinels oauth
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # AppSentinels CLI (as-cli)

A modular, extensible command-line interface for AppSentinels API security management. Built with a lightweight core and powerful plugin architecture, this CLI provides essential functionality out-of-the-box while allowing users to install only the features they need through external plugins.

## ๐ŸŒŸ Architecture Overview

### ๐ŸŽฏ Lightweight Core
The AppSentinels CLI follows a **core + plugins** architecture:

- **Essential Commands Only**: Authentication, profiles, plugin management, and configuration
- **Minimal Dependencies**: Lean installation with just the basics
- **Fast Startup**: Quick command execution without loading unused features
- **Stable Foundation**: Core functionality that rarely changes

### ๐Ÿ”Œ Plugin Ecosystem
Extended functionality through installable plugins:

- **Production-Ready Plugins**: Fully-featured external plugins (data ingest, monitoring, etc.)
- **Community Extensible**: Framework for third-party and community plugins
- **Independent Updates**: Plugins can be updated without changing core CLI
- **Optional Installation**: Install only the features you need

## ๐ŸŒŸ Key Features

### Core CLI Features
- **๐Ÿ” OAuth 2.1 Authentication**: Secure authentication with PKCE support
- **๐Ÿข Profile Management**: Multi-environment configuration with file-based storage
- **๐Ÿ”Œ Plugin Management**: Discover, install, and manage CLI extensions
- **๐Ÿ”ง Auto-Configuration**: Automatic setup of required files and directories
- **โš™๏ธ Flexible Configuration**: Environment variables, config files, and CLI options
- **๐Ÿ“ค Multiple Output Formats**: Table, JSON, YAML, and raw output
- **๐Ÿ’ฌ Interactive Mode**: REPL-style interface for interactive usage

### Available Plugins
- **๐Ÿ‘‹ Hello World Plugin**: Example plugin for development reference (included)  
- **๐Ÿ“Š Data Ingest Plugin**: ClickHouse integration (available separately via GitHub)
- **๐Ÿ”ฎ Future Plugins**: Monitoring, alerting, reporting, and more

## ๐Ÿš€ Quick Start

### Core CLI Installation

Install the lightweight core CLI with essential commands:

#### From Source
```bash
git clone https://github.com/appsentinels/as-cli.git
cd as-cli
pip install -e .
```

#### Global Installation (When Available)
```bash
pip install appsentinels-cli
```

### What You Get Out-of-the-Box

The core CLI provides essential functionality:

```bash
# Available core commands after installation
as-cli auth login                    # OAuth authentication
as-cli profile list                  # Multi-environment profiles  
as-cli profile create prod          # Environment management
as-cli plugin list                  # Plugin discovery
as-cli init --show-only             # Configuration management
```

### Automatic Configuration

Installation automatically creates the complete configuration structure in `~/.as-cli/`:

```
~/.as-cli/
โ”œโ”€โ”€ config.yaml              # Main configuration file
โ”œโ”€โ”€ .env.template            # Environment variables template
โ”œโ”€โ”€ README.md                # Configuration documentation
โ””โ”€โ”€ profiles/                # Profile-specific configurations
    โ”œโ”€โ”€ default.yaml         # Default profile
    โ””โ”€โ”€ [profile-name].yaml  # Additional profiles
```

**Initialization Features:**
1. ๐Ÿ—๏ธ Creates `~/.as-cli/` directory structure automatically
2. ๐Ÿ“‹ Generates default profile with sensible defaults
3. ๐Ÿ“ Creates environment variables template
4. ๐Ÿ“– Provides comprehensive configuration documentation
5. ๐Ÿ’ก Shows helpful getting started instructions

### Manual Configuration Management

If you need to manually manage the configuration:

```bash
# Preview configuration structure
as-cli init --show-only

# Initialize or repair configuration
as-cli init

# Force complete re-initialization
as-cli init --force

# Check current configuration status
as-cli profile current
```

### First-Time Setup

1. **Configure Environment Variables** (Optional):
   ```bash
   cd ~/.as-cli
   cp .env.template .env
   # Edit .env with your specific values
   ```

2. **Authenticate**:
   ```bash
   as-cli auth login
   ```

3. **Create Environment-Specific Profiles**:
   ```bash
   as-cli profile create production --description "Production environment"
   as-cli profile create staging --description "Staging environment"
   ```

4. **Install Plugins** (Choose what you need):
   ```bash
   # Install example hello plugin (for development reference)
   cd external/as-cli-hello && pip install -e .
   
   # Install external plugins as needed (e.g., data ingest plugin)
   # Follow individual plugin installation instructions
   
   # Verify installed plugins
   as-cli plugin list
   ```

### Basic Usage Examples

```bash
# List available profiles
as-cli profile list

# Switch to production profile
as-cli profile switch production

# List available plugins
as-cli plugin list

# Get help
as-cli --help
```

### Plugin Usage Examples

```bash
# Use hello plugin (example/development)
as-cli hello --name "World" --language es

# Use external plugins (install separately)
# Example: after installing data ingest plugin from its repository
# as-cli ingest records --file data.parquet --table-name api_logs
# as-cli ingest view --table-name api_logs --limit 10
```

## ๐Ÿ—๏ธ Modular Architecture

### Philosophy

The AppSentinels CLI embraces a **modular design philosophy**:

- **๐ŸŽฏ Core Focus**: Essential functionality that every user needs
- **๐Ÿ“ฆ Plugin Extensions**: Advanced features available as separate packages
- **๐Ÿš€ Performance**: Fast startup by loading only required components
- **๐Ÿ”ง Maintenance**: Independent versioning and updates for core vs plugins

### Core vs Plugins

#### Core CLI Commands
Commands that are always available after installing `appsentinels-cli`:

```bash
as-cli auth login              # OAuth 2.1 authentication
as-cli profile list            # Environment profile management  
as-cli profile create prod     # Create production profile
as-cli profile switch staging  # Switch between environments
as-cli plugin list            # Discover available plugins
as-cli plugin info ingest     # Get plugin information
as-cli init                   # Configuration management
as-cli --interactive          # Interactive mode
```

#### Plugin Commands
Commands that become available after installing specific plugins:

```bash
# After: pip install as-cli-ingest
as-cli ingest config --show                    # Database configuration
as-cli ingest records --file data.parquet      # Data import
as-cli ingest view --table-name logs          # Query data

# After: pip install as-cli-hello
as-cli hello --name "World"                   # Example plugin

# Future plugins
as-cli monitor status                         # Monitoring plugin
as-cli alert create --severity high          # Alerting plugin
as-cli report generate --type security       # Reporting plugin
```

### Plugin Benefits

**For Users:**
- ๐ŸŽฏ **Install Only What You Need**: Avoid bloating your environment
- ๐Ÿš€ **Faster Performance**: Core CLI starts instantly
- ๐Ÿ”ง **Independent Updates**: Update plugins without affecting core
- ๐Ÿ’พ **Reduced Dependencies**: Minimal requirements for core functionality

**For Developers:**
- ๐Ÿ”„ **Independent Development**: Plugins can evolve separately
- ๐Ÿ“ฆ **Easier Distribution**: Publish plugins independently to PyPI
- ๐Ÿงช **Testing Isolation**: Test plugin functionality in isolation
- ๐Ÿค **Community Contributions**: Framework for third-party plugins

## ๐Ÿข Profile Management System

### Overview

Profiles enable you to manage multiple environments (development, staging, production) with completely separate configurations stored as individual files in `~/.as-cli/profiles/`.

### Profile Architecture

```
~/.as-cli/
โ”œโ”€โ”€ config.yaml              # Current active profile only
โ””โ”€โ”€ profiles/                 # Individual profile files
    โ”œโ”€โ”€ default.yaml          # Default development profile
    โ”œโ”€โ”€ production.yaml       # Production environment
    โ”œโ”€โ”€ staging.yaml          # Staging environment
    โ””โ”€โ”€ custom-env.yaml       # Custom environments
```

### Profile Commands

```bash
# Profile Management
as-cli profile list                    # List all profiles
as-cli profile list --detailed         # Detailed profile information
as-cli profile current                 # Show current active profile
as-cli profile show [profile-name]     # Show profile configuration

# Profile Switching
as-cli profile switch production       # Switch to production profile
as-cli profile switch staging --save   # Switch and persist change

# Profile Creation
as-cli profile create dev --description "Development environment"
as-cli profile create prod --copy-from staging --description "Production"
as-cli profile copy staging my-staging --description "My staging setup"

# Profile Deletion
as-cli profile delete old-env
as-cli profile delete test-env --save  # Delete and save changes

# Use specific profile for commands
as-cli --profile production ingest config --show
as-cli --profile staging ingest records --file data.parquet
```

### Profile Configuration Structure

Each profile contains comprehensive environment-specific settings:

```yaml
# profiles/production.yaml
name: production
description: Production environment
api:
  base_url: https://api.appsentinels.com
  timeout: 60
  max_retries: 5
  retry_delay: 2
auth:
  client_id: prod-client-id
  auth_url: https://auth.appsentinels.com
  token_url: https://auth.appsentinels.com/oauth/token
  redirect_uri: http://localhost:8080/callback
  scope: api:read api:write
database:
  db_type: clickhouse
  host: prod-cluster.internal
  port: 9000
  database: production_logs
  user: prod_user
  use_docker: false
  connection_timeout: 60
output:
  default_format: table
  max_width: 120
  truncate_long_values: true
  show_headers: true
  color_output: true
ingest:
  schema_file: prod-schema.json
  default_batch_size: 10000
  log_file: prod-ingestion.log
  overwrite_log: false
  enable_ip_extraction: true
  enable_telemetry: true
  continue_on_error: false
  supported_formats: [parquet, json, csv]
```

### Multi-Environment Workflow

```bash
# Development workflow
as-cli profile create dev --description "Local development"
as-cli --profile dev ingest config --host localhost --port 9000
as-cli --profile dev ingest records --file test-data.parquet

# Staging validation
as-cli profile create staging --copy-from dev --description "Staging environment"
as-cli --profile staging ingest config --host staging-db.internal
as-cli --profile staging ingest records --file staging-data.parquet

# Production deployment
as-cli profile create prod --copy-from staging --description "Production environment"
as-cli --profile prod ingest config --host prod-cluster.internal --port 9000
as-cli --profile prod ingest records --file production-data.parquet
```

## ๐Ÿ”Œ Plugin Ecosystem

### Overview

The AppSentinels CLI features a comprehensive plugin ecosystem that transforms the CLI from a monolithic tool into a modular platform. Plugins are distributed as standard Python packages and provide seamless integration with the core CLI.

### Plugin Management

```bash
# List available plugins
as-cli plugin list                     # All discoverable plugins
as-cli plugin list --installed-only    # Only installed plugins

# Get plugin information
as-cli plugin info hello               # Detailed plugin information

# Load/unload plugins (runtime control)
as-cli plugin load hello              # Load plugin for current session
as-cli plugin unload hello            # Unload plugin from current session
```

### Available Plugins

#### ๐Ÿ“Š Data Ingest Plugin (External)

A comprehensive data ingestion solution for ClickHouse databases, available as a separate plugin.

**Repository:** [github.com/vinay4appsentinels/as-cli-ingest](https://github.com/vinay4appsentinels/as-cli-ingest) (Private)

**Features:** ClickHouse integration, Parquet/JSON/CSV support, batch processing, telemetry tracking, and full profile system integration.

Refer to the [Ingest Plugin Repository](https://github.com/vinay4appsentinels/as-cli-ingest) for installation and usage instructions.

#### ๐Ÿ‘‹ Hello World Plugin (Development Example)

A simple plugin demonstrating CLI extension patterns.

**Installation:**
```bash
cd external/as-cli-hello
pip install -e .
```

**Features:**
- โœ… Multi-language greetings
- โœ… Command-line argument handling
- โœ… Plugin lifecycle demonstration
- โœ… Best practices example

**Usage:**
```bash
as-cli hello --name "World"                    # Basic greeting
as-cli hello --name "CLI" --language es --caps # Spanish, uppercase
as-cli hello --name "Plugin" --repeat 3        # Repeat greeting
```

**Documentation:** [Hello Plugin README](external/as-cli-hello/README.md)

#### ๐Ÿ”ฎ Future Plugins

The plugin architecture supports unlimited extensibility:

- **๐Ÿ“Š Monitoring Plugin**: Real-time system monitoring and alerting
- **๐Ÿ“ˆ Analytics Plugin**: Security analytics and reporting  
- **๐Ÿ”” Notification Plugin**: Multi-channel alert delivery
- **โ˜๏ธ Cloud Integration**: AWS, GCP, Azure-specific tools
- **๐Ÿ”’ Security Scanner**: Vulnerability scanning and assessment
- **๐Ÿ“‹ Compliance Plugin**: Regulatory compliance reporting

**Community Contributions Welcome!**

### Creating Custom Plugins

#### 1. Plugin Structure
```
my-plugin/
โ”œโ”€โ”€ setup.py                          # Entry points configuration
โ”œโ”€โ”€ my_plugin/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ plugin.py                     # Plugin implementation
โ”‚   โ””โ”€โ”€ handler.py                    # Command handler
โ””โ”€โ”€ README.md
```

#### 2. Plugin Implementation

**my_plugin/plugin.py**:
```python
from as_cli.core.plugin_interface import BasePlugin, PluginMetadata
from .handler import MyHandler

class MyPlugin(BasePlugin):
    @property
    def metadata(self):
        return PluginMetadata(
            name="my-plugin",
            version="1.0.0",
            description="My custom plugin for AppSentinels CLI",
            author="Your Name",
            provides_commands=["my-command"]
        )
    
    def get_command_handlers(self):
        return {"my-command": MyHandler}
    
    def on_load(self):
        print("My plugin loaded!")
    
    def on_unload(self):
        print("My plugin unloaded!")
```

**my_plugin/handler.py**:
```python
from as_cli.core.base_handler import BaseCommandHandler

class MyHandler(BaseCommandHandler):
    @property
    def command_name(self):
        return "my-command"
    
    @property
    def command_description(self):
        return "My custom command with profile awareness"
    
    def add_subcommands(self, parser):
        parser.add_argument("--option", help="Custom option")
        parser.add_argument("--env-specific", help="Environment-specific setting")
    
    async def handle_command(self, args):
        # Access current profile
        current_profile = self.config.current_profile
        
        return self.format_success_response(
            {
                "option": args.option,
                "profile": current_profile,
                "api_url": self.config.api.base_url
            },
            f"Command executed with profile '{current_profile}'"
        )
```

#### 3. Entry Points Configuration

**setup.py**:
```python
from setuptools import setup, find_packages

setup(
    name="my-cli-plugin",
    version="1.0.0",
    packages=find_packages(),
    entry_points={
        "as_cli.plugins": [
            "my-plugin = my_plugin.plugin:MyPlugin"
        ]
    },
    install_requires=["appsentinels-cli>=1.0.0"]
)
```

#### 4. Installation and Usage

```bash
# Install your plugin
pip install -e .

# Verify plugin is discovered
as-cli plugin list

# Use your plugin with different profiles
as-cli my-command --option test
as-cli --profile production my-command --option prod-value
```

### Plugin Development Best Practices

- **Profile Awareness**: Always consider current profile settings
- **Error Handling**: Implement comprehensive error handling
- **Documentation**: Include detailed help and examples
- **Testing**: Test with multiple profiles and environments
- **Versioning**: Use semantic versioning
- **Dependencies**: Minimize external dependencies


## โš™๏ธ Configuration System

### Configuration Hierarchy

The configuration system follows a clear hierarchy (highest priority first):

1. **Command-line arguments**: `--profile production`
2. **Environment variables**: `AS_DB_PASSWORD=secret`
3. **Profile configuration files**: `~/.as-cli/profiles/[name].yaml`
4. **Default values**: Built-in sensible defaults

### Environment Variables

Create `~/.as-cli/.env` from the template:

```bash
# Copy template and edit
cd ~/.as-cli
cp .env.template .env
```

**Available Environment Variables**:

```bash
# API Configuration
AS_API_BASE_URL=https://api.appsentinels.com
AS_API_TIMEOUT=30
AS_API_MAX_RETRIES=3

# OAuth Configuration
AS_CLIENT_ID=your-client-id
AS_CLIENT_SECRET=your-client-secret
AS_AUTH_URL=https://auth.appsentinels.com
AS_TOKEN_URL=https://auth.appsentinels.com/oauth/token

# Database Configuration
AS_DB_URL=clickhouse://user:password@localhost:9000/database
AS_DB_USER=default
AS_DB_PASSWORD=your-database-password
AS_DB_HOST=localhost
AS_DB_PORT=9000

# Plugin Configuration (example for external plugins)
AS_PLUGIN_CONFIG_PATH=/path/to/plugin/config
AS_ENABLE_TELEMETRY=true

# Output Configuration
AS_OUTPUT_FORMAT=table
AS_OUTPUT_COLOR=true
AS_OUTPUT_MAX_WIDTH=120

# Global Settings
AS_VERBOSE=false
AS_DEBUG=false
```

### Configuration Migration

The CLI automatically handles configuration migration:

- **Legacy single-file configs**: Automatically migrated to separate profile files
- **Version updates**: Seamless migration between configuration versions
- **Backup creation**: Original configurations are preserved during migration

## ๐Ÿ–ฅ๏ธ Interactive Mode

```bash
# Enter interactive mode
as-cli --interactive
```

**Interactive Session Example**:
```
as-cli> profile list
as-cli> profile switch production
as-cli> ingest config --show
as-cli> plugin list
as-cli> hello --name "Interactive Mode"
as-cli> help
as-cli> exit
```

## ๐Ÿ“ค Output Formats

### Table Format (Default)
```bash
as-cli profile list
```
```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Name        โ”‚ Current โ”‚ Description             โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ default     โ”‚ โœ“       โ”‚ Default configuration   โ”‚
โ”‚ production  โ”‚         โ”‚ Production environment  โ”‚
โ”‚ staging     โ”‚         โ”‚ Staging environment     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### JSON Format
```bash
as-cli profile list --output-format json
```
```json
{
  "success": true,
  "data": {
    "profiles": [
      {
        "Name": "default",
        "Current": "โœ“",
        "Description": "Default configuration"
      }
    ]
  }
}
```

### YAML Format
```bash
as-cli profile list --output-format yaml
```
```yaml
success: true
data:
  profiles:
    - Name: default
      Current: "โœ“"
      Description: Default configuration
```

## ๐Ÿ—๏ธ Architecture

### Project Structure

```
as-cli/
โ”œโ”€โ”€ appsentinels-cli.py              # Main entry point
โ”œโ”€โ”€ setup.py                         # Installation configuration
โ”œโ”€โ”€ requirements.txt                 # Python dependencies
โ”œโ”€โ”€ src/                             # Source code
โ”‚   โ”œโ”€โ”€ config.py                    # Configuration management with profiles
โ”‚   โ”œโ”€โ”€ post_install.py              # Post-installation setup
โ”‚   โ”œโ”€โ”€ core/                        # Core infrastructure
โ”‚   โ”‚   โ”œโ”€โ”€ base_handler.py          # Base command handler
โ”‚   โ”‚   โ”œโ”€โ”€ cli_processor.py         # CLI processing and routing
โ”‚   โ”‚   โ”œโ”€โ”€ auth_context.py          # Authentication context
โ”‚   โ”‚   โ”œโ”€โ”€ plugin_manager.py        # Plugin discovery and lifecycle
โ”‚   โ”‚   โ””โ”€โ”€ plugin_interface.py      # Plugin base classes and validation
โ”‚   โ””โ”€โ”€ commands/                    # Core command handlers
โ”‚       โ”œโ”€โ”€ auth_handler.py          # Authentication commands
โ”‚       โ”œโ”€โ”€ profile_handler.py       # Profile management commands
โ”‚       โ”œโ”€โ”€ plugin_handler.py        # Plugin management commands
โ”‚       โ””โ”€โ”€ init_handler.py          # Configuration initialization
โ”œโ”€โ”€ external/                        # External plugins directory
โ”‚   โ”œโ”€โ”€ as-cli-hello/                # Example hello world plugin (included)
โ”‚   โ””โ”€โ”€ README.md                    # Plugin development guide
โ”œโ”€โ”€ examples/                        # Configuration examples
โ”‚   โ”œโ”€โ”€ profiles-config.yaml         # Multi-environment setup example
โ”‚   โ””โ”€โ”€ README-profiles.md           # Profile configuration guide
โ”œโ”€โ”€ docs/                            # Additional documentation
โ””โ”€โ”€ tests/                           # Test files
```

### System Architecture

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   CLI Entry     โ”‚โ”€โ”€โ”€โ–ถโ”‚  Profile System  โ”‚โ”€โ”€โ”€โ–ถโ”‚  Configuration  โ”‚
โ”‚   Point         โ”‚    โ”‚                  โ”‚    โ”‚   Management    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Plugin System   โ”‚    โ”‚ Command Routing  โ”‚    โ”‚ Auto Initialize โ”‚
โ”‚ Discovery       โ”‚    โ”‚                  โ”‚    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Command        โ”‚    โ”‚  Data Ingest     โ”‚    โ”‚  Authentication โ”‚
โ”‚  Handlers       โ”‚    โ”‚  System          โ”‚    โ”‚  & API Access   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Plugin Architecture

```
Plugin Discovery โ†’ Plugin Validation โ†’ Plugin Loading โ†’ Command Registration
      โ†“                     โ†“                 โ†“                   โ†“
Entry Points    โ†’    BasePlugin    โ†’    Lifecycle    โ†’    CLI Integration
                     Validation         Hooks
```

### Profile System Flow

```
Installation โ†’ Auto Initialize โ†’ Profile Loading โ†’ Profile Switching โ†’ Command Execution
      โ†“              โ†“               โ†“                โ†“                     โ†“
Setup Files โ†’ Create Defaults โ†’ Load Active โ†’ Switch Context โ†’ Profile-Aware Commands
```

## ๐Ÿงช Development

### Setting up Development Environment

#### Core CLI Development

```bash
# Clone and setup core CLI
git clone https://github.com/appsentinels/as-cli.git
cd as-cli

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

# Install core CLI in development mode
pip install -e .[dev]

# Verify core functionality
as-cli --help
as-cli profile list
as-cli plugin list        # Should show no plugins initially
```

#### Plugin Development Setup

```bash
# Install example plugin for development (editable mode)
cd external/as-cli-hello && pip install -e . && cd ../..

# Install ingest plugin (private repository)
git clone https://github.com/vinay4appsentinels/as-cli-ingest.git
cd as-cli-ingest && pip install -e . && cd ../..

# Verify plugin installation
as-cli plugin list        # Should show installed plugins
as-cli hello --help       # Test hello plugin
as-cli ingest --help      # Test ingest plugin
```

### ๐Ÿ› ๏ธ Development Mode Workflow

Development mode allows rapid iteration on plugin functionality:

```bash
# 1. Install plugin in editable mode (one time)
cd external/my-plugin
pip install -e .

# 2. Make code changes
vim my_plugin/handler.py

# 3. Test immediately (no reinstall needed)
as-cli my-command --help
as-cli my-command --test-option

# 4. Test with profiles
as-cli --profile dev my-command
as-cli --profile prod my-command

# 5. Debug plugin
as-cli plugin info my-plugin
as-cli plugin load my-plugin
```

**Key Benefits:**
- **๐Ÿ”„ Instant Updates**: Changes are immediately available
- **๐Ÿšซ No Reinstall**: Skip reinstallation after modifications
- **๐Ÿ” Full Debugging**: Use logging and Python debugger
- **๐Ÿข Profile Testing**: Test with different environments

### Creating New Plugins

```bash
# Use existing plugin as template
cp -r external/as-cli-hello external/my-plugin
cd external/my-plugin

# Update plugin configuration
# 1. Edit setup.py: Change name and entry points
# 2. Edit plugin.py: Update metadata (name, commands)  
# 3. Edit handler.py: Implement command logic

# Install in development mode
pip install -e .

# Start developing with live testing
as-cli plugin list                # Verify discovery
as-cli my-command --help         # Test immediately
```

### Testing with Multiple Profiles

```bash
# Create test environments
as-cli profile create test-dev --description "Test development"
as-cli profile create test-prod --description "Test production"

# Test profile switching
as-cli --profile test-dev ingest config --host localhost
as-cli --profile test-prod ingest config --host prod-server

# Verify isolation
as-cli profile show test-dev
as-cli profile show test-prod
```

### Running Tests

```bash
# Install test dependencies
pip install -e .[dev]

# Run tests
pytest tests/

# Run with coverage
pytest --cov=src tests/

# Run specific test
pytest tests/test_profiles.py -v
```

### Code Quality

```bash
# Code formatting
black src/
black external/

# Linting
flake8 src/
flake8 external/

# Type checking
mypy src/
```

## ๐Ÿ“š Examples

### Complete Multi-Environment Setup

#### Step 1: Core CLI Setup
```bash
# Install and authenticate
pip install appsentinels-cli
as-cli auth login

# Set up environment profiles
as-cli profile create dev --description "Development environment"
as-cli profile create staging --description "Staging environment"  
as-cli profile create prod --description "Production environment"

# Verify core setup
as-cli profile list
```

#### Step 2: Install Required Plugins
```bash
# Install data ingest plugin for database operations
cd external/as-cli-ingest && pip install -e .

# Verify plugin availability
as-cli plugin list
as-cli plugin info ingest
```

#### Step 3: Configure Each Environment
```bash
# Development environment
as-cli --profile dev ingest config --host localhost --port 9000 --database dev_logs --save

# Staging environment
as-cli --profile staging ingest config --host staging-db.internal --database staging_logs --save

# Production environment
as-cli --profile prod ingest config --host prod-cluster.internal --database prod_logs --use-docker false --save
```

#### Step 4: Environment-Specific Workflows
```bash
# Development workflow
as-cli --profile dev ingest records --file dev-data.parquet --table-name test_logs

# Staging validation
as-cli --profile staging ingest records --file staging-data.parquet --table-name api_logs
as-cli --profile staging ingest view --table-name api_logs --limit 5

# Production deployment
as-cli --profile prod ingest records --file production-data.parquet --table-name api_logs --telemetry
```

### Plugin Development Workflow

```bash
# 1. Create monitoring plugin
mkdir external/as-cli-monitoring
cd external/as-cli-monitoring

# 2. Implement plugin (see plugin development section)
# 3. Install and test
pip install -e .
as-cli plugin list
as-cli monitoring --help

# 4. Test with different profiles
as-cli --profile dev monitoring status
as-cli --profile prod monitoring alerts --severity high
```

### Advanced Data Ingest Pipeline

```bash
# 1. Configure production database
as-cli --profile prod ingest config --db-url clickhouse://user:pass@prod-cluster:9000/logs

# 2. Generate schema from sample data
as-cli --profile prod ingest records --file sample.parquet --generate-schema prod-schema.json

# 3. Create table with schema
as-cli --profile prod ingest records --file sample.parquet --table-name api_logs --create-table --schema-file prod-schema.json

# 4. Bulk import with monitoring
as-cli --profile prod ingest records --dir /data/logs --table-name api_logs --batch-size 10000 --telemetry

# 5. Verify and query data
as-cli --profile prod ingest view --table-name api_logs --limit 10
as-cli --profile prod ingest view --table-name api_logs --where "status_code >= 400" --order-by "timestamp DESC"
```

## ๐Ÿค Contributing

### Plugin Contributions

1. **Develop your plugin** following the plugin development guidelines
2. **Test thoroughly** with multiple profiles and environments
3. **Include comprehensive documentation** and examples
4. **Submit as separate repository** with proper entry points
5. **Add to community plugin registry**

### Core Contributions

1. **Fork the repository**
2. **Create feature branch**: `git checkout -b feature/amazing-feature`
3. **Test with multiple profiles**: Ensure profile compatibility
4. **Update documentation**: Include profile-aware examples
5. **Commit changes**: `git commit -m 'Add amazing feature'`
6. **Push to branch**: `git push origin feature/amazing-feature`
7. **Open Pull Request**

### Development Guidelines

- **Profile Awareness**: All features should work with multiple profiles
- **Backward Compatibility**: Maintain compatibility with existing configurations
- **Auto-Initialization**: Features should work with automatic setup
- **Documentation**: Update both README and inline documentation
- **Testing**: Include tests for both single and multi-profile scenarios

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## ๐Ÿ“ž Support

- **๐Ÿ“– Documentation**: https://docs.appsentinels.com/cli
- **๐Ÿ› Issues**: https://github.com/appsentinels/as-cli/issues
- **๐Ÿ”Œ Plugin Development**: See [Plugin Development Guide](external/README.md)
- **๐Ÿข Profile Examples**: See [Profile Configuration Guide](examples/README-profiles.md)
- **๐Ÿ“ง Email**: support@appsentinels.com

## ๐Ÿ“‹ Changelog

### v2.2.0 (Current) - Modular Architecture Release

#### ๐Ÿ—๏ธ Complete Architectural Overhaul
- **Lightweight Core CLI**: Essential commands only (auth, profile, plugin, init)
- **Plugin-Based Extensions**: Advanced features moved to external plugins
- **Modular Installation**: Install only the features you need
- **Performance Optimization**: Faster startup with reduced dependencies

#### ๐Ÿ”ง Auto-Configuration System
- **Automatic initialization** on first run or installation
- **Template file generation** (`.env.template`, `README.md`)
- **Manual initialization command** (`as-cli init`)
- **Configuration repair and validation**
- **Smart first-run detection** with helpful guidance

#### ๐Ÿข Enhanced Profile Management  
- **File-based profile storage** in `~/.as-cli/profiles/`
- **Automatic legacy migration** from single-file configs
- **Profile isolation** with individual configuration files
- **Enhanced profile commands** with detailed information
- **Backup and restore** capabilities

#### ๐Ÿ“ฆ Production-Ready Plugin Ecosystem
- **as-cli-ingest**: Comprehensive data ingest plugin with ClickHouse integration
  - Database configuration and connection management
  - Parquet, JSON, CSV file import with telemetry
  - Schema generation and table creation
  - Data viewing and querying capabilities
- **as-cli-hello**: Development example plugin with best practices
- **Plugin marketplace framework**: Ready for community contributions
- **Independent versioning**: Plugins can be updated separately from core

#### ๐Ÿ”Œ Advanced Plugin System
- **Enhanced plugin discovery** via Python entry points
- **Lifecycle management** with load/unload commands
- **Plugin metadata** and validation system
- **Profile integration**: Plugins fully compatible with multi-environment profiles
- **Error isolation**: Plugin failures don't affect core CLI functionality

### v2.0.0 (Previous)

#### ๐Ÿ”Œ Plugin System
- Dynamic plugin loading via entry points
- Plugin management commands (`plugin list`, `plugin info`, etc.)
- Example hello world plugin with multilingual support
- Plugin validation and lifecycle management
- Community-extensible architecture

#### ๐Ÿข Profile Management
- Multi-environment configuration profiles
- Profile switching with `--profile` parameter
- Profile management commands (`profile create`, `profile switch`, etc.)
- Backward compatibility with existing configurations
- Environment-specific settings isolation

#### ๐Ÿ“Š External Plugin System
- Modular plugin architecture with external data ingest capabilities
- Plugin lifecycle management and discovery
- Independent plugin development and distribution
- Community-extensible framework for third-party plugins

### v1.0.0 (Initial)

- OAuth 2.1 authentication with PKCE
- Basic API management commands
- Data ingest commands with ClickHouse support
- Interactive mode
- Multiple output formats
- Basic configuration system

## ๐ŸŽฏ Roadmap

### Immediate (v2.3)

- **๐Ÿช Plugin Marketplace**: PyPI-based plugin discovery and installation
- **๐Ÿ“Š Monitoring Plugin**: Real-time system monitoring and alerting capabilities
- **๐Ÿ”’ Security Scanner Plugin**: Vulnerability assessment and security analysis
- **๐Ÿ“ˆ Analytics Plugin**: Security analytics and reporting dashboard

### Short-term (v2.4-2.5)

- **โ˜๏ธ Cloud Integration Plugins**: AWS, GCP, Azure-specific tooling
- **๐Ÿ”” Notification Plugin**: Multi-channel alert delivery (Slack, email, webhooks)
- **๐Ÿ“‹ Compliance Plugin**: Regulatory compliance reporting and automation
- **๐ŸŽ›๏ธ Web UI Plugin**: Optional web-based management interface

### Medium-term (v3.0)

- **๐Ÿข Enterprise Plugin Suite**: Role-based access control, audit logging, team management
- **๐Ÿ”„ Configuration Sync**: Profile synchronization across machines and teams
- **๐Ÿง  AI-Powered Insights**: Intelligent recommendations and automated responses
- **๐Ÿ“ฑ Mobile Plugin**: Mobile-friendly monitoring and management

### Long-term Vision

- **๐ŸŒ Plugin Ecosystem Marketplace**: Community-driven plugin repository
- **๐Ÿ”’ Enhanced Security Framework**: Plugin sandboxing and permission system
- **๐Ÿš€ Performance Engine**: Advanced caching and optimization framework
- **๐Ÿค– Automation Platform**: Full workflow automation and orchestration

### Community Goals

- **๐Ÿ‘ฅ Open Source Plugins**: Encourage community plugin development
- **๐Ÿ“š Plugin Development Kit**: Comprehensive SDK and documentation
- **๐ŸŽ“ Educational Resources**: Tutorials, workshops, and certification programs
- **๐Ÿค Partnership Program**: Integration with security and DevOps tool vendors

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "appsentinels-cli",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "api, security, cli, appsentinels, oauth",
    "author": null,
    "author_email": "AppSentinels <support@appsentinels.com>",
    "download_url": "https://files.pythonhosted.org/packages/d9/02/9f8db7fcee600ab1d1c306f3cdde86dfed4ba09fd36bac00ca0a7ddec0f6/appsentinels_cli-2.2.6.tar.gz",
    "platform": null,
    "description": "# AppSentinels CLI (as-cli)\n\nA modular, extensible command-line interface for AppSentinels API security management. Built with a lightweight core and powerful plugin architecture, this CLI provides essential functionality out-of-the-box while allowing users to install only the features they need through external plugins.\n\n## \ud83c\udf1f Architecture Overview\n\n### \ud83c\udfaf Lightweight Core\nThe AppSentinels CLI follows a **core + plugins** architecture:\n\n- **Essential Commands Only**: Authentication, profiles, plugin management, and configuration\n- **Minimal Dependencies**: Lean installation with just the basics\n- **Fast Startup**: Quick command execution without loading unused features\n- **Stable Foundation**: Core functionality that rarely changes\n\n### \ud83d\udd0c Plugin Ecosystem\nExtended functionality through installable plugins:\n\n- **Production-Ready Plugins**: Fully-featured external plugins (data ingest, monitoring, etc.)\n- **Community Extensible**: Framework for third-party and community plugins\n- **Independent Updates**: Plugins can be updated without changing core CLI\n- **Optional Installation**: Install only the features you need\n\n## \ud83c\udf1f Key Features\n\n### Core CLI Features\n- **\ud83d\udd10 OAuth 2.1 Authentication**: Secure authentication with PKCE support\n- **\ud83c\udfe2 Profile Management**: Multi-environment configuration with file-based storage\n- **\ud83d\udd0c Plugin Management**: Discover, install, and manage CLI extensions\n- **\ud83d\udd27 Auto-Configuration**: Automatic setup of required files and directories\n- **\u2699\ufe0f Flexible Configuration**: Environment variables, config files, and CLI options\n- **\ud83d\udce4 Multiple Output Formats**: Table, JSON, YAML, and raw output\n- **\ud83d\udcac Interactive Mode**: REPL-style interface for interactive usage\n\n### Available Plugins\n- **\ud83d\udc4b Hello World Plugin**: Example plugin for development reference (included)  \n- **\ud83d\udcca Data Ingest Plugin**: ClickHouse integration (available separately via GitHub)\n- **\ud83d\udd2e Future Plugins**: Monitoring, alerting, reporting, and more\n\n## \ud83d\ude80 Quick Start\n\n### Core CLI Installation\n\nInstall the lightweight core CLI with essential commands:\n\n#### From Source\n```bash\ngit clone https://github.com/appsentinels/as-cli.git\ncd as-cli\npip install -e .\n```\n\n#### Global Installation (When Available)\n```bash\npip install appsentinels-cli\n```\n\n### What You Get Out-of-the-Box\n\nThe core CLI provides essential functionality:\n\n```bash\n# Available core commands after installation\nas-cli auth login                    # OAuth authentication\nas-cli profile list                  # Multi-environment profiles  \nas-cli profile create prod          # Environment management\nas-cli plugin list                  # Plugin discovery\nas-cli init --show-only             # Configuration management\n```\n\n### Automatic Configuration\n\nInstallation automatically creates the complete configuration structure in `~/.as-cli/`:\n\n```\n~/.as-cli/\n\u251c\u2500\u2500 config.yaml              # Main configuration file\n\u251c\u2500\u2500 .env.template            # Environment variables template\n\u251c\u2500\u2500 README.md                # Configuration documentation\n\u2514\u2500\u2500 profiles/                # Profile-specific configurations\n    \u251c\u2500\u2500 default.yaml         # Default profile\n    \u2514\u2500\u2500 [profile-name].yaml  # Additional profiles\n```\n\n**Initialization Features:**\n1. \ud83c\udfd7\ufe0f Creates `~/.as-cli/` directory structure automatically\n2. \ud83d\udccb Generates default profile with sensible defaults\n3. \ud83d\udcdd Creates environment variables template\n4. \ud83d\udcd6 Provides comprehensive configuration documentation\n5. \ud83d\udca1 Shows helpful getting started instructions\n\n### Manual Configuration Management\n\nIf you need to manually manage the configuration:\n\n```bash\n# Preview configuration structure\nas-cli init --show-only\n\n# Initialize or repair configuration\nas-cli init\n\n# Force complete re-initialization\nas-cli init --force\n\n# Check current configuration status\nas-cli profile current\n```\n\n### First-Time Setup\n\n1. **Configure Environment Variables** (Optional):\n   ```bash\n   cd ~/.as-cli\n   cp .env.template .env\n   # Edit .env with your specific values\n   ```\n\n2. **Authenticate**:\n   ```bash\n   as-cli auth login\n   ```\n\n3. **Create Environment-Specific Profiles**:\n   ```bash\n   as-cli profile create production --description \"Production environment\"\n   as-cli profile create staging --description \"Staging environment\"\n   ```\n\n4. **Install Plugins** (Choose what you need):\n   ```bash\n   # Install example hello plugin (for development reference)\n   cd external/as-cli-hello && pip install -e .\n   \n   # Install external plugins as needed (e.g., data ingest plugin)\n   # Follow individual plugin installation instructions\n   \n   # Verify installed plugins\n   as-cli plugin list\n   ```\n\n### Basic Usage Examples\n\n```bash\n# List available profiles\nas-cli profile list\n\n# Switch to production profile\nas-cli profile switch production\n\n# List available plugins\nas-cli plugin list\n\n# Get help\nas-cli --help\n```\n\n### Plugin Usage Examples\n\n```bash\n# Use hello plugin (example/development)\nas-cli hello --name \"World\" --language es\n\n# Use external plugins (install separately)\n# Example: after installing data ingest plugin from its repository\n# as-cli ingest records --file data.parquet --table-name api_logs\n# as-cli ingest view --table-name api_logs --limit 10\n```\n\n## \ud83c\udfd7\ufe0f Modular Architecture\n\n### Philosophy\n\nThe AppSentinels CLI embraces a **modular design philosophy**:\n\n- **\ud83c\udfaf Core Focus**: Essential functionality that every user needs\n- **\ud83d\udce6 Plugin Extensions**: Advanced features available as separate packages\n- **\ud83d\ude80 Performance**: Fast startup by loading only required components\n- **\ud83d\udd27 Maintenance**: Independent versioning and updates for core vs plugins\n\n### Core vs Plugins\n\n#### Core CLI Commands\nCommands that are always available after installing `appsentinels-cli`:\n\n```bash\nas-cli auth login              # OAuth 2.1 authentication\nas-cli profile list            # Environment profile management  \nas-cli profile create prod     # Create production profile\nas-cli profile switch staging  # Switch between environments\nas-cli plugin list            # Discover available plugins\nas-cli plugin info ingest     # Get plugin information\nas-cli init                   # Configuration management\nas-cli --interactive          # Interactive mode\n```\n\n#### Plugin Commands\nCommands that become available after installing specific plugins:\n\n```bash\n# After: pip install as-cli-ingest\nas-cli ingest config --show                    # Database configuration\nas-cli ingest records --file data.parquet      # Data import\nas-cli ingest view --table-name logs          # Query data\n\n# After: pip install as-cli-hello\nas-cli hello --name \"World\"                   # Example plugin\n\n# Future plugins\nas-cli monitor status                         # Monitoring plugin\nas-cli alert create --severity high          # Alerting plugin\nas-cli report generate --type security       # Reporting plugin\n```\n\n### Plugin Benefits\n\n**For Users:**\n- \ud83c\udfaf **Install Only What You Need**: Avoid bloating your environment\n- \ud83d\ude80 **Faster Performance**: Core CLI starts instantly\n- \ud83d\udd27 **Independent Updates**: Update plugins without affecting core\n- \ud83d\udcbe **Reduced Dependencies**: Minimal requirements for core functionality\n\n**For Developers:**\n- \ud83d\udd04 **Independent Development**: Plugins can evolve separately\n- \ud83d\udce6 **Easier Distribution**: Publish plugins independently to PyPI\n- \ud83e\uddea **Testing Isolation**: Test plugin functionality in isolation\n- \ud83e\udd1d **Community Contributions**: Framework for third-party plugins\n\n## \ud83c\udfe2 Profile Management System\n\n### Overview\n\nProfiles enable you to manage multiple environments (development, staging, production) with completely separate configurations stored as individual files in `~/.as-cli/profiles/`.\n\n### Profile Architecture\n\n```\n~/.as-cli/\n\u251c\u2500\u2500 config.yaml              # Current active profile only\n\u2514\u2500\u2500 profiles/                 # Individual profile files\n    \u251c\u2500\u2500 default.yaml          # Default development profile\n    \u251c\u2500\u2500 production.yaml       # Production environment\n    \u251c\u2500\u2500 staging.yaml          # Staging environment\n    \u2514\u2500\u2500 custom-env.yaml       # Custom environments\n```\n\n### Profile Commands\n\n```bash\n# Profile Management\nas-cli profile list                    # List all profiles\nas-cli profile list --detailed         # Detailed profile information\nas-cli profile current                 # Show current active profile\nas-cli profile show [profile-name]     # Show profile configuration\n\n# Profile Switching\nas-cli profile switch production       # Switch to production profile\nas-cli profile switch staging --save   # Switch and persist change\n\n# Profile Creation\nas-cli profile create dev --description \"Development environment\"\nas-cli profile create prod --copy-from staging --description \"Production\"\nas-cli profile copy staging my-staging --description \"My staging setup\"\n\n# Profile Deletion\nas-cli profile delete old-env\nas-cli profile delete test-env --save  # Delete and save changes\n\n# Use specific profile for commands\nas-cli --profile production ingest config --show\nas-cli --profile staging ingest records --file data.parquet\n```\n\n### Profile Configuration Structure\n\nEach profile contains comprehensive environment-specific settings:\n\n```yaml\n# profiles/production.yaml\nname: production\ndescription: Production environment\napi:\n  base_url: https://api.appsentinels.com\n  timeout: 60\n  max_retries: 5\n  retry_delay: 2\nauth:\n  client_id: prod-client-id\n  auth_url: https://auth.appsentinels.com\n  token_url: https://auth.appsentinels.com/oauth/token\n  redirect_uri: http://localhost:8080/callback\n  scope: api:read api:write\ndatabase:\n  db_type: clickhouse\n  host: prod-cluster.internal\n  port: 9000\n  database: production_logs\n  user: prod_user\n  use_docker: false\n  connection_timeout: 60\noutput:\n  default_format: table\n  max_width: 120\n  truncate_long_values: true\n  show_headers: true\n  color_output: true\ningest:\n  schema_file: prod-schema.json\n  default_batch_size: 10000\n  log_file: prod-ingestion.log\n  overwrite_log: false\n  enable_ip_extraction: true\n  enable_telemetry: true\n  continue_on_error: false\n  supported_formats: [parquet, json, csv]\n```\n\n### Multi-Environment Workflow\n\n```bash\n# Development workflow\nas-cli profile create dev --description \"Local development\"\nas-cli --profile dev ingest config --host localhost --port 9000\nas-cli --profile dev ingest records --file test-data.parquet\n\n# Staging validation\nas-cli profile create staging --copy-from dev --description \"Staging environment\"\nas-cli --profile staging ingest config --host staging-db.internal\nas-cli --profile staging ingest records --file staging-data.parquet\n\n# Production deployment\nas-cli profile create prod --copy-from staging --description \"Production environment\"\nas-cli --profile prod ingest config --host prod-cluster.internal --port 9000\nas-cli --profile prod ingest records --file production-data.parquet\n```\n\n## \ud83d\udd0c Plugin Ecosystem\n\n### Overview\n\nThe AppSentinels CLI features a comprehensive plugin ecosystem that transforms the CLI from a monolithic tool into a modular platform. Plugins are distributed as standard Python packages and provide seamless integration with the core CLI.\n\n### Plugin Management\n\n```bash\n# List available plugins\nas-cli plugin list                     # All discoverable plugins\nas-cli plugin list --installed-only    # Only installed plugins\n\n# Get plugin information\nas-cli plugin info hello               # Detailed plugin information\n\n# Load/unload plugins (runtime control)\nas-cli plugin load hello              # Load plugin for current session\nas-cli plugin unload hello            # Unload plugin from current session\n```\n\n### Available Plugins\n\n#### \ud83d\udcca Data Ingest Plugin (External)\n\nA comprehensive data ingestion solution for ClickHouse databases, available as a separate plugin.\n\n**Repository:** [github.com/vinay4appsentinels/as-cli-ingest](https://github.com/vinay4appsentinels/as-cli-ingest) (Private)\n\n**Features:** ClickHouse integration, Parquet/JSON/CSV support, batch processing, telemetry tracking, and full profile system integration.\n\nRefer to the [Ingest Plugin Repository](https://github.com/vinay4appsentinels/as-cli-ingest) for installation and usage instructions.\n\n#### \ud83d\udc4b Hello World Plugin (Development Example)\n\nA simple plugin demonstrating CLI extension patterns.\n\n**Installation:**\n```bash\ncd external/as-cli-hello\npip install -e .\n```\n\n**Features:**\n- \u2705 Multi-language greetings\n- \u2705 Command-line argument handling\n- \u2705 Plugin lifecycle demonstration\n- \u2705 Best practices example\n\n**Usage:**\n```bash\nas-cli hello --name \"World\"                    # Basic greeting\nas-cli hello --name \"CLI\" --language es --caps # Spanish, uppercase\nas-cli hello --name \"Plugin\" --repeat 3        # Repeat greeting\n```\n\n**Documentation:** [Hello Plugin README](external/as-cli-hello/README.md)\n\n#### \ud83d\udd2e Future Plugins\n\nThe plugin architecture supports unlimited extensibility:\n\n- **\ud83d\udcca Monitoring Plugin**: Real-time system monitoring and alerting\n- **\ud83d\udcc8 Analytics Plugin**: Security analytics and reporting  \n- **\ud83d\udd14 Notification Plugin**: Multi-channel alert delivery\n- **\u2601\ufe0f Cloud Integration**: AWS, GCP, Azure-specific tools\n- **\ud83d\udd12 Security Scanner**: Vulnerability scanning and assessment\n- **\ud83d\udccb Compliance Plugin**: Regulatory compliance reporting\n\n**Community Contributions Welcome!**\n\n### Creating Custom Plugins\n\n#### 1. Plugin Structure\n```\nmy-plugin/\n\u251c\u2500\u2500 setup.py                          # Entry points configuration\n\u251c\u2500\u2500 my_plugin/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 plugin.py                     # Plugin implementation\n\u2502   \u2514\u2500\u2500 handler.py                    # Command handler\n\u2514\u2500\u2500 README.md\n```\n\n#### 2. Plugin Implementation\n\n**my_plugin/plugin.py**:\n```python\nfrom as_cli.core.plugin_interface import BasePlugin, PluginMetadata\nfrom .handler import MyHandler\n\nclass MyPlugin(BasePlugin):\n    @property\n    def metadata(self):\n        return PluginMetadata(\n            name=\"my-plugin\",\n            version=\"1.0.0\",\n            description=\"My custom plugin for AppSentinels CLI\",\n            author=\"Your Name\",\n            provides_commands=[\"my-command\"]\n        )\n    \n    def get_command_handlers(self):\n        return {\"my-command\": MyHandler}\n    \n    def on_load(self):\n        print(\"My plugin loaded!\")\n    \n    def on_unload(self):\n        print(\"My plugin unloaded!\")\n```\n\n**my_plugin/handler.py**:\n```python\nfrom as_cli.core.base_handler import BaseCommandHandler\n\nclass MyHandler(BaseCommandHandler):\n    @property\n    def command_name(self):\n        return \"my-command\"\n    \n    @property\n    def command_description(self):\n        return \"My custom command with profile awareness\"\n    \n    def add_subcommands(self, parser):\n        parser.add_argument(\"--option\", help=\"Custom option\")\n        parser.add_argument(\"--env-specific\", help=\"Environment-specific setting\")\n    \n    async def handle_command(self, args):\n        # Access current profile\n        current_profile = self.config.current_profile\n        \n        return self.format_success_response(\n            {\n                \"option\": args.option,\n                \"profile\": current_profile,\n                \"api_url\": self.config.api.base_url\n            },\n            f\"Command executed with profile '{current_profile}'\"\n        )\n```\n\n#### 3. Entry Points Configuration\n\n**setup.py**:\n```python\nfrom setuptools import setup, find_packages\n\nsetup(\n    name=\"my-cli-plugin\",\n    version=\"1.0.0\",\n    packages=find_packages(),\n    entry_points={\n        \"as_cli.plugins\": [\n            \"my-plugin = my_plugin.plugin:MyPlugin\"\n        ]\n    },\n    install_requires=[\"appsentinels-cli>=1.0.0\"]\n)\n```\n\n#### 4. Installation and Usage\n\n```bash\n# Install your plugin\npip install -e .\n\n# Verify plugin is discovered\nas-cli plugin list\n\n# Use your plugin with different profiles\nas-cli my-command --option test\nas-cli --profile production my-command --option prod-value\n```\n\n### Plugin Development Best Practices\n\n- **Profile Awareness**: Always consider current profile settings\n- **Error Handling**: Implement comprehensive error handling\n- **Documentation**: Include detailed help and examples\n- **Testing**: Test with multiple profiles and environments\n- **Versioning**: Use semantic versioning\n- **Dependencies**: Minimize external dependencies\n\n\n## \u2699\ufe0f Configuration System\n\n### Configuration Hierarchy\n\nThe configuration system follows a clear hierarchy (highest priority first):\n\n1. **Command-line arguments**: `--profile production`\n2. **Environment variables**: `AS_DB_PASSWORD=secret`\n3. **Profile configuration files**: `~/.as-cli/profiles/[name].yaml`\n4. **Default values**: Built-in sensible defaults\n\n### Environment Variables\n\nCreate `~/.as-cli/.env` from the template:\n\n```bash\n# Copy template and edit\ncd ~/.as-cli\ncp .env.template .env\n```\n\n**Available Environment Variables**:\n\n```bash\n# API Configuration\nAS_API_BASE_URL=https://api.appsentinels.com\nAS_API_TIMEOUT=30\nAS_API_MAX_RETRIES=3\n\n# OAuth Configuration\nAS_CLIENT_ID=your-client-id\nAS_CLIENT_SECRET=your-client-secret\nAS_AUTH_URL=https://auth.appsentinels.com\nAS_TOKEN_URL=https://auth.appsentinels.com/oauth/token\n\n# Database Configuration\nAS_DB_URL=clickhouse://user:password@localhost:9000/database\nAS_DB_USER=default\nAS_DB_PASSWORD=your-database-password\nAS_DB_HOST=localhost\nAS_DB_PORT=9000\n\n# Plugin Configuration (example for external plugins)\nAS_PLUGIN_CONFIG_PATH=/path/to/plugin/config\nAS_ENABLE_TELEMETRY=true\n\n# Output Configuration\nAS_OUTPUT_FORMAT=table\nAS_OUTPUT_COLOR=true\nAS_OUTPUT_MAX_WIDTH=120\n\n# Global Settings\nAS_VERBOSE=false\nAS_DEBUG=false\n```\n\n### Configuration Migration\n\nThe CLI automatically handles configuration migration:\n\n- **Legacy single-file configs**: Automatically migrated to separate profile files\n- **Version updates**: Seamless migration between configuration versions\n- **Backup creation**: Original configurations are preserved during migration\n\n## \ud83d\udda5\ufe0f Interactive Mode\n\n```bash\n# Enter interactive mode\nas-cli --interactive\n```\n\n**Interactive Session Example**:\n```\nas-cli> profile list\nas-cli> profile switch production\nas-cli> ingest config --show\nas-cli> plugin list\nas-cli> hello --name \"Interactive Mode\"\nas-cli> help\nas-cli> exit\n```\n\n## \ud83d\udce4 Output Formats\n\n### Table Format (Default)\n```bash\nas-cli profile list\n```\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Name        \u2502 Current \u2502 Description             \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 default     \u2502 \u2713       \u2502 Default configuration   \u2502\n\u2502 production  \u2502         \u2502 Production environment  \u2502\n\u2502 staging     \u2502         \u2502 Staging environment     \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### JSON Format\n```bash\nas-cli profile list --output-format json\n```\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"profiles\": [\n      {\n        \"Name\": \"default\",\n        \"Current\": \"\u2713\",\n        \"Description\": \"Default configuration\"\n      }\n    ]\n  }\n}\n```\n\n### YAML Format\n```bash\nas-cli profile list --output-format yaml\n```\n```yaml\nsuccess: true\ndata:\n  profiles:\n    - Name: default\n      Current: \"\u2713\"\n      Description: Default configuration\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\n### Project Structure\n\n```\nas-cli/\n\u251c\u2500\u2500 appsentinels-cli.py              # Main entry point\n\u251c\u2500\u2500 setup.py                         # Installation configuration\n\u251c\u2500\u2500 requirements.txt                 # Python dependencies\n\u251c\u2500\u2500 src/                             # Source code\n\u2502   \u251c\u2500\u2500 config.py                    # Configuration management with profiles\n\u2502   \u251c\u2500\u2500 post_install.py              # Post-installation setup\n\u2502   \u251c\u2500\u2500 core/                        # Core infrastructure\n\u2502   \u2502   \u251c\u2500\u2500 base_handler.py          # Base command handler\n\u2502   \u2502   \u251c\u2500\u2500 cli_processor.py         # CLI processing and routing\n\u2502   \u2502   \u251c\u2500\u2500 auth_context.py          # Authentication context\n\u2502   \u2502   \u251c\u2500\u2500 plugin_manager.py        # Plugin discovery and lifecycle\n\u2502   \u2502   \u2514\u2500\u2500 plugin_interface.py      # Plugin base classes and validation\n\u2502   \u2514\u2500\u2500 commands/                    # Core command handlers\n\u2502       \u251c\u2500\u2500 auth_handler.py          # Authentication commands\n\u2502       \u251c\u2500\u2500 profile_handler.py       # Profile management commands\n\u2502       \u251c\u2500\u2500 plugin_handler.py        # Plugin management commands\n\u2502       \u2514\u2500\u2500 init_handler.py          # Configuration initialization\n\u251c\u2500\u2500 external/                        # External plugins directory\n\u2502   \u251c\u2500\u2500 as-cli-hello/                # Example hello world plugin (included)\n\u2502   \u2514\u2500\u2500 README.md                    # Plugin development guide\n\u251c\u2500\u2500 examples/                        # Configuration examples\n\u2502   \u251c\u2500\u2500 profiles-config.yaml         # Multi-environment setup example\n\u2502   \u2514\u2500\u2500 README-profiles.md           # Profile configuration guide\n\u251c\u2500\u2500 docs/                            # Additional documentation\n\u2514\u2500\u2500 tests/                           # Test files\n```\n\n### System Architecture\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502   CLI Entry     \u2502\u2500\u2500\u2500\u25b6\u2502  Profile System  \u2502\u2500\u2500\u2500\u25b6\u2502  Configuration  \u2502\n\u2502   Point         \u2502    \u2502                  \u2502    \u2502   Management    \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n         \u2502                       \u2502                       \u2502\n         \u25bc                       \u25bc                       \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Plugin System   \u2502    \u2502 Command Routing  \u2502    \u2502 Auto Initialize \u2502\n\u2502 Discovery       \u2502    \u2502                  \u2502    \u2502                 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n         \u2502                       \u2502                       \u2502\n         \u25bc                       \u25bc                       \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502  Command        \u2502    \u2502  Data Ingest     \u2502    \u2502  Authentication \u2502\n\u2502  Handlers       \u2502    \u2502  System          \u2502    \u2502  & API Access   \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n### Plugin Architecture\n\n```\nPlugin Discovery \u2192 Plugin Validation \u2192 Plugin Loading \u2192 Command Registration\n      \u2193                     \u2193                 \u2193                   \u2193\nEntry Points    \u2192    BasePlugin    \u2192    Lifecycle    \u2192    CLI Integration\n                     Validation         Hooks\n```\n\n### Profile System Flow\n\n```\nInstallation \u2192 Auto Initialize \u2192 Profile Loading \u2192 Profile Switching \u2192 Command Execution\n      \u2193              \u2193               \u2193                \u2193                     \u2193\nSetup Files \u2192 Create Defaults \u2192 Load Active \u2192 Switch Context \u2192 Profile-Aware Commands\n```\n\n## \ud83e\uddea Development\n\n### Setting up Development Environment\n\n#### Core CLI Development\n\n```bash\n# Clone and setup core CLI\ngit clone https://github.com/appsentinels/as-cli.git\ncd as-cli\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install core CLI in development mode\npip install -e .[dev]\n\n# Verify core functionality\nas-cli --help\nas-cli profile list\nas-cli plugin list        # Should show no plugins initially\n```\n\n#### Plugin Development Setup\n\n```bash\n# Install example plugin for development (editable mode)\ncd external/as-cli-hello && pip install -e . && cd ../..\n\n# Install ingest plugin (private repository)\ngit clone https://github.com/vinay4appsentinels/as-cli-ingest.git\ncd as-cli-ingest && pip install -e . && cd ../..\n\n# Verify plugin installation\nas-cli plugin list        # Should show installed plugins\nas-cli hello --help       # Test hello plugin\nas-cli ingest --help      # Test ingest plugin\n```\n\n### \ud83d\udee0\ufe0f Development Mode Workflow\n\nDevelopment mode allows rapid iteration on plugin functionality:\n\n```bash\n# 1. Install plugin in editable mode (one time)\ncd external/my-plugin\npip install -e .\n\n# 2. Make code changes\nvim my_plugin/handler.py\n\n# 3. Test immediately (no reinstall needed)\nas-cli my-command --help\nas-cli my-command --test-option\n\n# 4. Test with profiles\nas-cli --profile dev my-command\nas-cli --profile prod my-command\n\n# 5. Debug plugin\nas-cli plugin info my-plugin\nas-cli plugin load my-plugin\n```\n\n**Key Benefits:**\n- **\ud83d\udd04 Instant Updates**: Changes are immediately available\n- **\ud83d\udeab No Reinstall**: Skip reinstallation after modifications\n- **\ud83d\udd0d Full Debugging**: Use logging and Python debugger\n- **\ud83c\udfe2 Profile Testing**: Test with different environments\n\n### Creating New Plugins\n\n```bash\n# Use existing plugin as template\ncp -r external/as-cli-hello external/my-plugin\ncd external/my-plugin\n\n# Update plugin configuration\n# 1. Edit setup.py: Change name and entry points\n# 2. Edit plugin.py: Update metadata (name, commands)  \n# 3. Edit handler.py: Implement command logic\n\n# Install in development mode\npip install -e .\n\n# Start developing with live testing\nas-cli plugin list                # Verify discovery\nas-cli my-command --help         # Test immediately\n```\n\n### Testing with Multiple Profiles\n\n```bash\n# Create test environments\nas-cli profile create test-dev --description \"Test development\"\nas-cli profile create test-prod --description \"Test production\"\n\n# Test profile switching\nas-cli --profile test-dev ingest config --host localhost\nas-cli --profile test-prod ingest config --host prod-server\n\n# Verify isolation\nas-cli profile show test-dev\nas-cli profile show test-prod\n```\n\n### Running Tests\n\n```bash\n# Install test dependencies\npip install -e .[dev]\n\n# Run tests\npytest tests/\n\n# Run with coverage\npytest --cov=src tests/\n\n# Run specific test\npytest tests/test_profiles.py -v\n```\n\n### Code Quality\n\n```bash\n# Code formatting\nblack src/\nblack external/\n\n# Linting\nflake8 src/\nflake8 external/\n\n# Type checking\nmypy src/\n```\n\n## \ud83d\udcda Examples\n\n### Complete Multi-Environment Setup\n\n#### Step 1: Core CLI Setup\n```bash\n# Install and authenticate\npip install appsentinels-cli\nas-cli auth login\n\n# Set up environment profiles\nas-cli profile create dev --description \"Development environment\"\nas-cli profile create staging --description \"Staging environment\"  \nas-cli profile create prod --description \"Production environment\"\n\n# Verify core setup\nas-cli profile list\n```\n\n#### Step 2: Install Required Plugins\n```bash\n# Install data ingest plugin for database operations\ncd external/as-cli-ingest && pip install -e .\n\n# Verify plugin availability\nas-cli plugin list\nas-cli plugin info ingest\n```\n\n#### Step 3: Configure Each Environment\n```bash\n# Development environment\nas-cli --profile dev ingest config --host localhost --port 9000 --database dev_logs --save\n\n# Staging environment\nas-cli --profile staging ingest config --host staging-db.internal --database staging_logs --save\n\n# Production environment\nas-cli --profile prod ingest config --host prod-cluster.internal --database prod_logs --use-docker false --save\n```\n\n#### Step 4: Environment-Specific Workflows\n```bash\n# Development workflow\nas-cli --profile dev ingest records --file dev-data.parquet --table-name test_logs\n\n# Staging validation\nas-cli --profile staging ingest records --file staging-data.parquet --table-name api_logs\nas-cli --profile staging ingest view --table-name api_logs --limit 5\n\n# Production deployment\nas-cli --profile prod ingest records --file production-data.parquet --table-name api_logs --telemetry\n```\n\n### Plugin Development Workflow\n\n```bash\n# 1. Create monitoring plugin\nmkdir external/as-cli-monitoring\ncd external/as-cli-monitoring\n\n# 2. Implement plugin (see plugin development section)\n# 3. Install and test\npip install -e .\nas-cli plugin list\nas-cli monitoring --help\n\n# 4. Test with different profiles\nas-cli --profile dev monitoring status\nas-cli --profile prod monitoring alerts --severity high\n```\n\n### Advanced Data Ingest Pipeline\n\n```bash\n# 1. Configure production database\nas-cli --profile prod ingest config --db-url clickhouse://user:pass@prod-cluster:9000/logs\n\n# 2. Generate schema from sample data\nas-cli --profile prod ingest records --file sample.parquet --generate-schema prod-schema.json\n\n# 3. Create table with schema\nas-cli --profile prod ingest records --file sample.parquet --table-name api_logs --create-table --schema-file prod-schema.json\n\n# 4. Bulk import with monitoring\nas-cli --profile prod ingest records --dir /data/logs --table-name api_logs --batch-size 10000 --telemetry\n\n# 5. Verify and query data\nas-cli --profile prod ingest view --table-name api_logs --limit 10\nas-cli --profile prod ingest view --table-name api_logs --where \"status_code >= 400\" --order-by \"timestamp DESC\"\n```\n\n## \ud83e\udd1d Contributing\n\n### Plugin Contributions\n\n1. **Develop your plugin** following the plugin development guidelines\n2. **Test thoroughly** with multiple profiles and environments\n3. **Include comprehensive documentation** and examples\n4. **Submit as separate repository** with proper entry points\n5. **Add to community plugin registry**\n\n### Core Contributions\n\n1. **Fork the repository**\n2. **Create feature branch**: `git checkout -b feature/amazing-feature`\n3. **Test with multiple profiles**: Ensure profile compatibility\n4. **Update documentation**: Include profile-aware examples\n5. **Commit changes**: `git commit -m 'Add amazing feature'`\n6. **Push to branch**: `git push origin feature/amazing-feature`\n7. **Open Pull Request**\n\n### Development Guidelines\n\n- **Profile Awareness**: All features should work with multiple profiles\n- **Backward Compatibility**: Maintain compatibility with existing configurations\n- **Auto-Initialization**: Features should work with automatic setup\n- **Documentation**: Update both README and inline documentation\n- **Testing**: Include tests for both single and multi-profile scenarios\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## \ud83d\udcde Support\n\n- **\ud83d\udcd6 Documentation**: https://docs.appsentinels.com/cli\n- **\ud83d\udc1b Issues**: https://github.com/appsentinels/as-cli/issues\n- **\ud83d\udd0c Plugin Development**: See [Plugin Development Guide](external/README.md)\n- **\ud83c\udfe2 Profile Examples**: See [Profile Configuration Guide](examples/README-profiles.md)\n- **\ud83d\udce7 Email**: support@appsentinels.com\n\n## \ud83d\udccb Changelog\n\n### v2.2.0 (Current) - Modular Architecture Release\n\n#### \ud83c\udfd7\ufe0f Complete Architectural Overhaul\n- **Lightweight Core CLI**: Essential commands only (auth, profile, plugin, init)\n- **Plugin-Based Extensions**: Advanced features moved to external plugins\n- **Modular Installation**: Install only the features you need\n- **Performance Optimization**: Faster startup with reduced dependencies\n\n#### \ud83d\udd27 Auto-Configuration System\n- **Automatic initialization** on first run or installation\n- **Template file generation** (`.env.template`, `README.md`)\n- **Manual initialization command** (`as-cli init`)\n- **Configuration repair and validation**\n- **Smart first-run detection** with helpful guidance\n\n#### \ud83c\udfe2 Enhanced Profile Management  \n- **File-based profile storage** in `~/.as-cli/profiles/`\n- **Automatic legacy migration** from single-file configs\n- **Profile isolation** with individual configuration files\n- **Enhanced profile commands** with detailed information\n- **Backup and restore** capabilities\n\n#### \ud83d\udce6 Production-Ready Plugin Ecosystem\n- **as-cli-ingest**: Comprehensive data ingest plugin with ClickHouse integration\n  - Database configuration and connection management\n  - Parquet, JSON, CSV file import with telemetry\n  - Schema generation and table creation\n  - Data viewing and querying capabilities\n- **as-cli-hello**: Development example plugin with best practices\n- **Plugin marketplace framework**: Ready for community contributions\n- **Independent versioning**: Plugins can be updated separately from core\n\n#### \ud83d\udd0c Advanced Plugin System\n- **Enhanced plugin discovery** via Python entry points\n- **Lifecycle management** with load/unload commands\n- **Plugin metadata** and validation system\n- **Profile integration**: Plugins fully compatible with multi-environment profiles\n- **Error isolation**: Plugin failures don't affect core CLI functionality\n\n### v2.0.0 (Previous)\n\n#### \ud83d\udd0c Plugin System\n- Dynamic plugin loading via entry points\n- Plugin management commands (`plugin list`, `plugin info`, etc.)\n- Example hello world plugin with multilingual support\n- Plugin validation and lifecycle management\n- Community-extensible architecture\n\n#### \ud83c\udfe2 Profile Management\n- Multi-environment configuration profiles\n- Profile switching with `--profile` parameter\n- Profile management commands (`profile create`, `profile switch`, etc.)\n- Backward compatibility with existing configurations\n- Environment-specific settings isolation\n\n#### \ud83d\udcca External Plugin System\n- Modular plugin architecture with external data ingest capabilities\n- Plugin lifecycle management and discovery\n- Independent plugin development and distribution\n- Community-extensible framework for third-party plugins\n\n### v1.0.0 (Initial)\n\n- OAuth 2.1 authentication with PKCE\n- Basic API management commands\n- Data ingest commands with ClickHouse support\n- Interactive mode\n- Multiple output formats\n- Basic configuration system\n\n## \ud83c\udfaf Roadmap\n\n### Immediate (v2.3)\n\n- **\ud83c\udfea Plugin Marketplace**: PyPI-based plugin discovery and installation\n- **\ud83d\udcca Monitoring Plugin**: Real-time system monitoring and alerting capabilities\n- **\ud83d\udd12 Security Scanner Plugin**: Vulnerability assessment and security analysis\n- **\ud83d\udcc8 Analytics Plugin**: Security analytics and reporting dashboard\n\n### Short-term (v2.4-2.5)\n\n- **\u2601\ufe0f Cloud Integration Plugins**: AWS, GCP, Azure-specific tooling\n- **\ud83d\udd14 Notification Plugin**: Multi-channel alert delivery (Slack, email, webhooks)\n- **\ud83d\udccb Compliance Plugin**: Regulatory compliance reporting and automation\n- **\ud83c\udf9b\ufe0f Web UI Plugin**: Optional web-based management interface\n\n### Medium-term (v3.0)\n\n- **\ud83c\udfe2 Enterprise Plugin Suite**: Role-based access control, audit logging, team management\n- **\ud83d\udd04 Configuration Sync**: Profile synchronization across machines and teams\n- **\ud83e\udde0 AI-Powered Insights**: Intelligent recommendations and automated responses\n- **\ud83d\udcf1 Mobile Plugin**: Mobile-friendly monitoring and management\n\n### Long-term Vision\n\n- **\ud83c\udf10 Plugin Ecosystem Marketplace**: Community-driven plugin repository\n- **\ud83d\udd12 Enhanced Security Framework**: Plugin sandboxing and permission system\n- **\ud83d\ude80 Performance Engine**: Advanced caching and optimization framework\n- **\ud83e\udd16 Automation Platform**: Full workflow automation and orchestration\n\n### Community Goals\n\n- **\ud83d\udc65 Open Source Plugins**: Encourage community plugin development\n- **\ud83d\udcda Plugin Development Kit**: Comprehensive SDK and documentation\n- **\ud83c\udf93 Educational Resources**: Tutorials, workshops, and certification programs\n- **\ud83e\udd1d Partnership Program**: Integration with security and DevOps tool vendors\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AppSentinels CLI - Modular API Security Management Tool with Plugin Architecture",
    "version": "2.2.6",
    "project_urls": {
        "Bug Tracker": "https://github.com/vinay4appsentinels/appsentinels-cli/issues",
        "Documentation": "https://docs.appsentinels.com/cli",
        "Homepage": "https://github.com/vinay4appsentinels/appsentinels-cli",
        "Source Code": "https://github.com/vinay4appsentinels/appsentinels-cli"
    },
    "split_keywords": [
        "api",
        " security",
        " cli",
        " appsentinels",
        " oauth"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f29063beb8d12daf3cfe42fe132cb820be15b4caeed3c4a3e8e04704527c01bc",
                "md5": "8b85beeaa3bf1a39e2de0a19f8a3def4",
                "sha256": "7cc12866545b16bfc071498f3f5367447d088034594e3fdab21eef0f5162a0f3"
            },
            "downloads": -1,
            "filename": "appsentinels_cli-2.2.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8b85beeaa3bf1a39e2de0a19f8a3def4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 47432,
            "upload_time": "2025-07-08T11:33:11",
            "upload_time_iso_8601": "2025-07-08T11:33:11.886171Z",
            "url": "https://files.pythonhosted.org/packages/f2/90/63beb8d12daf3cfe42fe132cb820be15b4caeed3c4a3e8e04704527c01bc/appsentinels_cli-2.2.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d9029f8db7fcee600ab1d1c306f3cdde86dfed4ba09fd36bac00ca0a7ddec0f6",
                "md5": "9884a5c0490a3bda9e7902b9846d1d3a",
                "sha256": "4449605c1f7fd702c20d958437a9004b0001832ab902cf0e27caff373e60ce08"
            },
            "downloads": -1,
            "filename": "appsentinels_cli-2.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "9884a5c0490a3bda9e7902b9846d1d3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 62943,
            "upload_time": "2025-07-08T11:33:13",
            "upload_time_iso_8601": "2025-07-08T11:33:13.711546Z",
            "url": "https://files.pythonhosted.org/packages/d9/02/9f8db7fcee600ab1d1c306f3cdde86dfed4ba09fd36bac00ca0a7ddec0f6/appsentinels_cli-2.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-08 11:33:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vinay4appsentinels",
    "github_project": "appsentinels-cli",
    "github_not_found": true,
    "lcname": "appsentinels-cli"
}
        
Elapsed time: 1.89394s