Metadata-Version: 2.4
Name: endercom-cli
Version: 0.1.6
Summary: Endercom CLI
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: typer>=0.12
Requires-Dist: rich>=13.7
Requires-Dist: pyyaml>=6.0

# Endercom CLI

A command-line interface for deploying and managing AI agents on AWS Lambda using the Endercom framework.

[![PyPI version](https://img.shields.io/pypi/v/endercom-cli.svg)](https://pypi.org/project/endercom-cli/)

## Installation

```bash
pip install endercom-cli
```

## Prerequisites

Before you begin, ensure you have:

1. **An AWS Account**: You'll need credentials to deploy resources.
2. **AWS CLI Configured**: Run `aws login` to set your credentials and default region.
   ```bash
   brew install awscli
   aws login
   ```
3. **AWS SAM CLI**: Required for building and deploying the serverless stack.
   ```bash
   brew install aws-sam-cli
   ```

## Quick Start

### 1. Initialize an Agent Project

Create a new agent project structure.

```bash
endercom init <agent-name>
```

This scaffolds a directory with:

- `agent.py`: Your agent logic (where you write code)
- `app.py`: Server entry point and wrapper
- `template.yaml`: AWS SAM infrastructure definition
- `requirements.txt`: Python dependencies
- `.endercom/agent.yaml`: CLI configuration

### 2. Configure Environment (Optional)

If your agent needs API keys (e.g., `OPENAI_API_KEY`), add them to the secrets manager.

```bash
cd <agent-name>
endercom secrets set OPENAI_API_KEY "sk-..."
```

### 3. Deploy

Build and deploy your agent to AWS.

```bash
endercom deploy
```

The CLI will:

- Check your code for undeclared environment variables.
- Sync your configuration to the SAM template.
- Build the agent using `sam build`.
- Deploy using `sam deploy`.

## Commands

| Command                   | Description                                            |
| ------------------------- | ------------------------------------------------------ |
| `init <name>`             | Create a new agent project.                            |
| `deploy`                  | Build and deploy the agent stack to AWS.               |
| `configure`               | Update project configuration.                          |
| `secrets set <key> <val>` | Securely store secrets in AWS Secrets Manager.         |
| `logs`                    | Tail real-time logs from your Lambda function.         |
| `destroy`                 | Tear down the AWS stack and remove associated secrets. |

## Configuration

The source of truth for your agent's configuration is `.endercom/agent.yaml`.

```yaml
name: my-agent
runtime: python3.12
region: us-east-1
memory: 1024
timeout: 30
env:
  MY_PUBLIC_VAR: "production"
secrets:
  - OPENAI_API_KEY
```

- **env**: Standard environment variables injected at deployment.
- **secrets**: List of keys to resolve securely from AWS Secrets Manager.
