feat: 添加初始项目结构和基础文件
CI - 构建、测试和质量检查 / Rust 代码检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / 单元测试 (push) Has been cancelled
CI - 构建、测试和质量检查 / 代码格式检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / Clippy 代码质量检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs, ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled

- 添加 Rust GUI 桌面应用程序入口点
- 添加 TypeScript/JavaScript 项目基础结构文件
- 包含组件、工具、命令、服务和工具定义
- 添加配置文件如 .gitignore、.gitattributes 和 LICENSE
- 包含图片资源和演示文件
- 为各种功能模块添加占位符和类型定义
This commit is contained in:
2026-04-20 16:58:22 +08:00
commit 1a1254f045
2376 changed files with 585447 additions and 0 deletions
+136
View File
@@ -0,0 +1,136 @@
#!/bin/bash
# Claude Code Rust - Linux Installation Script
# This script installs Claude Code Rust CLI tool on Linux
# Default installation directory
INSTALL_DIR="$HOME/.claude-code"
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--install-dir)
INSTALL_DIR="$2"
shift # past argument
shift # past value
;;
*)
echo "Unknown argument: $1"
exit 1
;;
esac
done
echo "==========================================="
echo "Claude Code Rust - Linux Installation"
echo "==========================================="
echo
# Check if Rust is installed
if ! command -v cargo &> /dev/null; then
echo "Error: Rust is not installed. Please install Rust first from https://rustup.rs/"
exit 1
fi
# Check if Git is installed
if ! command -v git &> /dev/null; then
echo "Error: Git is not installed. Please install Git first."
exit 1
fi
# Set installation directory
BIN_DIR="$INSTALL_DIR/bin"
echo "Installing Claude Code Rust to: $INSTALL_DIR"
echo
# Create directories
mkdir -p "$INSTALL_DIR"
mkdir -p "$BIN_DIR"
# Clone repository
echo "Cloning repository..."
if [ -d "$INSTALL_DIR/claude-code-rust" ]; then
rm -rf "$INSTALL_DIR/claude-code-rust"
fi
git clone https://github.com/lorryjovens-hub/claude-code-rust "$INSTALL_DIR/claude-code-rust"
if [ $? -ne 0 ]; then
echo "Error: Failed to clone repository"
exit 1
fi
# Build project
echo "Building project..."
cd "$INSTALL_DIR/claude-code-rust"
cargo build --release
if [ $? -ne 0 ]; then
echo "Error: Failed to build project"
exit 1
fi
# Copy executable
echo "Copying executable..."
cp "$INSTALL_DIR/claude-code-rust/target/release/claude-code" "$BIN_DIR/claude-code"
chmod +x "$BIN_DIR/claude-code"
# Add to PATH
echo "Adding to PATH..."
if ! grep -q "$BIN_DIR" ~/.bashrc && ! grep -q "$BIN_DIR" ~/.zshrc; then
if [ -f ~/.bashrc ]; then
echo "export PATH=\"$BIN_DIR:\$PATH\"" >> ~/.bashrc
echo "Added $BIN_DIR to ~/.bashrc"
elif [ -f ~/.zshrc ]; then
echo "export PATH=\"$BIN_DIR:\$PATH\"" >> ~/.zshrc
echo "Added $BIN_DIR to ~/.zshrc"
else
echo "Warning: Could not find ~/.bashrc or ~/.zshrc. Please add $BIN_DIR to your PATH manually."
fi
else
echo "$BIN_DIR is already in PATH"
fi
# Create configuration directory
CONFIG_DIR="$HOME/.config/claude-code"
mkdir -p "$CONFIG_DIR"
# Create default config file
CONFIG_FILE="$CONFIG_DIR/config.toml"
if [ ! -f "$CONFIG_FILE" ]; then
cat > "$CONFIG_FILE" << EOF
[api]
api_key = ""
base_url = "https://api.deepseek.com"
[model]
model = "deepseek-reasoner"
[log]
level = "info"
EOF
echo "Created default configuration file at $CONFIG_FILE"
fi
# Test installation
echo "Testing installation..."
"$BIN_DIR/claude-code" --help
if [ $? -eq 0 ]; then
echo "==========================================="
echo "Installation successful!"
echo "==========================================="
echo "You can now use 'claude-code' command from any terminal."
echo ""
echo "To configure API key, run:"
echo " claude-code config set api_key \"your-api-key\""
echo ""
echo "To test the installation, run:"
echo " claude-code query --prompt \"Hello!\""
echo ""
echo "Note: You may need to restart your terminal for the PATH changes to take effect."
else
echo "Error: Installation failed. Please check the output above."
exit 1
fi
# Return to original directory
cd - > /dev/null
+109
View File
@@ -0,0 +1,109 @@
#!/usr/bin/env pwsh
# Claude Code Rust - Windows Installation Script
# This script installs Claude Code Rust CLI tool on Windows
param(
[string]$InstallDir = "$env:LOCALAPPDATA\temp\claude-code\install"
)
Write-Host "==========================================="
Write-Host "Claude Code Rust - Windows Installation"
Write-Host "==========================================="
Write-Host
# Check if Rust is installed
if (-not (Get-Command cargo -ErrorAction SilentlyContinue)) {
Write-Host "Error: Rust is not installed. Please install Rust first from https://rustup.rs/" -ForegroundColor Red
exit 1
}
# Check if Git is installed
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
Write-Host "Error: Git is not installed. Please install Git first from https://git-scm.com/" -ForegroundColor Red
exit 1
}
# Set installation directory
$binDir = "$InstallDir\bin"
# Create installation directory
if (-not (Test-Path $InstallDir)) {
New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
}
if (-not (Test-Path $binDir)) {
New-Item -ItemType Directory -Path $binDir -Force | Out-Null
}
Write-Host "Installing Claude Code Rust to: $InstallDir"
Write-Host
# Use local source code
Write-Host "Using local source code..."
$sourceDir = "$PSScriptRoot\.."
# Build project
Write-Host "Building project..."
Set-Location "$sourceDir"
cargo build --release
if ($LASTEXITCODE -ne 0) {
Write-Host "Error: Failed to build project" -ForegroundColor Red
exit 1
}
# Copy executable
Write-Host "Copying executable..."
if (-not (Test-Path $binDir)) {
New-Item -ItemType Directory -Path $binDir -Force | Out-Null
}
Copy-Item "$sourceDir\target\release\claude-code.exe" "$binDir\claude-code.exe"
# Note about PATH
Write-Host "Note: You may need to add $binDir to your PATH manually to use 'claude-code' command from any terminal."
# Create configuration directory
$configDir = "$InstallDir\config"
if (-not (Test-Path $configDir)) {
New-Item -ItemType Directory -Path $configDir -Force | Out-Null
}
# Create default config file
$configFile = "$configDir\config.toml"
if (-not (Test-Path $configFile)) {
@"
[api]
api_key = ""
base_url = "https://api.deepseek.com"
[model]
model = "deepseek-reasoner"
[log]
level = "info"
"@ | Out-File -FilePath $configFile -Force
Write-Host "Created default configuration file at $configFile"
}
# Test installation
Write-Host "Testing installation..."
$testOutput = & "$binDir\claude-code.exe" --help
if ($LASTEXITCODE -eq 0) {
Write-Host "==========================================="
Write-Host "Installation successful!"
Write-Host "==========================================="
Write-Host "Executable installed at: $binDir\claude-code.exe"
Write-Host ""
Write-Host "To configure API key, run:"
Write-Host " $binDir\claude-code.exe config set api_key "your-api-key""
Write-Host ""
Write-Host "To test the installation, run:"
Write-Host " $binDir\claude-code.exe query --prompt "Hello!""
Write-Host ""
Write-Host "Note: For easier access, consider adding $binDir to your PATH."
} else {
Write-Host "Error: Installation failed. Please check the output above." -ForegroundColor Red
exit 1
}
# Return to original directory
Set-Location -Path $sourceDir