Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ Full DevSecOps capabilities with audit logging:
| `/undo` | Undo file modifications |
| `/diff` | Show session changes |
| `/tools` | List available tools |
| `/upgrade` | Check for and install updates |
| `/help` | Show help |

## Configuration
Expand Down
22 changes: 22 additions & 0 deletions cmd/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/tara-vision/taracode/internal/storage"
"github.com/tara-vision/taracode/internal/tools"
"github.com/tara-vision/taracode/internal/ui"
"github.com/tara-vision/taracode/internal/upgrade"
"github.com/tara-vision/taracode/internal/watch"
)

Expand Down Expand Up @@ -161,6 +162,14 @@ func startREPL() {
}
}

// Start async version check (non-blocking)
updateResultChan := make(chan *upgrade.CheckResult, 1)
if viper.GetBool("upgrade.auto_check") {
CheckForUpdateAsync(Version, updateResultChan)
} else {
close(updateResultChan)
}

// Initialize MCP manager if enabled
var mcpManager *mcp.Manager
mcpConfig := GetMCPConfig()
Expand Down Expand Up @@ -226,6 +235,14 @@ func startREPL() {
}
defer rl.Close()

// Check for update result (non-blocking)
select {
case updateResult := <-updateResultChan:
ShowUpdateBanner(updateResult)
default:
// No result yet, continue without blocking
}

// Main REPL loop
for {
line, err := rl.Readline()
Expand Down Expand Up @@ -552,6 +569,7 @@ func handleCommand(cmd string, workingDir string, asst **assistant.Assistant, ho
fmt.Println(" /context --agents - Show per-agent context usage")
fmt.Println(" /tools - List available AI tools")
fmt.Println(" /usage - Show token usage statistics")
fmt.Println(" /upgrade - Check for and install updates")
fmt.Println(" /help - Show this help message")
fmt.Println(" exit - Exit Tara Code")
fmt.Println()
Expand Down Expand Up @@ -792,6 +810,10 @@ func handleCommand(cmd string, workingDir string, asst **assistant.Assistant, ho
// Screen monitoring and analysis
handleWatchCommand(args, *asst, watchMonitor, os.TempDir())

case "/upgrade":
// Check for and install updates
handleUpgradeCommand(args)

default:
fmt.Printf("Unknown command: %s\n", cmd)
fmt.Println("Type '/help' for available commands.")
Expand Down
8 changes: 8 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,14 @@ func initConfig() {
viper.SetDefault("memory.retention_days", 90)
viper.SetDefault("memory.auto_capture", true)

// Upgrade (Auto-update) configuration defaults
// auto_check: Check for updates on startup (default: true)
// auto_upgrade: Automatically install updates without prompting (default: false)
// show_changelog: Show changelog when update is available (default: true)
viper.SetDefault("upgrade.auto_check", true)
viper.SetDefault("upgrade.auto_upgrade", false)
viper.SetDefault("upgrade.show_changelog", true)

viper.SetEnvPrefix("TARACODE")
viper.AutomaticEnv()

Expand Down
7 changes: 7 additions & 0 deletions cmd/slash_completer.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ func GetSlashCommands() []SlashCommand {
{"/tools", "List available AI tools"},
{"/usage", "Show token usage statistics"},
{"/help", "Show help message"},
// Upgrade
{"/upgrade", "Check for and install updates"},
{"/upgrade check", "Check for new version"},
{"/upgrade now", "Upgrade to latest version"},
{"/upgrade skip", "Skip the current available update"},
{"/upgrade changelog", "Show full release notes"},
{"/upgrade status", "Show upgrade state information"},
}
}

Expand Down
Loading
Loading