Metadata-Version: 2.4
Name: nashagents
Version: 0.1.0
Summary: In-house CLI agentic tool for NashTech — define, manage, and invoke AI agents from anywhere.
Author-email: NashTech <dev@nashtech.com>
License: MIT
Keywords: cli,ai,agents,llm,devtools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: litellm>=1.40
Requires-Dist: rich>=13.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: prompt-toolkit>=3.0
Requires-Dist: python-dotenv>=1.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Dynamic: license-file

# 🤖 NashAgents

**In-house CLI agentic tool for NashTech** — define, manage, and invoke AI agents from anywhere.

NashAgents is a pip-installable CLI tool that lets your team run pre-built domain-specific AI agents or create custom ones through simple YAML config files.

---

## ⚡ Quick Start

```bash
# Install
cd cli_agentic_tool_tryout
pip install -e .

# See all agents
nashagents list

# Run an agent
nashagents run backend-dev

# Create a custom agent
nashagents create my-agent --interactive
```

## 📦 Installation

### From source (development)

```bash
git clone <repo-url>
cd cli_agentic_tool_tryout
pip install -e .
```

### As a package (production)

```bash
pip install nashagents
```

## 🔑 Configuration

### 1. Set up your LLM provider

Copy the env template and add your API key:

```bash
cp .env.example .env
# Edit .env with your keys
```

**Supported providers** (via [litellm](https://docs.litellm.ai/)):

| Provider | Environment Variable | Model Format |
|----------|---------------------|--------------|
| OpenAI | `OPENAI_API_KEY` | `openai/gpt-4o` |
| Azure OpenAI | `AZURE_API_KEY` + `AZURE_API_BASE` | `azure/gpt-4o` |
| Google Gemini | `GEMINI_API_KEY` | `gemini/gemini-pro` |
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic/claude-3-sonnet` |

### 2. Initialize config

```bash
nashagents init
```

This creates `~/.nashagents/` with default configuration.

### 3. Set a default model

```bash
nashagents config --set-model openai/gpt-4o
```

---

## 🤖 Pre-built Agents

| Agent | Description | Tags |
|-------|-------------|------|
| `backend-dev` | Backend APIs, databases, microservices | development, backend, python |
| `frontend-dev` | React, Angular, Vue, CSS, responsive UI | development, frontend, ui |
| `devops` | Docker, K8s, CI/CD, cloud, IaC | infrastructure, devops, cloud |
| `qa-engineer` | Test strategies, automation, quality | testing, qa, automation |
| `technical-writer` | Docs, APIs, READMEs, tutorials | writing, documentation |
| `code-reviewer` | Code quality, security, performance | review, security, quality |
| `data-engineer` | ETL, SQL, pipelines, analytics | data, etl, sql, pipeline |
| `architect` | System design, HLD/LLD, tech stack | architecture, design |

---

## 📋 CLI Commands

### List agents

```bash
nashagents list                  # All agents
nashagents list --tag backend    # Filter by tag
```

### Run an agent

```bash
nashagents run backend-dev                          # Interactive chat
nashagents run backend-dev --model openai/gpt-4o    # Override model
nashagents run code-reviewer --message "Review app.py"  # Single shot
nashagents run frontend-dev --no-stream             # Disable streaming
```

### Interactive session commands

| Command | Action |
|---------|--------|
| `/help` | Show available commands |
| `/model` | Show current model |
| `/tokens` | Show message count |
| `/clear` | Clear conversation history |
| `/agent` | Show agent details |
| `/quit` | Exit session |

### Create a custom agent

```bash
# Quick create
nashagents create my-agent -d "My custom agent" -s "You are a helpful assistant"

# Interactive wizard
nashagents create my-agent --interactive

# With all options
nashagents create security-auditor \
  --description "Security audit specialist" \
  --system-prompt "You are a cybersecurity expert..." \
  --model openai/gpt-4o \
  --tools shell,file_read \
  --tags security,audit
```

### Manage agents

```bash
nashagents info backend-dev      # Show agent details
nashagents delete my-agent       # Delete custom agent
nashagents config --show         # Show config info
```

---

## 📝 Custom Agent Config (YAML)

Create custom agents by adding YAML files to `~/.nashagents/agents/`:

```yaml
name: "security-auditor"
description: "Security audit specialist for code and infrastructure"
version: "1.0"

system_prompt: |
  You are a cybersecurity expert specializing in application security.
  Analyze code for vulnerabilities, misconfigurations, and security risks.
  Follow OWASP guidelines and provide remediation steps.

model: "openai/gpt-4o"      # Optional: override default model
temperature: 0.2             # Low for precise analysis
max_tokens: 4096

tools:                       # Available: shell, file_read, file_write, web_search
  - shell
  - file_read

tags:
  - security
  - audit
  - compliance
```

---

## 🔧 Available Tools

| Tool | Description |
|------|-------------|
| `shell` | Execute shell commands (tests, builds, git, etc.) |
| `file_read` | Read file contents |
| `file_write` | Write/create files |
| `web_search` | Search the web (requires API key) |

---

## 🏗️ Project Structure

```
nashagents/
├── __init__.py          # Package metadata
├── cli.py               # CLI commands (Click)
├── config.py            # YAML config management
├── runner.py            # Agent execution engine
├── tools.py             # Built-in tool implementations
├── ui.py                # Rich terminal UI
└── builtin_agents/      # Pre-built agent YAML configs
    ├── backend_dev.yaml
    ├── frontend_dev.yaml
    ├── devops.yaml
    ├── qa_engineer.yaml
    ├── technical_writer.yaml
    ├── code_reviewer.yaml
    ├── data_engineer.yaml
    └── architect.yaml
```

---

## 🤝 Adding Agents for Your Team

1. **Create a YAML config** in `~/.nashagents/agents/`
2. **Share configs** via your org's git repo or internal package registry
3. **Override built-in agents** by creating a custom agent with the same name

---

## 📄 License

MIT
