A powerful desktop application that replicates the Claude Code CLI experience using React, TypeScript, and Electron. Features real-time AI chat, file operations, shell command execution, and professional terminal styling.
- Support for OpenAI (GPT models) and Anthropic (Claude models)
- Real-time streaming responses
- Configurable temperature and token limits
- Multiple AI provider switching
- Claude Code inspired dark theme
- Full markdown support with syntax highlighting
- Code blocks with language detection
- Responsive design with proper scaling
- Read files:
read file path/to/file.txt - List directories:
list filesorls /path/to/dir - File dialogs for opening and saving
- Safe file operations with error handling
- Execute commands:
!ls -la,!git status,!npm install - Persistent terminal sessions with
cdsupport - Real-time command output streaming
- Working directory management (
pwd,cd) - Cross-platform shell support
- Code analysis:
analyze code src/App.tsx - Project structure analysis:
analyze project - Error fix suggestions:
suggest fix <error message> - Code generation:
generate code React hook for counter - Mock AI agent with swappable architecture
Ctrl+N- New chatCtrl+Shift+C- Clear chatEnter- Send messageShift+Enter- New lineEscape- Focus input field
- Native desktop application
- System tray integration
- Auto-updater support
- Cross-platform builds (Windows, macOS, Linux)
- Singularity 이미지 다운로드:
wget https://github.com/kwonah0/dtui2-react/releases/latest/download/dtui2-latest.sif- 바로 실행:
# Headless 모드
singularity run dtui2-latest.sif headless
# 설정 디렉토리와 함께 실행
mkdir -p config logs
singularity run --bind config:/app/data --bind logs:/app/logs dtui2-latest.sif headless# 이미지 다운로드 및 실행
docker pull ghcr.io/kwonah0/dtui2-react:latest
docker run -it ghcr.io/kwonah0/dtui2-react:latest
# 설정 및 로그 디렉토리 바인드
docker run -it -v $(pwd)/config:/app/data -v $(pwd)/logs:/app/logs ghcr.io/kwonah0/dtui2-react:latest- Node.js 16+ and npm
- An OpenAI API key or Anthropic API key
- Clone and install dependencies:
git clone https://github.com/kwonah0/dtui2-react.git
cd dtui2-react
npm install- Configure environment:
cp .env.example .env
# Edit .env and add your API keys- Development mode:
npm run electron:dev- Build for production:
npm run distCreate a .env file with your configuration:
# Required: At least one API key
REACT_APP_OPENAI_API_KEY=your_openai_api_key_here
REACT_APP_ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Optional: Provider settings
REACT_APP_DEFAULT_PROVIDER=openai
REACT_APP_DEFAULT_MODEL=gpt-3.5-turbo
REACT_APP_TEMPERATURE=0.7
REACT_APP_MAX_TOKENS=4000OpenAI:
gpt-3.5-turbo(recommended for speed)gpt-4gpt-4-turbo-preview
Anthropic:
claude-3-haiku-20240307(fastest)claude-3-sonnet-20240229(balanced)claude-3-opus-20240229(most capable)
Hello! How can I help you today?
read file package.json
list files
ls src/components
!pwd
!ls -la
!git status
!npm run build
analyze code src/App.tsx # Analyze code structure and patterns
analyze project # Analyze entire project structure
suggest fix TypeError: map undefined # Get error fix suggestions
generate code React hook for counter # Generate code from prompt
help # Show all available commands
read file src/App.tsx and explain the component structure
!git status # Check git status
cd src && !ls -la # Change directory and list files
npm run dev- Start Vite development server (browser testing)npm run test:browser- Same as above (alias)npm run electron:dev- Start Electron in development modenpm run build- Build for productionnpm run preview- Preview production build
npm run setup:wsl- Setup WSL development environmentscripts/dev-server.sh- Clean start development serverscripts/kill-port.sh 3000- Kill processes on specific portscripts/check-status.sh- Check system and service status
npm run dist- Build and package for current platformnpm run dist:win- Build for Windowsnpm run dist:mac- Build for macOSnpm run dist:linux- Build for Linux
dtui2-react/
├── electron/ # Electron main process
│ ├── main.js # Main process entry point
│ └── preload.js # Preload script for IPC
├── src/
│ ├── components/ # React components
│ │ ├── Header.tsx # App header with controls
│ │ ├── ChatArea.tsx # Message display area
│ │ ├── Message.tsx # Individual message component
│ │ ├── InputArea.tsx # Message input component
│ │ └── TerminalOutput.tsx # Real-time terminal output
│ ├── services/ # Business logic
│ │ ├── AIProvider.ts # AI integration service
│ │ ├── MockAIAgent.ts # Mock AI agent with swappable interface
│ │ └── MockElectronAPI.ts # Mock Electron API for browser testing
│ ├── types.ts # TypeScript type definitions
│ ├── App.tsx # Main React component
│ ├── main.tsx # React entry point
│ └── index.css # Global styles
├── docs/ # Documentation
│ ├── DEVELOPMENT.md # Development guide
│ ├── TROUBLESHOOTING.md # Troubleshooting guide
│ └── PROCESS_MANAGEMENT.md # Process management tips
├── scripts/ # Development scripts
│ ├── setup-wsl.sh # WSL setup script
│ ├── dev-server.sh # Clean development start
│ ├── kill-port.sh # Port management
│ └── check-status.sh # System status check
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite build configuration
└── README.md # This file
- New UI Components: Add to
src/components/ - Business Logic: Add to
src/services/ - Electron APIs: Extend
electron/main.jsandelectron/preload.js - Styling: Use emotion/styled or extend
src/index.css
The app uses CSS custom properties for theming. Extend src/index.css:
:root {
--bg-primary: #your-color;
--text-primary: #your-color;
/* ... other theme variables ... */
}Add new Electron IPC handlers in electron/main.js:
ipcMain.handle('your-new-api', async (_, ...args) => {
// Your implementation
return result;
});Expose in electron/preload.js:
contextBridge.exposeInMainWorld('electronAPI', {
yourNewAPI: (...args) => ipcRenderer.invoke('your-new-api', ...args),
});사용자가 가져다 쓸 수 있도록 다음 파일들이 자동으로 배포됩니다:
- 파일:
dtui2-latest.sif또는dtui2-v1.2.1.sif - 다운로드: GitHub Releases
- 사용법:
singularity run dtui2-latest.sif headless
- 레지스트리:
ghcr.io/kwonah0/dtui2-react:latest - 사용법:
docker pull ghcr.io/kwonah0/dtui2-react:latest - 자동 빌드: GitHub Actions로 태그 시 자동 빌드/배포
- Container Deployment Guide - 상세한 컨테이너 사용법
- HPC Deployment Guide - HPC 환경 배포 가이드
The app uses electron-builder for packaging:
# Build for current platform
npm run dist
# Build for specific platforms
npm run dist:win # Windows
npm run dist:mac # macOS
npm run dist:linux # LinuxExecutables will be created in the release/ directory.
To enable auto-updates, configure electron-builder with your release server:
{
"build": {
"publish": {
"provider": "github",
"owner": "your-username",
"repo": "dtui2-react"
}
}
}Recommended approach - Browser testing:
npm run dev # Start Vite server
# Open http://localhost:3000 in browserIf port 3000 is in use:
scripts/kill-port.sh 3000 # Kill processes on port
scripts/dev-server.sh # Clean start"No API key configured" error:
- Make sure you've created a
.envfile with valid API keys - Check that the environment variable names match exactly
- For testing, Mock AI Agent works without API keys
Electron app won't start in WSL:
- Use browser testing instead:
npm run test:browser - Install GUI libraries:
npm run setup:wsl(requires sudo) - Alternative: Run on Windows directly
Port already in use:
- Check:
scripts/check-status.sh - Kill:
scripts/kill-port.sh 3000 - Or:
lsof -ti:3000 | xargs kill -9
Commands not working:
- In browser: Mock API simulates all functionality
- In Electron: Real file/shell operations available
- Make sure you're testing the right environment
📚 Read the documentation:
docs/DEVELOPMENT.md- Complete development guidedocs/TROUBLESHOOTING.md- Detailed troubleshootingdocs/PROCESS_MANAGEMENT.md- Process and port management
- Use
gpt-3.5-turboinstead ofgpt-4for faster responses - Limit
MAX_TOKENSto reduce response time - Consider using
claude-3-haikufor Anthropic (fastest model) - For development: Mock AI Agent provides instant responses
MIT License - see LICENSE file for details.
- Inspired by the original DTUI2 Python terminal app
- Built with Electron, React, and Vite
- UI styling inspired by Claude Code interface
Happy Coding! 🎉