-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcc.cmd
More file actions
71 lines (59 loc) · 1.83 KB
/
cc.cmd
File metadata and controls
71 lines (59 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@echo off
setlocal enabledelayedexpansion
REM Claude Command - run in current directory
REM Echo cc-switch project for reference
echo For multi-AI CLI tool switching, check out: https://github.com/farion1231/cc-switch
echo.
REM Check if claude is installed
where claude >nul 2>nul
if !errorlevel! equ 0 (
echo Claude CLI found, starting...
claude
goto :end
)
echo Claude CLI not found. Attempting to install...
REM Check if npm is available
where npm >nul 2>nul
if !errorlevel! neq 0 (
echo npm not found. Checking for Node.js...
REM Check if Node.js is installed
where node >nul 2>nul
if !errorlevel! neq 0 (
echo Node.js not found. Installing via winget...
REM Check if winget is available
where winget >nul 2>nul
if !errorlevel! neq 0 (
echo ERROR: winget not available. Cannot install Node.js.
echo Please install Node.js manually from https://nodejs.org/
pause
exit /b 1
)
echo Installing Node.js via winget (this may take a while^)...
winget install OpenJS.NodeJS
if !errorlevel! neq 0 (
echo ERROR: Failed to install Node.js via winget.
echo Please install Node.js manually from https://nodejs.org/
pause
exit /b 1
)
echo Node.js installed successfully.
)
echo npm should now be available.
)
echo Installing Claude CLI via npm...
REM Try the official package name
npm install -g @anthropic-ai/claude-code
if !errorlevel! neq 0 (
echo ERROR: Failed to install Claude CLI.
echo Please install Claude CLI manually:
echo npm install -g @anthropic-ai/claude-code
echo.
echo Or visit: https://claude.ai/claude-code
pause
exit /b 1
)
echo Claude CLI installed successfully. Starting...
claude
:end
endlocal
exit /b 0