SIGMANTIC AI CLI - SETUP AND USAGE COMMANDS
============================================

PREREQUISITES:
- Python 3.8 or higher
- Git
- Anthropic API key (get from https://console.anthropic.com/)

INSTALLATION STEPS:
==================

1. Clone the repository:
   git clone https://github.com/sigmantic-ai/sigmantic-cli.git
   cd sigmantic-cli

2. Install the package:
   pip install -e .

3. Create config directory:
   mkdir -p ~/.sigmantic

4. Add your API key (replace 'your_api_key_here' with actual key):
   echo "ANTHROPIC_API_KEY=your_api_key_here" > ~/.sigmantic/key.cfg

5. Verify installation:
   sigmantic --help

BASIC USAGE COMMANDS:
====================

Main Menu (run without arguments):
- sigmantic                           # Shows mode selection menu

Direct IP Generator mode:
- sigmantic "Create an 8-bit counter with enable and reset"
- sigmantic "Build me a new LPDDR controller"
- sigmantic "Create a 32-bit ALU with add, subtract, AND, OR operations"
- sigmantic "Design a FIFO buffer with configurable depth and width"

TWO MODES AVAILABLE:
===================

1. IP GENERATOR AGENT - Generate RTL IP from scratch
   • Complete agentic workflow (Planning → Verification → RTL → Documentation)
   • Creates new RTL modules with testbenches
   • Best for: New designs, complex IP blocks

2. RTL EDITOR AGENT - Edit and improve existing RTL code
   • Conversational code editing like Claude Code
   • Analyze, debug, and modify existing files
   • Best for: Code review, bug fixes, improvements

RTL EDITOR COMMANDS:
===================
Once in RTL Editor mode:
- show <filename>                     # Display file contents
- list                               # List all RTL files in workspace
- "Fix the bug in counter.sv"        # Conversational editing
- "Add a reset signal to my ALU"     # Request modifications
- "Explain what this module does"    # Code analysis
- "Optimize this code for timing"    # Performance improvements
- help                               # Show help
- exit                               # End session

Workspace management:
- sigmantic --list-workspaces
- sigmantic --workspace-info

Advanced options:
- sigmantic -n "Create a simple register"  (non-interactive mode)
- sigmantic -w /path/to/workspace "Create a counter"  (specific workspace)
- sigmantic-cli "Any RTL design"  (alternative command)

QUICK TEST:
===========
sigmantic "Create a simple 2-input AND gate"

WHAT GETS CREATED:
==================
When you run sigmantic, it creates:
- rtl/ folder with .sv files
- testbenches/ folder with _tb.sv files  
- docs/ folder with documentation
- diffs/ folder with version history
- generation_log.md with complete history

TROUBLESHOOTING:
================

If you get "API key not found" error:
- Check: cat ~/.sigmantic/key.cfg
- Make sure the file contains: ANTHROPIC_API_KEY=your_actual_key

If permission issues:
- Run: chmod 600 ~/.sigmantic/key.cfg

ALTERNATIVE INSTALL (PyPI):
===========================
pip install sigmantic
mkdir -p ~/.sigmantic
echo "ANTHROPIC_API_KEY=your_api_key_here" > ~/.sigmantic/key.cfg
sigmantic --help
