diff --git a/cli/cmd/cline/main.go b/cli/cmd/cline/main.go index f99c3bcb..d6974680 100644 --- a/cli/cmd/cline/main.go +++ b/cli/cmd/cline/main.go @@ -182,7 +182,7 @@ see the manual page: man cline`, rootCmd.AddCommand(cli.NewVersionCommand()) rootCmd.AddCommand(cli.NewAuthCommand()) rootCmd.AddCommand(cli.NewLogsCommand()) - rootCmd.AddCommand(cli.NewDoctorCommand()) + // rootCmd.AddCommand(cli.NewDoctorCommand()) // Disabled for now if err := rootCmd.ExecuteContext(context.Background()); err != nil { os.Exit(1) @@ -345,4 +345,4 @@ func getContentFromStdinAndArgs(args []string) (string, error) { } return content.String(), nil -} +} \ No newline at end of file diff --git a/cli/package.json b/cli/package.json index 8685305e..cf949b82 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,68 +1,62 @@ { - "name": "cline", - "version": "1.0.0-nightly.18", - "description": "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more", - "main": "cline-core.js", - "bin": { - "cline": "./bin/cline", - "cline-host": "./bin/cline-host" - }, - "man": "./man/cline.1", - "scripts": { - "postinstall": "node postinstall.js" - }, - "bundleDependencies": [ - "@grpc/grpc-js", - "@grpc/reflection", - "better-sqlite3", - "grpc-health-check", - "open", - "vscode-uri" - ], - "engines": { - "node": ">=18.0.0" - }, - "keywords": [ - "cline", - "claude", - "dev", - "mcp", - "openrouter", - "coding", - "agent", - "autonomous", - "chatgpt", - "sonnet", - "ai", - "llama", - "cli" - ], - "author": { - "name": "Cline Bot Inc." - }, - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/cline/cline" - }, - "homepage": "https://cline.bot", - "bugs": { - "url": "https://github.com/cline/cline/issues" - }, - "dependencies": { - "@grpc/grpc-js": "^1.13.3", - "@grpc/reflection": "^1.0.4", - "better-sqlite3": "^12.2.0", - "grpc-health-check": "^2.0.2", - "open": "^10.1.2", - "vscode-uri": "^3.1.0" - }, - "os": [ - "darwin", - "linux" - ], - "cpu": [ - "x64", - "arm64" - ] + "name": "cline", + "version": "1.0.3", + "description": "Autonomous coding agent CLI - capable of creating/editing files, running commands, using the browser, and more", + "main": "cline-core.js", + "bin": { + "cline": "./bin/cline", + "cline-host": "./bin/cline-host" + }, + "man": "./man/cline.1", + "scripts": { + "postinstall": "node postinstall.js" + }, + "bundleDependencies": [ + "@grpc/grpc-js", + "@grpc/reflection", + "better-sqlite3", + "grpc-health-check", + "open", + "vscode-uri" + ], + "engines": { + "node": ">=20.0.0" + }, + "keywords": [ + "cline", + "claude", + "dev", + "mcp", + "openrouter", + "coding", + "agent", + "autonomous", + "chatgpt", + "sonnet", + "ai", + "llama", + "cli" + ], + "author": { + "name": "Cline Bot Inc." + }, + "license": "Apache-2.0", + "repository": { + "type": "git", + "url": "https://github.com/cline/cline" + }, + "homepage": "https://cline.bot", + "bugs": { + "url": "https://github.com/cline/cline/issues" + }, + "dependencies": { + "@grpc/grpc-js": "^1.13.3", + "@grpc/reflection": "^1.0.4", + "better-sqlite3": "^12.2.0", + "grpc-health-check": "^2.0.2", + "open": "^10.1.2", + "vscode-uri": "^3.1.0" + }, + "os": ["darwin", "linux"], + "cpu": ["x64", "arm64"] } diff --git a/cli/pkg/cli/logs.go b/cli/pkg/cli/logs.go index ea2ae729..2ae1fbe6 100644 --- a/cli/pkg/cli/logs.go +++ b/cli/pkg/cli/logs.go @@ -208,9 +208,9 @@ func listLogFiles(logsDir string) ([]logFileInfo, error) { }) } - // Sort by created time (newest first) + // Sort by created time (oldest first) sort.Slice(logs, func(i, j int) bool { - return logs[i].created.After(logs[j].created) + return logs[i].created.Before(logs[j].created) }) return logs, nil @@ -379,4 +379,4 @@ func renderLogsTable(logs []logFileInfo, markForDeletion bool) error { fmt.Println() return nil -} +} \ No newline at end of file diff --git a/cli/pkg/cli/updater/updater.go b/cli/pkg/cli/updater/updater.go index e1181275..03dc0d91 100644 --- a/cli/pkg/cli/updater/updater.go +++ b/cli/pkg/cli/updater/updater.go @@ -375,7 +375,7 @@ func showFailureMessage(channel string) { func getCacheFilePath() string { configDir := filepath.Join(os.Getenv("HOME"), ".cline", "data") - return filepath.Join(configDir, ".update-cache") + return filepath.Join(configDir, "cli-update-cache") } func loadCache() (cacheData, error) { @@ -406,4 +406,4 @@ func saveCache(cache cacheData) error { } return os.WriteFile(cacheFile, data, 0644) -} +} \ No newline at end of file diff --git a/cli/pkg/common/utils.go b/cli/pkg/common/utils.go index af45da99..618ef9e9 100644 --- a/cli/pkg/common/utils.go +++ b/cli/pkg/common/utils.go @@ -4,7 +4,9 @@ import ( "context" "fmt" "net" + "os/exec" "strconv" + "strings" "time" "google.golang.org/grpc" @@ -124,6 +126,16 @@ func NormalizeAddressForGRPC(address string) (string, error) { return address, nil } +// GetNodeVersion returns the current Node.js version, or "unknown" if unable to detect +func GetNodeVersion() string { + cmd := exec.Command("node", "--version") + output, err := cmd.Output() + if err != nil { + return "unknown" + } + return strings.TrimSpace(string(output)) +} + // RetryOperation performs an operation with retry logic func RetryOperation(maxRetries int, timeoutPerAttempt time.Duration, operation func() error) error { var lastErr error @@ -155,5 +167,19 @@ func RetryOperation(maxRetries int, timeoutPerAttempt time.Duration, operation f } } - return fmt.Errorf("operation failed after %d attempts: %w", maxRetries, lastErr) + return fmt.Errorf(`operation failed to after %d attempts: %w + +This is usually caused by an incompatible Node.js version + +REQUIREMENTS: +• Node.js version 20+ is required +• Current Node.js version: %s + +DEBUGGING STEPS: +1. View recent logs: cline log list +2. Logs are available in: ~/.cline/logs/ +3. The most recent cline-core log file is usually valuable + +For additional help, visit: https://github.com/cline/cline/issues +`, maxRetries, lastErr, GetNodeVersion()) }