Skip to content

AndersHsueh/Alice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 Yellow Silk / Alice

Node.js License Terminal

A minimalist terminal interface for AI conversations, inspired by QwenCode. Yellow Silk is the core engine, while Alice is the user-facing QwenCode-style interface with multi-role AI capabilities.

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/yourusername/yellow-silk.git
cd yellow-silk

# Install dependencies
npm install

# Configure your API key (recommended)
export OPENAI_API_KEY=your_openai_api_key_here

# Start Alice (QwenCode-style interface)
npm run alice

# Or start the traditional interface
npm start

🎯 Features

Alice Interface (QwenCode Style)

  • ✨ Professional TUI: Fixed 5-line status bar with real-time information
  • 🎨 Full Unicode Support: Perfect Chinese/English mixed text handling
  • πŸ€– Multi-Role System: Switch between 5 specialized AI roles instantly
  • ⚑ YOLO Mode: Experimental high-speed response mode
  • πŸ’­ Thinking Process: See AI's internal reasoning steps
  • 🐞 Debug Mode: Detailed logging for development

Core Capabilities

  • πŸ”„ Single/Multiple Mode: -p flag for single queries, interactive mode for conversations
  • πŸ”’ Secure Configuration: API keys via environment variables or config file
  • πŸ“Š Token Tracking: Real-time token usage monitoring
  • πŸ”„ Dynamic Role Switching: Change AI personality/role during conversation
  • πŸ“ Command System: 10+ built-in commands for enhanced control

Professional Roles

Role Specialty Best For
Rody Technical Analysis Code debugging, logical problems, precise information
Ani Emotional Companion Casual conversation, emotional support, intimate chatting
Elena Medical Consultant Health advice, wellness planning, preventive care
Maya Creative Partner Art design, brainstorming, creative block breaking
Aris Wisdom Mentor Life decisions, philosophical questions, deep thinking

πŸ–₯️ Interface Preview

                    ✨ Alice ✨                    
       A minimalist terminal interface for AI conversations       
                                                     
                   ⌨️  Commands:                    
              /exit      - Exit the application      
           /clear     - Clear the conversation history 
             /help      - Show help information      
             /role      - Switch to different AI roles
──────────────────────────────────────────────────────
πŸ‘€ You: Hello! How are you today?

πŸ€– AI: I'm doing well! I'm ready to help you with whatever you need. 
       What would you like to discuss today?

──────────────────────────────────────────────────────
⏳ Loading...                                   ⚑ YOLO MODE 
──────────────────────────────────────────────────────
* Type your message...                                   
──────────────────────────────────────────────────────
cwd: ~/workspace/yellow-silk | Role: Rody | Tokens: 124

πŸ“‹ Usage

Basic Commands

# Start Alice interface
npm run alice

# Single prompt mode (execute once and exit)
npm run alice -- -p "Explain quantum computing in simple terms"

# Traditional interface (fallback)
npm start

In-App Commands

Command Description Example
/exit or /quit Exit the application /exit
/clear Clear conversation history /clear
/help Show help information /help
/role <name> Switch to specific role /role maya
/roles List available roles /roles
/model Show current model info /model
/think Show thinking process example /think
/config Display configuration details /config
/debug Toggle debug logging /debug
/yolo Toggle YOLO mode (experimental) /yolo

Role Switching Examples

/role elena
How can I improve my sleep quality?

/role aris
What is the meaning of a good life?

/role maya
I need help designing a logo for my startup

βš™οΈ Configuration

Main Config File: config/y-silk.jsonc

{
  // AI Model Configuration
  "aiModelSettings": {
    "common": "lmstudio:openai/gpt-oss-20b",  // Default model
    "providers": [
      {
        "name": "lmstudio",
        "apiKey": "optional-key",
        "baseUrl": "http://127.0.0.1:1234/v1",
        "models": [
          {
            "name": "openai/gpt-oss-20b",
            "temperature": 0.7,
            "systemPromptFile": "./roles/ani.md"
          }
        ]
      }
    ]
  },
  "defaults": {
    "temperature": 0.7,
    "maxTokens": 1000,
    "systemPromptFile": "default.md"
  }
}

Security Best Practices

# Set API keys via environment variables (recommended)
export OPENAI_API_KEY=your_secure_api_key
export ANTHROPIC_API_KEY=your_secure_api_key

# Then remove apiKeys section from config/y-silk.jsonc

πŸ› οΈ Development

Project Structure

yellow-silk/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ entry/
β”‚   β”‚   └── index.js         # Main entry point with QwenCode-style UI
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ ai.js            # AI communication module
β”‚   β”‚   β”œβ”€β”€ config.js        # Configuration loader
β”‚   β”‚   └── utils.js         # Character width utilities
β”‚   └── ui/
β”‚       └── qwencode.js      # QwenCode-style TUI renderer
β”œβ”€β”€ config/
β”‚   └── y-silk.jsonc         # Configuration file
β”œβ”€β”€ roles/                   # Role definition files
β”‚   β”œβ”€β”€ rody.md              # Technical assistant
β”‚   β”œβ”€β”€ ani.md               # Emotional companion
β”‚   β”œβ”€β”€ elena.md             # Medical consultant
β”‚   β”œβ”€β”€ maya.md              # Creative partner
β”‚   β”œβ”€β”€ aris.md              # Wisdom mentor
β”‚   └── roles.md.template    # Role template
β”œβ”€β”€ package.json             # Project dependencies
└── docs/                    # Additional documentation

Creating New Roles

  1. Copy the template:
    cp roles/roles.md.template roles/new_role.md
  2. Fill in the template sections
  3. Test with /role new_role

Building & Testing

# Install dependencies
npm install

# Run linting
npm run lint

# Run tests (if available)
npm test

# Start in development mode (watch mode)
npm run dev

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Create a Pull Request

Guidelines

  • Follow existing code style and conventions
  • Add tests for new features
  • Update documentation when necessary
  • Keep commits focused and atomic
  • Write meaningful commit messages

πŸ”§ Troubleshooting

Common Issues

Problem: Terminal display issues or garbled text
Solution: Ensure your terminal supports ANSI escape sequences (most modern terminals do)

Problem: API key errors
Solution: Verify API keys are correctly set in environment variables or config file

Problem: Chinese character display issues
Solution: Use a terminal font that supports CJK characters (e.g., Noto Sans CJK, Source Han Sans)

Problem: Application crashes on startup
Solution: Run with debug mode enabled:

DEBUG=true npm run alice

Debug Mode

# Enable debug logging
DEBUG=true npm run alice

# Or use the /debug command in-app
/debug

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by QwenCode's elegant terminal interface
  • Built with Node.js and ANSI escape sequences for maximum performance
  • Role system inspired by advanced AI agent architectures
  • Character width calculations adapted from terminal handling best practices

πŸ“ž Contact

For questions or support, please open an issue on GitHub or contact the maintainer.


Yellow Silk ❀️ Alice - Where minimalist design meets powerful AI capabilities.

About

Alice - AI Assistant Repository

Resources

Stars

Watchers

Forks

Packages

No packages published