diff --git a/README.md b/README.md index 1f81fd0d..365f3f77 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@

Claude Code UI

+[中文文档 README.zh-CN](./README.zh-CN.md) A desktop and mobile UI for [Claude Code](https://docs.anthropic.com/en/docs/claude-code), and [Cursor CLI](https://docs.cursor.com/en/cli/overview). You can use it locally or remotely to view your active projects and sessions in Claude Code or Cursor and make changes to them from everywhere (mobile or desktop). This gives you a proper interface that works everywhere. Supports models including **Claude Sonnet 4**, **Opus 4.1**, and **GPT-5** @@ -35,22 +36,19 @@ A desktop and mobile UI for [Claude Code](https://docs.anthropic.com/en/docs/cla - - ## Features -- **Responsive Design** - Works seamlessly across desktop, tablet, and mobile so you can also use Claude Code from mobile +- **Responsive Design** - Works seamlessly across desktop, tablet, and mobile so you can also use Claude Code from mobile - **Interactive Chat Interface** - Built-in chat interface for seamless communication with Claude Code or Cursor - **Integrated Shell Terminal** - Direct access to Claude Code or Cursor CLI through built-in shell functionality - **File Explorer** - Interactive file tree with syntax highlighting and live editing -- **Git Explorer** - View, stage and commit your changes. You can also switch branches +- **Git Explorer** - View, stage and commit your changes. You can also switch branches - **Session Management** - Resume conversations, manage multiple sessions, and track history -- **TaskMaster AI Integration** *(Optional)* - Advanced project management with AI-powered task planning, PRD parsing, and workflow automation +- **TaskMaster AI Integration** _(Optional)_ - Advanced project management with AI-powered task planning, PRD parsing, and workflow automation - **Model Compatibility** - Works with Claude Sonnet 4, Opus 4.1, and GPT-5 - ## Quick Start ### Prerequisites @@ -70,6 +68,7 @@ npx @siteboon/claude-code-ui The server will start and be accessible at `http://localhost:3001` (or your configured PORT). **To restart**: Simply run the same `npx` command again after stopping the server + ### Global Installation (For Regular Use) For frequent use, install globally once: @@ -84,7 +83,6 @@ Then start with a simple command: claude-code-ui ``` - **To restart**: Stop with Ctrl+C and run `claude-code-ui` again. ### CLI Commands @@ -107,14 +105,13 @@ cloudcli version ``` **The `cloudcli status` command shows you:** + - Installation directory location - Database location (where credentials are stored) - Current configuration (PORT, DATABASE_PATH, etc.) - Claude projects folder location - Configuration file location -``` - ### Run as Background Service (Recommended for Production) For production use, run Claude Code UI as a background service using PM2 (Process Manager 2): @@ -135,7 +132,6 @@ pm2 start claude-code-ui --name "claude-code-ui" pm2 start cloudcli --name "claude-code-ui" ``` - #### Auto-Start on System Boot To make Claude Code UI start automatically when your system boots: @@ -148,32 +144,36 @@ pm2 startup pm2 save ``` - ### Local Development Installation 1. **Clone the repository:** + ```bash git clone https://github.com/siteboon/claudecodeui.git cd claudecodeui ``` 2. **Install dependencies:** + ```bash npm install ``` 3. **Configure environment:** + ```bash cp .env.example .env # Edit .env with your preferred settings ``` 4. **Start the application:** + ```bash # Development mode (with hot reload) npm run dev ``` + The application will start at the port you specified in your .env 5. **Open your browser:** @@ -188,50 +188,54 @@ The application will start at the port you specified in your .env To use Claude Code's full functionality, you'll need to manually enable tools: 1. **Open Tools Settings** - Click the gear icon in the sidebar -3. **Enable Selectively** - Turn on only the tools you need -4. **Apply Settings** - Your preferences are saved locally +2. **Enable Selectively** - Turn on only the tools you need +3. **Apply Settings** - Your preferences are saved locally
![Tools Settings Modal](public/screenshots/tools-modal.png) -*Tools Settings interface - enable only what you need* +_Tools Settings interface - enable only what you need_
**Recommended approach**: Start with basic tools enabled and add more as needed. You can always adjust these settings later. -## TaskMaster AI Integration *(Optional)* +## TaskMaster AI Integration _(Optional)_ Claude Code UI supports **[TaskMaster AI](https://github.com/eyaltoledano/claude-task-master)** (aka claude-task-master) integration for advanced project management and AI-powered task planning. It provides + - AI-powered task generation from PRDs (Product Requirements Documents) -- Smart task breakdown and dependency management +- Smart task breakdown and dependency management - Visual task boards and progress tracking **Setup & Documentation**: Visit the [TaskMaster AI GitHub repository](https://github.com/eyaltoledano/claude-task-master) for installation instructions, configuration guides, and usage examples. After installing it you should be able to enable it from the Settings - ## Usage Guide ### Core Features #### Project Management + The UI automatically discovers Claude Code projects from `~/.claude/projects/` and provides: + - **Visual Project Browser** - All available projects with metadata and session counts - **Project Actions** - Rename, delete, and organize projects - **Smart Navigation** - Quick access to recent projects and sessions -- **MCP support** - Add your own MCP servers through the UI +- **MCP support** - Add your own MCP servers through the UI #### Chat Interface -- **Use responsive chat or Claude Code/Cursor CLI** - You can either use the adapted chat interface or use the shell button to connect to your selected CLI. + +- **Use responsive chat or Claude Code/Cursor CLI** - You can either use the adapted chat interface or use the shell button to connect to your selected CLI. - **Real-time Communication** - Stream responses from Claude with WebSocket connection - **Session Management** - Resume previous conversations or start fresh sessions - **Message History** - Complete conversation history with timestamps and metadata - **Multi-format Support** - Text, code blocks, and file references #### File Explorer & Editor + - **Interactive File Tree** - Browse project structure with expand/collapse navigation - **Live File Editing** - Read, modify, and save files directly in the interface - **Syntax Highlighting** - Support for multiple programming languages @@ -239,19 +243,21 @@ The UI automatically discovers Claude Code projects from `~/.claude/projects/` a #### Git Explorer +#### TaskMaster AI Integration _(Optional)_ -#### TaskMaster AI Integration *(Optional)* - **Visual Task Board** - Kanban-style interface for managing development tasks - **PRD Parser** - Create Product Requirements Documents and parse them into structured tasks - **Progress Tracking** - Real-time status updates and completion tracking #### Session Management + - **Session Persistence** - All conversations automatically saved - **Session Organization** - Group sessions by project and timestamp - **Session Actions** - Rename, delete, and export conversation history - **Cross-device Sync** - Access sessions from any device ### Mobile App + - **Responsive Design** - Optimized for all screen sizes - **Touch-friendly Interface** - Swipe gestures and touch navigation - **Mobile Navigation** - Bottom tab bar for easy thumb navigation @@ -270,6 +276,7 @@ The UI automatically discovers Claude Code projects from `~/.claude/projects/` a ``` ### Backend (Node.js + Express) + - **Express Server** - RESTful API with static file serving - **WebSocket Server** - Communication for chats and project refresh - **CLI Integration (Claude Code / Cursor)** - Process spawning and management @@ -277,24 +284,23 @@ The UI automatically discovers Claude Code projects from `~/.claude/projects/` a - **File System API** - Exposing file browser for projects ### Frontend (React + Vite) + - **React 18** - Modern component architecture with hooks - **CodeMirror** - Advanced code editor with syntax highlighting - - - - ### Contributing We welcome contributions! Please follow these guidelines: #### Getting Started + 1. **Fork** the repository 2. **Clone** your fork: `git clone ` 3. **Install** dependencies: `npm install` 4. **Create** a feature branch: `git checkout -b feature/amazing-feature` #### Development Process + 1. **Make your changes** following the existing code style 2. **Test thoroughly** - ensure all features work correctly 3. **Run quality checks**: `npm run lint && npm run format` @@ -306,6 +312,7 @@ We welcome contributions! Please follow these guidelines: - Test results if applicable #### What to Contribute + - **Bug fixes** - Help us improve stability - **New features** - Enhance functionality (discuss in issues first) - **Documentation** - Improve guides and API docs @@ -316,23 +323,25 @@ We welcome contributions! Please follow these guidelines: ### Common Issues & Solutions - #### "No Claude projects found" + **Problem**: The UI shows no projects or empty project list **Solutions**: + - Ensure [Claude CLI](https://docs.anthropic.com/en/docs/claude-code) is properly installed - Run `claude` command in at least one project directory to initialize - Verify `~/.claude/projects/` directory exists and has proper permissions #### File Explorer Issues + **Problem**: Files not loading, permission errors, empty directories **Solutions**: + - Check project directory permissions (`ls -la` in terminal) - Verify the project path exists and is accessible - Review server console logs for detailed error messages - Ensure you're not trying to access system directories outside project scope - ## License GNU General Public License v3.0 - see [LICENSE](LICENSE) file for details. @@ -342,22 +351,26 @@ This project is open source and free to use, modify, and distribute under the GP ## Acknowledgments ### Built With + - **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** - Anthropic's official CLI - **[React](https://react.dev/)** - User interface library - **[Vite](https://vitejs.dev/)** - Fast build tool and dev server - **[Tailwind CSS](https://tailwindcss.com/)** - Utility-first CSS framework - **[CodeMirror](https://codemirror.net/)** - Advanced code editor -- **[TaskMaster AI](https://github.com/eyaltoledano/claude-task-master)** *(Optional)* - AI-powered project management and task planning +- **[TaskMaster AI](https://github.com/eyaltoledano/claude-task-master)** _(Optional)_ - AI-powered project management and task planning ## Support & Community ### Stay Updated + - **Star** this repository to show support - **Watch** for updates and new releases - **Follow** the project for announcements ### Sponsors + - [Siteboon - AI powered website builder](https://siteboon.ai) + ---
diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 00000000..49c28070 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,334 @@ +
+ Claude Code UI +

Claude Code UI

+
+ +一个用于 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 和 [Cursor CLI](https://docs.cursor.com/en/cli/overview) 的桌面与移动端 Web 界面。你可以在本地或远程使用它,方便地查看 Claude Code / Cursor 中的活动项目与会话,并在任意设备(手机或电脑)上进行修改。支持 **Claude Sonnet 4**、**Opus 4.1**、**GPT-5** 等多种模型。 + +--- + +## 目录 + +- [功能特性](#功能特性) +- [快速开始](#快速开始) +- [安全与工具配置](#安全与工具配置) +- [TaskMaster AI 集成(可选)](#taskmaster-ai-集成可选) +- [使用指南](#使用指南) +- [移动端体验](#移动端体验) +- [架构概览](#架构概览) +- [贡献指南](#贡献指南) +- [故障排查](#故障排查) +- [许可证](#许可证) +- [致谢](#致谢) +- [社区与支持](#社区与支持) + +--- + +## 功能特性 + +- **自适应布局**:在桌面、平板和手机上都能正常工作,便于你在移动端使用 Claude Code +- **交互式聊天界面**:内置聊天界面,可与 Claude Code 或 Cursor 无缝交互 +- **集成 Shell 终端**:通过内置终端直接访问 Claude Code / Cursor CLI +- **文件浏览器**:交互式文件树,支持语法高亮和在线编辑 +- **Git 浏览器**:查看、暂存并提交修改,可切换分支 +- **会话管理**:恢复对话、管理多会话并查看历史记录 +- **TaskMaster AI 集成(可选)**:提供 AI 驱动的项目管理、PRD 解析与任务规划 +- **模型兼容性**:支持 Claude Sonnet 4、Opus 4.1 和 GPT-5 等模型 + +--- + +## 快速开始 + +### 环境要求 + +- [Node.js](https://nodejs.org/) v20 或更高版本 +- 已安装并配置好的 [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) 和/或 +- 已安装并配置好的 [Cursor CLI](https://docs.cursor.com/en/cli/overview) + +### 一键运行(推荐) + +无需安装,直接运行: + +```bash +npx @siteboon/claude-code-ui +``` + +服务启动后默认可通过 `http://localhost:3001`(或你配置的 PORT)访问。 + +**重启方式**:停止服务后再次运行相同的 `npx` 命令即可。 + +### 全局安装(适合经常使用) + +```bash +npm install -g @siteboon/claude-code-ui +``` + +安装完成后: + +```bash +claude-code-ui +``` + +**重启方式**:使用 `Ctrl+C` 停止服务,然后再次运行 `claude-code-ui`。 + +### CLI 命令 + +全局安装后,你可以使用 `claude-code-ui` 和 `cloudcli` 两组命令: + +```bash +# 启动服务(默认命令) +claude-code-ui +cloudcli start + +# 查看配置与数据路径 +cloudcli status + +# 查看帮助 +cloudcli help + +# 查看版本 +cloudcli version +``` + +`cloudcli status` 会显示: + +- 安装目录位置 +- 数据库存储位置(凭据保存位置) +- 当前配置(PORT、DATABASE_PATH 等) +- Claude 项目目录位置 +- 配置文件路径 + +### 作为后台服务运行(生产环境推荐) + +使用 PM2 将 Claude Code UI 以后台服务方式运行: + +```bash +npm install -g pm2 +``` + +启动服务: + +```bash +pm2 start claude-code-ui --name "claude-code-ui" +# 或使用别名 +pm2 start cloudcli --name "claude-code-ui" +``` + +开机自启: + +```bash +pm2 startup +pm2 save +``` + +### 本地开发 + +1. 克隆仓库: + +```bash +git clone https://github.com/siteboon/claudecodeui.git +cd claudecodeui +``` + +2. 安装依赖: + +```bash +npm install +``` + +3. 配置环境变量: + +```bash +cp .env.example .env +# 根据需要编辑 .env +``` + +4. 启动开发服务器: + +```bash +npm run dev +``` + +应用将运行在 `.env` 中设置的端口上(默认 `3001`)。 + +5. 浏览器访问: + +- 开发环境:`http://localhost:3001` + +--- + +## 安全与工具配置 + +> **重要提示**:所有 Claude Code 工具默认处于禁用状态,以避免潜在危险操作被自动执行。 + +启用工具步骤: + +1. 打开工具设置(侧边栏齿轮图标) +2. 根据需要选择性启用工具 +3. 应用设置(偏好会保存在本地) + +建议:先只启用基础工具,后续按需逐步开启更多能力。 + +--- + +## TaskMaster AI 集成(可选) + +Claude Code UI 支持与 **[TaskMaster AI](https://github.com/eyaltoledano/claude-task-master)** 集成,用于更高级的项目管理与任务规划: + +- 从 PRD 自动生成任务 +- 智能拆解任务与依赖管理 +- 看板视图与进度追踪 + +安装与配置方法请参考其 GitHub 仓库文档,安装完成后可在本项目设置中启用。 + +--- + +## 使用指南 + +### 项目管理 + +UI 会自动从 `~/.claude/projects/` 读取 Claude Code 项目,并提供: + +- 可视化项目浏览 +- 项目重命名、删除与整理 +- 最近项目与会话快捷访问 +- MCP 服务器管理(在 UI 中添加你自己的 MCP) + +### 聊天界面 + +- 可在自适应聊天界面与 Claude Code / Cursor CLI 间切换 +- WebSocket 实时流式响应 +- 支持会话恢复与多会话管理 +- 完整消息历史与元数据 +- 支持文本、代码块与文件引用 + +### 文件浏览与编辑 + +- 交互式文件树 +- 在线编辑并保存 +- 多语言语法高亮 +- 基本文件操作(新建、重命名、删除) + +### Git 浏览 + +- 查看变更 +- 暂存与提交 +- 分支切换等(具体能力取决于配置) + +### 会话管理 + +- 自动保存所有会话 +- 按项目与时间组织 +- 重命名、删除、导出会话 +- 跨设备访问(通过统一服务端) + +--- + +## 移动端体验 + +- 自适应移动端布局 +- 触控优化(滑动、点击区域) +- 底部导航栏,便于单手操作 +- 可添加到主屏幕,以 PWA 方式运行 + +--- + +## 架构概览 + +整体架构示意: + +```text +┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ +│ 前端 │ │ 后端 │ │ Claude CLI │ +│ (React/Vite) │◄──►│ (Express/WS) │◄──►│ 集成 │ +└─────────────────┘ └─────────────────┘ └─────────────────┘ +``` + +### 后端(Node.js + Express) + +- Express 服务与 REST API +- WebSocket 服务(聊天与项目刷新) +- 与 Claude Code / Cursor 的 CLI 进程管理 +- 会话持久化(JSONL 等) +- 文件系统 API(提供项目文件浏览与编辑) + +### 前端(React + Vite) + +- 使用 React 18 组件化架构 +- 基于 CodeMirror 的代码编辑器 +- Tailwind CSS 构建界面样式 + +--- + +## 贡献指南 + +非常欢迎社区贡献!简单流程: + +1. Fork 仓库 +2. 克隆到本地:`git clone ` +3. 安装依赖:`npm install` +4. 新建分支:`git checkout -b feature/my-feature` +5. 按现有代码风格进行开发 +6. 运行校验:`npm run lint && npm run format` +7. 提交并推送:`git push origin feature/my-feature` +8. 提交 Pull Request,附上变更说明、必要截图与测试结果 + +--- + +## 故障排查 + +### “No Claude projects found” + +可能原因:没有检测到 Claude 项目。 + +排查建议: + +- 确认已正确安装 [Claude CLI](https://docs.anthropic.com/en/docs/claude-code) +- 在至少一个项目目录中运行一次 `claude` 命令 +- 检查 `~/.claude/projects/` 目录是否存在且有权限 + +### 文件浏览器问题 + +如果出现文件无法加载、权限错误或目录为空: + +- 检查项目目录权限(终端运行 `ls -la`) +- 确认项目路径存在且可访问 +- 查看服务器日志以获取详细错误信息 +- 确保没有尝试访问项目目录外的系统路径 + +--- + +## 许可证 + +本项目使用 **GNU General Public License v3.0**。 + +详情请参见仓库中的 [LICENSE](LICENSE) 文件。 + +你可以在 GPL v3 协议下自由使用、修改和分发本项目。 + +--- + +## 致谢 + +本项目基于以下关键技术构建: + +- **[Claude Code](https://docs.anthropic.com/en/docs/claude-code)** +- **[React](https://react.dev/)** +- **[Vite](https://vitejs.dev/)** +- **[Tailwind CSS](https://tailwindcss.com/)** +- **[CodeMirror](https://codemirror.net/)** +- **[TaskMaster AI](https://github.com/eyaltoledano/claude-task-master)**(可选) + +--- + +## 社区与支持 + +- 欢迎 Star 本仓库支持项目 +- 关注更新与新版本发布 +- 如有问题或建议,可通过 Issue 反馈 + +--- + +
+ 为 Claude Code 社区用心打造。 +
diff --git a/src/components/ChatInterface.jsx b/src/components/ChatInterface.jsx index 0ced6857..1073a83c 100644 --- a/src/components/ChatInterface.jsx +++ b/src/components/ChatInterface.jsx @@ -27,6 +27,7 @@ import ClaudeLogo from './ClaudeLogo.jsx'; import CursorLogo from './CursorLogo.jsx'; import NextTaskBanner from './NextTaskBanner.jsx'; import { useTasksSettings } from '../contexts/TasksSettingsContext'; +import { useTranslation } from '../i18n'; import ClaudeStatus from './ClaudeStatus'; import TokenUsagePie from './TokenUsagePie'; @@ -362,6 +363,8 @@ const MessageComponent = memo(({ message, index, prevMessage, createDiff, onFile (prevMessage.type === 'error')); const messageRef = React.useRef(null); const [isExpanded, setIsExpanded] = React.useState(false); + const { translate } = useTranslation(); + React.useEffect(() => { if (!autoExpandTools || !messageRef.current || !message.isToolUse) return; @@ -1528,7 +1531,7 @@ const MessageComponent = memo(({ message, index, prevMessage, createDiff, onFile {showThinking && message.reasoning && (
- 💭 Thinking... + 💭 {translate('chat.thinking')}
@@ -1642,6 +1645,7 @@ const ImageAttachment = ({ file, onRemove, uploadProgress, error }) => { // This ensures uninterrupted chat experience by pausing sidebar refreshes during conversations. function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, messages, onFileOpen, onInputFocusChange, onSessionActive, onSessionInactive, onSessionProcessing, onSessionNotProcessing, processingSessions, onReplaceTemporarySession, onNavigateToSession, onShowSettings, autoExpandTools, showRawParameters, showThinking, autoScrollToBottom, sendByCtrlEnter, externalMessageUpdate, onTaskClick, onShowAllTasks }) { const { tasksEnabled } = useTasksSettings(); + const { translate } = useTranslation(); const [input, setInput] = useState(() => { if (typeof window !== 'undefined' && selectedProject) { return safeLocalStorage.getItem(`draft_input_${selectedProject.name}`) || ''; @@ -4193,16 +4197,16 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess
-

Loading session messages...

+

{translate('chatInterface.loadingMessages')}

) : chatMessages.length === 0 ? (
{!selectedSession && !currentSessionId && (
-

Choose Your AI Assistant

+

{translate('chatInterface.chooseAssistant')}

- Select a provider to start a new conversation + {translate('chatInterface.selectProvider')}

@@ -4294,10 +4298,10 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess

{provider === 'claude' - ? 'Ready to use Claude AI. Start typing your message below.' + ? translate('chatInterface.readyClaude') : provider === 'cursor' - ? `Ready to use Cursor with ${cursorModel}. Start typing your message below.` - : 'Select a provider above to begin' + ? translate('chatInterface.readyCursor', { model: cursorModel }) + : translate('chatInterface.selectProviderPrompt') }

@@ -4409,7 +4413,7 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess
- Thinking... + {translate('chat.thinking')}
@@ -4689,7 +4693,7 @@ function ChatInterface({ selectedProject, selectedSession, ws, sendMessage, mess type="button" onClick={open} className="absolute left-2 top-1/2 transform -translate-y-1/2 p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors" - title="Attach images" + title={translate('chat.attachImages')} > diff --git a/src/components/CommandMenu.jsx b/src/components/CommandMenu.jsx index 4420aed5..05f3346d 100644 --- a/src/components/CommandMenu.jsx +++ b/src/components/CommandMenu.jsx @@ -1,4 +1,5 @@ import React, { useEffect, useRef } from 'react'; +import { useTranslation } from '../i18n'; /** * CommandMenu - Autocomplete dropdown for slash commands @@ -12,6 +13,7 @@ import React, { useEffect, useRef } from 'react'; * @param {Array} frequentCommands - Array of frequently used command objects */ const CommandMenu = ({ commands = [], selectedIndex = -1, onSelect, onClose, position = { top: 0, left: 0 }, isOpen = false, frequentCommands = [] }) => { + const { translate } = useTranslation(); const menuRef = useRef(null); const selectedItemRef = useRef(null); @@ -103,7 +105,7 @@ const CommandMenu = ({ commands = [], selectedIndex = -1, onSelect, onClose, pos textAlign: 'center' }} > - No commands available + {translate('commands.noCommands', { defaultValue: 'No commands available' })}
); } @@ -133,11 +135,11 @@ const CommandMenu = ({ commands = [], selectedIndex = -1, onSelect, onClose, pos const orderedNamespaces = namespaceOrder.filter(ns => groupedCommands[ns]); const namespaceLabels = { - frequent: '⭐ Frequently Used', - builtin: 'Built-in Commands', - project: 'Project Commands', - user: 'User Commands', - other: 'Other Commands' + frequent: `⭐ ${translate('commands.frequentlyUsed', { defaultValue: 'Frequently Used' })}`, + builtin: translate('commands.builtinCommands', { defaultValue: 'Built-in Commands' }), + project: translate('commands.projectCommands', { defaultValue: 'Project Commands' }), + user: translate('commands.userCommands', { defaultValue: 'User Commands' }), + other: translate('commands.otherCommands', { defaultValue: 'Other Commands' }) }; // Calculate global index for each command @@ -277,7 +279,9 @@ const CommandMenu = ({ commands = [], selectedIndex = -1, onSelect, onClose, pos textOverflow: 'ellipsis' }} > - {command.description} + {command.namespace === 'builtin' && command.name.startsWith('/') + ? translate(`commands.${command.name}`, { defaultValue: command.description }) + : command.description}
)}
diff --git a/src/components/GitSettings.jsx b/src/components/GitSettings.jsx index 91b0902a..ca87423c 100644 --- a/src/components/GitSettings.jsx +++ b/src/components/GitSettings.jsx @@ -3,8 +3,10 @@ import { Button } from './ui/button'; import { Input } from './ui/input'; import { GitBranch, Check } from 'lucide-react'; import { authenticatedFetch } from '../utils/api'; +import { useTranslation } from '../i18n'; function GitSettings() { + const { translate } = useTranslation(); const [gitName, setGitName] = useState(''); const [gitEmail, setGitEmail] = useState(''); const [gitConfigLoading, setGitConfigLoading] = useState(false); @@ -61,47 +63,47 @@ function GitSettings() {
-

Git Configuration

+

{translate('gitSettings.title')}

- Configure your git identity for commits. These settings will be applied globally via git config --global + {translate('gitSettings.description')} git config --global

setGitName(e.target.value)} - placeholder="John Doe" + placeholder={translate('gitSettings.gitNamePlaceholder')} disabled={gitConfigLoading} className="w-full" />

- Your name for git commits + {translate('gitSettings.gitNameDesc')}

setGitEmail(e.target.value)} - placeholder="john@example.com" + placeholder={translate('gitSettings.gitEmailPlaceholder')} disabled={gitConfigLoading} className="w-full" />

- Your email for git commits + {translate('gitSettings.gitEmailDesc')}

@@ -110,13 +112,13 @@ function GitSettings() { onClick={saveGitConfig} disabled={gitConfigSaving || !gitName || !gitEmail} > - {gitConfigSaving ? 'Saving...' : 'Save Configuration'} + {gitConfigSaving ? translate('common.saving') : translate('gitSettings.saveConfig')} {saveStatus === 'success' && (
- Saved successfully + {translate('gitSettings.savedSuccess')}
)}
diff --git a/src/components/LoginForm.jsx b/src/components/LoginForm.jsx index f2a490a1..24b04619 100644 --- a/src/components/LoginForm.jsx +++ b/src/components/LoginForm.jsx @@ -1,8 +1,10 @@ import React, { useState } from 'react'; import { useAuth } from '../contexts/AuthContext'; import { MessageSquare } from 'lucide-react'; +import { useTranslation } from '../i18n'; const LoginForm = () => { + const { translate } = useTranslation(); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); @@ -15,7 +17,7 @@ const LoginForm = () => { setError(''); if (!username || !password) { - setError('Please enter both username and password'); + setError(translate('loginForm.errorBothRequired')); return; } @@ -41,9 +43,9 @@ const LoginForm = () => {
-

Welcome Back

+

{translate('loginForm.welcomeBack')}

- Sign in to your Claude Code UI account + {translate('loginForm.signInDesc')}

@@ -51,7 +53,7 @@ const LoginForm = () => {
{ value={username} onChange={(e) => setUsername(e.target.value)} className="w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" - placeholder="Enter your username" + placeholder={translate('loginForm.enterUsername')} required disabled={isLoading} /> @@ -67,7 +69,7 @@ const LoginForm = () => {
{ value={password} onChange={(e) => setPassword(e.target.value)} className="w-full px-3 py-2 border border-border rounded-md bg-background text-foreground focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" - placeholder="Enter your password" + placeholder={translate('loginForm.enterPassword')} required disabled={isLoading} /> @@ -92,13 +94,13 @@ const LoginForm = () => { disabled={isLoading} className="w-full bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-medium py-2 px-4 rounded-md transition-colors duration-200" > - {isLoading ? 'Signing in...' : 'Sign In'} + {isLoading ? translate('loginForm.signingIn') : translate('loginForm.signIn')}

- Enter your credentials to access Claude Code UI + {translate('loginForm.enterCredentials')}

diff --git a/src/components/MainContent.jsx b/src/components/MainContent.jsx index 58a8749e..4073bc27 100644 --- a/src/components/MainContent.jsx +++ b/src/components/MainContent.jsx @@ -27,6 +27,7 @@ import Tooltip from './Tooltip'; import { useTaskMaster } from '../contexts/TaskMasterContext'; import { useTasksSettings } from '../contexts/TasksSettingsContext'; import { api } from '../utils/api'; +import { useTranslation } from '../i18n'; function MainContent({ selectedProject, @@ -71,10 +72,11 @@ function MainContent({ const [selectedPRD, setSelectedPRD] = useState(null); const [existingPRDs, setExistingPRDs] = useState([]); const [prdNotification, setPRDNotification] = useState(null); - + // TaskMaster context const { tasks, currentProject, refreshTasks, setCurrentProject } = useTaskMaster(); const { tasksEnabled, isTaskMasterInstalled, isTaskMasterReady } = useTasksSettings(); + const { translate } = useTranslation(); // Only show tasks tab if TaskMaster is installed and enabled const shouldShowTasksTab = tasksEnabled && isTaskMasterInstalled; @@ -271,13 +273,13 @@ function MainContent({
-

Choose Your Project

+

{translate('mainContent.chooseProject')}

- Select a project from the sidebar to start coding with Claude. Each project contains your chat sessions and file history. + {translate('mainContent.chooseProjectDesc')}

- 💡 Tip: {isMobile ? 'Tap the menu button above to access projects' : 'Create a new project by clicking the folder icon in the sidebar'} + 💡 {translate('mainContent.tip')} {isMobile ? translate('mainContent.tipMobile') : translate('mainContent.tipDesktop')}

@@ -331,7 +333,7 @@ function MainContent({ ) : activeTab === 'chat' && !selectedSession ? (

- New Session + {translate('sidebar.newSession')}

{selectedProject.displayName} @@ -340,10 +342,10 @@ function MainContent({ ) : (

- {activeTab === 'files' ? 'Project Files' : - activeTab === 'git' ? 'Source Control' : - (activeTab === 'tasks' && shouldShowTasksTab) ? 'TaskMaster' : - 'Project'} + {activeTab === 'files' ? translate('navigation.projectFiles') : + activeTab === 'git' ? translate('navigation.sourceControl') : + (activeTab === 'tasks' && shouldShowTasksTab) ? translate('navigation.tasks') : + translate('navigation.project')}

{selectedProject.displayName} @@ -357,7 +359,7 @@ function MainContent({ {/* Modern Tab Navigation - Right Side */}
- + - + - + - + {shouldShowTasksTab && ( - + diff --git a/src/components/MobileNav.jsx b/src/components/MobileNav.jsx index 9940b421..74d4a8b1 100644 --- a/src/components/MobileNav.jsx +++ b/src/components/MobileNav.jsx @@ -1,35 +1,42 @@ import React from 'react'; import { MessageSquare, Folder, Terminal, GitBranch, Globe, CheckSquare } from 'lucide-react'; import { useTasksSettings } from '../contexts/TasksSettingsContext'; +import { useTranslation } from '../i18n'; function MobileNav({ activeTab, setActiveTab, isInputFocused }) { const { tasksEnabled } = useTasksSettings(); + const { translate } = useTranslation(); const navItems = [ { id: 'chat', icon: MessageSquare, - onClick: () => setActiveTab('chat') + onClick: () => setActiveTab('chat'), + label: translate('navigation.chat') }, { id: 'shell', icon: Terminal, - onClick: () => setActiveTab('shell') + onClick: () => setActiveTab('shell'), + label: translate('navigation.shell') }, { id: 'files', icon: Folder, - onClick: () => setActiveTab('files') + onClick: () => setActiveTab('files'), + label: translate('navigation.files') }, { id: 'git', icon: GitBranch, - onClick: () => setActiveTab('git') + onClick: () => setActiveTab('git'), + label: translate('navigation.sourceControl') }, // Conditionally add tasks tab if enabled ...(tasksEnabled ? [{ id: 'tasks', icon: CheckSquare, - onClick: () => setActiveTab('tasks') + onClick: () => setActiveTab('tasks'), + label: translate('navigation.tasks') }] : []) ]; @@ -57,7 +64,7 @@ function MobileNav({ activeTab, setActiveTab, isInputFocused }) { ? 'text-blue-600 dark:text-blue-400' : 'text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white' }`} - aria-label={item.id} + aria-label={item.label || item.id} > {isActive && ( diff --git a/src/components/NextTaskBanner.jsx b/src/components/NextTaskBanner.jsx index 2a55cb8c..2064390a 100644 --- a/src/components/NextTaskBanner.jsx +++ b/src/components/NextTaskBanner.jsx @@ -5,8 +5,10 @@ import { useTaskMaster } from '../contexts/TaskMasterContext'; import { api } from '../utils/api'; import Shell from './Shell'; import TaskDetail from './TaskDetail'; +import { useTranslation } from '../i18n'; const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { + const { translate } = useTranslation(); const { nextTask, tasks, currentProject, isLoadingTasks, projectTaskMaster, refreshTasks, refreshProjects } = useTaskMaster(); const [showDetails, setShowDetails] = useState(false); const [showTaskOptions, setShowTaskOptions] = useState(false); @@ -68,7 +70,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => {
- TaskMaster AI is not configured + {translate('taskBanner.notConfigured')}
@@ -80,7 +82,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { className="text-xs px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white rounded transition-colors flex items-center gap-1" > - Initialize TaskMaster AI + {translate('taskBanner.initializeButton')}
@@ -90,14 +92,14 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { {!projectTaskMaster?.hasTaskmaster && (

- 🎯 What is TaskMaster? + 🎯 {translate('taskBanner.whatIsTaskMaster')}

-

AI-Powered Task Management: Break complex projects into manageable subtasks

-

PRD Templates: Generate tasks from Product Requirements Documents

-

Dependency Tracking: Understand task relationships and execution order

-

Progress Visualization: Kanban boards and detailed task analytics

-

CLI Integration: Use taskmaster commands for advanced workflows

+

{translate('taskBanner.aiPowered')} {translate('taskBanner.aiPoweredDesc')}

+

{translate('taskBanner.prdTemplates')} {translate('taskBanner.prdTemplatesDesc')}

+

{translate('taskBanner.dependencyTracking')} {translate('taskBanner.dependencyTrackingDesc')}

+

{translate('taskBanner.progressVisualization')} {translate('taskBanner.progressVisualizationDesc')}

+

{translate('taskBanner.cliIntegration')} {translate('taskBanner.cliIntegrationDesc')}

)} @@ -108,12 +110,12 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { onClick={() => setShowCLI(true)} > - Initialize TaskMaster + {translate('taskBanner.initializeTaskMaster')} ) : ( <>
- Add more tasks: Create additional tasks manually or generate them from a PRD template + {translate('taskBanner.addMoreTasks')} {translate('taskBanner.addMoreTasksDesc')}
)} @@ -151,19 +153,19 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => {
- Task {nextTask.id} + {translate('taskBanner.task')} {nextTask.id} {nextTask.priority === 'high' && ( -
+
)} {nextTask.priority === 'medium' && ( -
+
)} {nextTask.priority === 'low' && ( -
+
)} @@ -179,12 +181,12 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { className="text-xs px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-md font-medium transition-colors shadow-sm flex items-center gap-1" > - Start Task + {translate('taskBanner.startTask')} @@ -192,7 +194,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { @@ -216,7 +218,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => {
- {completedTasks === totalTasks ? "All done! 🎉" : "No pending tasks"} + {completedTasks === totalTasks ? translate('taskBanner.allDone') : translate('taskBanner.noPendingTasks')}
@@ -227,7 +229,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { onClick={onShowAllTasks} className="text-xs px-2 py-1 bg-purple-600 hover:bg-purple-700 text-white rounded transition-colors" > - Review + {translate('taskBanner.review')}
@@ -277,8 +279,8 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => {
-

TaskMaster Setup

-

Interactive CLI for {currentProject?.displayName}

+

{translate('taskBanner.taskmasterSetup')}

+

{translate('taskBanner.interactiveCLI')} {currentProject?.displayName}

@@ -336,6 +338,7 @@ const NextTaskBanner = ({ onShowAllTasks, onStartTask, className = '' }) => { // Simple Create Task Modal Component const CreateTaskModal = ({ currentProject, onClose, onTaskCreated }) => { + const { t } = useTranslation(); const [formData, setFormData] = useState({ title: '', description: '', @@ -376,7 +379,7 @@ const CreateTaskModal = ({ currentProject, onClose, onTaskCreated }) => {
-

Create New Task

+

{translate('taskBanner.createNewTask')}

{formData.useAI ? (