mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-06 02:34:09 +08:00
- Move all source files to internal/{app,backend,config,executor,logger,parser,utils}
- Integrate third-party libraries: zerolog, goccy/go-json, gopsutil, cobra/viper
- Add comprehensive unit tests for utils package (94.3% coverage)
- Add performance benchmarks for string operations
- Fix error display: cleanup warnings no longer pollute Recent Errors
- Add GitHub Actions CI workflow
- Add Makefile for build automation
- Add README documentation
Generated with SWE-Agent.ai
Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
30 lines
821 B
Go
30 lines
821 B
Go
package backend
|
|
|
|
import (
|
|
"strings"
|
|
|
|
config "codeagent-wrapper/internal/config"
|
|
)
|
|
|
|
type OpencodeBackend struct{}
|
|
|
|
func (OpencodeBackend) Name() string { return "opencode" }
|
|
func (OpencodeBackend) Command() string { return "opencode" }
|
|
func (OpencodeBackend) Env(baseURL, apiKey string) map[string]string { return nil }
|
|
func (OpencodeBackend) BuildArgs(cfg *config.Config, targetArg string) []string {
|
|
args := []string{"run"}
|
|
if cfg != nil {
|
|
if model := strings.TrimSpace(cfg.Model); model != "" {
|
|
args = append(args, "-m", model)
|
|
}
|
|
if cfg.Mode == "resume" && cfg.SessionID != "" {
|
|
args = append(args, "-s", cfg.SessionID)
|
|
}
|
|
}
|
|
args = append(args, "--format", "json")
|
|
if targetArg != "-" {
|
|
args = append(args, targetArg)
|
|
}
|
|
return args
|
|
}
|