# Sixth CLI

<div align="center">
  <h1>
    <br/>
    <br/>
    🚀 Sixth CLI
    <br/>
    <br/>
  </h1>
  <sup>
    <b>AI-Powered Development Assistant</b>
    <br/>
    <br/>
    
[![npm version](https://badge.fury.io/js/sixth-cli.svg)](https://www.npmjs.com/package/sixth-cli)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
[![Node.js Version](https://img.shields.io/node/v/sixth-cli.svg)](https://nodejs.org)
  </sup>
</div>

## 🎯 Overview

Sixth CLI is a powerful command-line interface tool that brings AI assistance directly to your terminal. Built with Google's Gemini API at its core, it provides an intelligent coding companion that helps you write, debug, and understand code faster than ever before.

## ✨ Features

- **🤖 AI-Powered Assistance**: Get instant help with coding questions, debugging, and code generation
- **💬 Interactive Chat Interface**: Natural conversation flow with context awareness
- **🎨 Beautiful Terminal UI**: Syntax highlighting, markdown rendering, and multiple themes
- **⚡ Fast & Responsive**: Optimized for quick responses and minimal latency
- **🔧 Multiple AI Models**: Support for various Gemini models (Flash, Pro, etc.)
- **📝 Code Understanding**: Analyze and explain existing codebases
- **🔄 Context Management**: Smart context handling for better responses
- **🛠️ Extensible**: Plugin system for custom commands and integrations
- **🔐 Secure**: Built with privacy and security in mind

## 📦 Installation

### Prerequisites

- Node.js 20.0 or higher
- npm or yarn package manager

### Install via npm

```bash
npm install -g sixth-cli
```

### Install via yarn

```bash
yarn global add sixth-cli
```

## 🚀 Quick Start

### 1. Initialize Sixth CLI

```bash
sixth
```

On first run, you'll be prompted to authenticate with your Sixth account.

### 2. Start chatting!

```bash
sixth "How do I create a React component?"
```

## 💡 Usage Examples

### Basic Commands

```bash
# Ask a coding question
sixth "What is the difference between let and const in JavaScript?"

# Generate code
sixth "Write a Python function to calculate fibonacci numbers"

# Debug code
sixth "Why is this TypeScript code throwing an error?" < error.ts

# Explain code
sixth "Explain this SQL query" < complex_query.sql
```

### Interactive Mode

Simply run `sixth` without arguments to enter interactive mode:

```bash
sixth
```

In interactive mode, you can:
- Have continuous conversations with context
- Use slash commands for quick actions
- Access your chat history
- Switch between different AI models

### Slash Commands

Interactive mode supports various slash commands:

- `/help` - Show all available commands
- `/clear` - Clear the current conversation
- `/model` - Switch between AI models
- `/settings` - Configure Sixth CLI settings
- `/theme` - Change the color theme
- `/copy` - Copy last response to clipboard
- `/quit` - Exit Sixth CLI

## ⚙️ Configuration

Sixth CLI stores its configuration in `~/.sixth/` directory.

### Settings

Configure Sixth CLI behavior through the settings command:

```bash
sixth /settings
```

Available settings:
- **Model Selection**: Choose between Gemini Flash, Pro, or other models
- **Theme**: Select from multiple color themes
- **Output Format**: Markdown, plain text, or code-only
- **Context Size**: Adjust context window size
- **Temperature**: Control response creativity

### Environment Variables

- `SIXTH_MODEL` - Default AI model to use
- `SIXTH_THEME` - Default color theme
- `SIXTH_CONFIG_DIR` - Custom config directory path

## 🎨 Themes

Sixth CLI comes with several built-in themes:

- `default` - Balanced dark theme
- `light` - Light theme for bright environments
- `dracula` - Popular Dracula color scheme
- `github-dark` - GitHub's dark theme
- `ayu` - Minimal and modern
- `ansi` - Classic terminal colors

Change theme:
```bash
sixth /theme dracula
```

## 🔌 Extensions & Plugins

Sixth CLI supports extensions for additional functionality:

### Installing Extensions

```bash
sixth extensions install <extension-name>
```

### Creating Custom Extensions

Create a `sixth-extension.json` file:

```json
{
  "name": "my-extension",
  "version": "1.0.0",
  "commands": {
    "mycmd": {
      "description": "My custom command",
      "handler": "./handler.js"
    }
  }
}
```

## 🤝 Integration with IDEs

Sixth CLI can integrate with popular code editors:

### VS Code
```bash
sixth /ide vscode
```

### Cursor
```bash
sixth /ide cursor
```

### Zed
```bash
sixth /ide zed
```

## 📊 Usage Limits

Sixth CLI includes usage tracking to help you stay within API limits:

- **Free Tier**: 500 tokens for testing
- **Subscriber**: Unlimited usage
- View your usage: `sixth /stats`

## 🔒 Privacy & Security

- All conversations are processed locally
- API keys are stored securely in your system
- No telemetry or usage data is sent without consent
- Open source for full transparency

## 🐛 Troubleshooting

### Common Issues

**Authentication issues**
```bash
# Re-authenticate if needed
sixth /auth
```

**Permission denied error**
```bash
# Fix permissions
chmod +x $(which sixth)
```

**Clear cache and reset**
```bash
rm -rf ~/.sixth/
sixth --reset
```

### Debug Mode

Run with debug output:
```bash
DEBUG=* sixth
```

## 📚 Advanced Usage

### Piping Input

```bash
# Analyze a file
cat app.js | sixth "Review this code for security issues"

# Process command output
git diff | sixth "Explain these changes"
```

### Non-Interactive Mode

```bash
# Get quick answers without entering interactive mode
sixth --no-interactive "Quick question here"
```

### Custom Prompts

Create custom prompt templates in `~/.sixth/prompts/`:

```yaml
name: code-review
template: |
  Review the following code for:
  - Security issues
  - Performance problems
  - Best practices
  
  Code: {{input}}
```

## 🤝 Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
# Clone the repository
git clone https://github.com/yourusername/sixth-cli.git

# Install dependencies
npm install

# Build the project
npm run build

# Link for local testing
npm link
```

## 📄 License

Sixth CLI is licensed under the Apache License 2.0. See [LICENSE](LICENSE) for details.

## 🙏 Acknowledgments

- Built with Google's Gemini API
- Inspired by Claude Code and GitHub Copilot
- Terminal UI powered by Ink
- Syntax highlighting by Highlight.js

## 🔗 Links

- [Documentation](https://docs.sixth-cli.dev)
- [API Reference](https://docs.sixth-cli.dev/api)
- [GitHub Repository](https://github.com/yourusername/sixth-cli)
- [NPM Package](https://www.npmjs.com/package/sixth-cli)
- [Report Issues](https://github.com/yourusername/sixth-cli/issues)

## 💬 Support

- **Discord**: [Join our community](https://discord.gg/sixth-cli)
- **Twitter**: [@sixthcli](https://twitter.com/sixthcli)
- **Email**: support@sixth-cli.dev

---

<div align="center">
  Made with ❤️ by the Sixth CLI Team
  <br/>
  <br/>
  <b>Happy Coding! 🚀</b>
</div>