2026-01-28 19:14:06 +00:00
|
|
|
// Package php provides Laravel/PHP development environment management.
|
|
|
|
|
package php
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"bufio"
|
|
|
|
|
"context"
|
|
|
|
|
"io"
|
|
|
|
|
"os"
|
|
|
|
|
"os/exec"
|
|
|
|
|
"path/filepath"
|
|
|
|
|
"strings"
|
|
|
|
|
"sync"
|
|
|
|
|
"time"
|
2026-01-31 11:39:19 +00:00
|
|
|
|
|
|
|
|
"github.com/host-uk/core/pkg/cli"
|
2026-01-28 19:14:06 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Service represents a managed development service.
|
|
|
|
|
type Service interface {
|
|
|
|
|
// Name returns the service name.
|
|
|
|
|
Name() string
|
|
|
|
|
// Start starts the service.
|
|
|
|
|
Start(ctx context.Context) error
|
|
|
|
|
// Stop stops the service gracefully.
|
|
|
|
|
Stop() error
|
|
|
|
|
// Logs returns a reader for the service logs.
|
|
|
|
|
Logs(follow bool) (io.ReadCloser, error)
|
|
|
|
|
// Status returns the current service status.
|
|
|
|
|
Status() ServiceStatus
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ServiceStatus represents the status of a service.
|
|
|
|
|
type ServiceStatus struct {
|
|
|
|
|
Name string
|
|
|
|
|
Running bool
|
|
|
|
|
PID int
|
|
|
|
|
Port int
|
|
|
|
|
Error error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// baseService provides common functionality for all services.
|
|
|
|
|
type baseService struct {
|
|
|
|
|
name string
|
|
|
|
|
port int
|
|
|
|
|
dir string
|
|
|
|
|
cmd *exec.Cmd
|
|
|
|
|
logFile *os.File
|
|
|
|
|
logPath string
|
|
|
|
|
mu sync.RWMutex
|
|
|
|
|
running bool
|
|
|
|
|
lastError error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *baseService) Name() string {
|
|
|
|
|
return s.name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *baseService) Status() ServiceStatus {
|
|
|
|
|
s.mu.RLock()
|
|
|
|
|
defer s.mu.RUnlock()
|
|
|
|
|
|
|
|
|
|
status := ServiceStatus{
|
|
|
|
|
Name: s.name,
|
|
|
|
|
Running: s.running,
|
|
|
|
|
Port: s.port,
|
|
|
|
|
Error: s.lastError,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if s.cmd != nil && s.cmd.Process != nil {
|
|
|
|
|
status.PID = s.cmd.Process.Pid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return status
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *baseService) Logs(follow bool) (io.ReadCloser, error) {
|
|
|
|
|
if s.logPath == "" {
|
2026-01-31 11:39:19 +00:00
|
|
|
return nil, cli.Err("no log file available for %s", s.name)
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
file, err := os.Open(s.logPath)
|
|
|
|
|
if err != nil {
|
2026-01-31 11:39:19 +00:00
|
|
|
return nil, cli.WrapVerb(err, "open", "log file")
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !follow {
|
|
|
|
|
return file, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// For follow mode, return a tailing reader
|
|
|
|
|
return newTailReader(file), nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *baseService) startProcess(ctx context.Context, cmdName string, args []string, env []string) error {
|
|
|
|
|
s.mu.Lock()
|
|
|
|
|
defer s.mu.Unlock()
|
|
|
|
|
|
|
|
|
|
if s.running {
|
2026-01-31 11:39:19 +00:00
|
|
|
return cli.Err("%s is already running", s.name)
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create log file
|
|
|
|
|
logDir := filepath.Join(s.dir, ".core", "logs")
|
|
|
|
|
if err := os.MkdirAll(logDir, 0755); err != nil {
|
2026-01-31 11:39:19 +00:00
|
|
|
return cli.WrapVerb(err, "create", "log directory")
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
2026-01-31 11:39:19 +00:00
|
|
|
s.logPath = filepath.Join(logDir, cli.Sprintf("%s.log", strings.ToLower(s.name)))
|
2026-01-28 19:14:06 +00:00
|
|
|
logFile, err := os.OpenFile(s.logPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644)
|
|
|
|
|
if err != nil {
|
2026-01-31 11:39:19 +00:00
|
|
|
return cli.WrapVerb(err, "create", "log file")
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
s.logFile = logFile
|
|
|
|
|
|
|
|
|
|
// Create command
|
|
|
|
|
s.cmd = exec.CommandContext(ctx, cmdName, args...)
|
|
|
|
|
s.cmd.Dir = s.dir
|
|
|
|
|
s.cmd.Stdout = logFile
|
|
|
|
|
s.cmd.Stderr = logFile
|
|
|
|
|
s.cmd.Env = append(os.Environ(), env...)
|
|
|
|
|
|
2026-02-01 01:56:44 +00:00
|
|
|
// Set platform-specific process attributes for clean shutdown
|
|
|
|
|
setSysProcAttr(s.cmd)
|
2026-01-28 19:14:06 +00:00
|
|
|
|
|
|
|
|
if err := s.cmd.Start(); err != nil {
|
|
|
|
|
logFile.Close()
|
|
|
|
|
s.lastError = err
|
2026-01-31 11:39:19 +00:00
|
|
|
return cli.WrapVerb(err, "start", s.name)
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s.running = true
|
|
|
|
|
s.lastError = nil
|
|
|
|
|
|
|
|
|
|
// Monitor process in background
|
|
|
|
|
go func() {
|
|
|
|
|
err := s.cmd.Wait()
|
|
|
|
|
s.mu.Lock()
|
|
|
|
|
s.running = false
|
|
|
|
|
if err != nil {
|
|
|
|
|
s.lastError = err
|
|
|
|
|
}
|
|
|
|
|
if s.logFile != nil {
|
|
|
|
|
s.logFile.Close()
|
|
|
|
|
}
|
|
|
|
|
s.mu.Unlock()
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *baseService) stopProcess() error {
|
|
|
|
|
s.mu.Lock()
|
|
|
|
|
defer s.mu.Unlock()
|
|
|
|
|
|
|
|
|
|
if !s.running || s.cmd == nil || s.cmd.Process == nil {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-01 01:56:44 +00:00
|
|
|
// Send termination signal to process (group on Unix)
|
|
|
|
|
signalProcessGroup(s.cmd, termSignal())
|
2026-01-28 19:14:06 +00:00
|
|
|
|
|
|
|
|
// Wait for graceful shutdown with timeout
|
|
|
|
|
done := make(chan struct{})
|
|
|
|
|
go func() {
|
|
|
|
|
s.cmd.Wait()
|
|
|
|
|
close(done)
|
|
|
|
|
}()
|
|
|
|
|
|
|
|
|
|
select {
|
|
|
|
|
case <-done:
|
|
|
|
|
// Process exited gracefully
|
|
|
|
|
case <-time.After(5 * time.Second):
|
|
|
|
|
// Force kill
|
2026-02-01 01:56:44 +00:00
|
|
|
signalProcessGroup(s.cmd, killSignal())
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s.running = false
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FrankenPHPService manages the FrankenPHP/Octane server.
|
|
|
|
|
type FrankenPHPService struct {
|
|
|
|
|
baseService
|
2026-01-31 11:39:19 +00:00
|
|
|
https bool
|
2026-01-28 19:14:06 +00:00
|
|
|
httpsPort int
|
2026-01-31 11:39:19 +00:00
|
|
|
certFile string
|
|
|
|
|
keyFile string
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewFrankenPHPService creates a new FrankenPHP service.
|
|
|
|
|
func NewFrankenPHPService(dir string, opts FrankenPHPOptions) *FrankenPHPService {
|
|
|
|
|
port := opts.Port
|
|
|
|
|
if port == 0 {
|
|
|
|
|
port = 8000
|
|
|
|
|
}
|
|
|
|
|
httpsPort := opts.HTTPSPort
|
|
|
|
|
if httpsPort == 0 {
|
|
|
|
|
httpsPort = 443
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &FrankenPHPService{
|
|
|
|
|
baseService: baseService{
|
|
|
|
|
name: "FrankenPHP",
|
|
|
|
|
port: port,
|
|
|
|
|
dir: dir,
|
|
|
|
|
},
|
|
|
|
|
https: opts.HTTPS,
|
|
|
|
|
httpsPort: httpsPort,
|
|
|
|
|
certFile: opts.CertFile,
|
|
|
|
|
keyFile: opts.KeyFile,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// FrankenPHPOptions configures the FrankenPHP service.
|
|
|
|
|
type FrankenPHPOptions struct {
|
|
|
|
|
Port int
|
|
|
|
|
HTTPSPort int
|
|
|
|
|
HTTPS bool
|
|
|
|
|
CertFile string
|
|
|
|
|
KeyFile string
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Start launches the FrankenPHP Octane server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *FrankenPHPService) Start(ctx context.Context) error {
|
|
|
|
|
args := []string{
|
|
|
|
|
"artisan", "octane:start",
|
|
|
|
|
"--server=frankenphp",
|
2026-01-31 11:39:19 +00:00
|
|
|
cli.Sprintf("--port=%d", s.port),
|
2026-01-28 19:14:06 +00:00
|
|
|
"--no-interaction",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if s.https && s.certFile != "" && s.keyFile != "" {
|
|
|
|
|
args = append(args,
|
2026-01-31 11:39:19 +00:00
|
|
|
cli.Sprintf("--https-port=%d", s.httpsPort),
|
|
|
|
|
cli.Sprintf("--https-certificate=%s", s.certFile),
|
|
|
|
|
cli.Sprintf("--https-certificate-key=%s", s.keyFile),
|
2026-01-28 19:14:06 +00:00
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s.startProcess(ctx, "php", args, nil)
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Stop terminates the FrankenPHP server process.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *FrankenPHPService) Stop() error {
|
|
|
|
|
return s.stopProcess()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ViteService manages the Vite development server.
|
|
|
|
|
type ViteService struct {
|
|
|
|
|
baseService
|
|
|
|
|
packageManager string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewViteService creates a new Vite service.
|
|
|
|
|
func NewViteService(dir string, opts ViteOptions) *ViteService {
|
|
|
|
|
port := opts.Port
|
|
|
|
|
if port == 0 {
|
|
|
|
|
port = 5173
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pm := opts.PackageManager
|
|
|
|
|
if pm == "" {
|
|
|
|
|
pm = DetectPackageManager(dir)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &ViteService{
|
|
|
|
|
baseService: baseService{
|
|
|
|
|
name: "Vite",
|
|
|
|
|
port: port,
|
|
|
|
|
dir: dir,
|
|
|
|
|
},
|
|
|
|
|
packageManager: pm,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ViteOptions configures the Vite service.
|
|
|
|
|
type ViteOptions struct {
|
|
|
|
|
Port int
|
|
|
|
|
PackageManager string
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Start launches the Vite development server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *ViteService) Start(ctx context.Context) error {
|
|
|
|
|
var cmdName string
|
|
|
|
|
var args []string
|
|
|
|
|
|
|
|
|
|
switch s.packageManager {
|
|
|
|
|
case "bun":
|
|
|
|
|
cmdName = "bun"
|
|
|
|
|
args = []string{"run", "dev"}
|
|
|
|
|
case "pnpm":
|
|
|
|
|
cmdName = "pnpm"
|
|
|
|
|
args = []string{"run", "dev"}
|
|
|
|
|
case "yarn":
|
|
|
|
|
cmdName = "yarn"
|
|
|
|
|
args = []string{"dev"}
|
|
|
|
|
default:
|
|
|
|
|
cmdName = "npm"
|
|
|
|
|
args = []string{"run", "dev"}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s.startProcess(ctx, cmdName, args, nil)
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Stop terminates the Vite development server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *ViteService) Stop() error {
|
|
|
|
|
return s.stopProcess()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// HorizonService manages Laravel Horizon.
|
|
|
|
|
type HorizonService struct {
|
|
|
|
|
baseService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewHorizonService creates a new Horizon service.
|
|
|
|
|
func NewHorizonService(dir string) *HorizonService {
|
|
|
|
|
return &HorizonService{
|
|
|
|
|
baseService: baseService{
|
|
|
|
|
name: "Horizon",
|
|
|
|
|
port: 0, // Horizon doesn't expose a port directly
|
|
|
|
|
dir: dir,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Start launches the Laravel Horizon queue worker.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *HorizonService) Start(ctx context.Context) error {
|
|
|
|
|
return s.startProcess(ctx, "php", []string{"artisan", "horizon"}, nil)
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Stop terminates Horizon using its terminate command.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *HorizonService) Stop() error {
|
|
|
|
|
// Horizon has its own terminate command
|
|
|
|
|
cmd := exec.Command("php", "artisan", "horizon:terminate")
|
|
|
|
|
cmd.Dir = s.dir
|
|
|
|
|
cmd.Run() // Ignore errors, will also kill via signal
|
|
|
|
|
|
|
|
|
|
return s.stopProcess()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReverbService manages Laravel Reverb WebSocket server.
|
|
|
|
|
type ReverbService struct {
|
|
|
|
|
baseService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewReverbService creates a new Reverb service.
|
|
|
|
|
func NewReverbService(dir string, opts ReverbOptions) *ReverbService {
|
|
|
|
|
port := opts.Port
|
|
|
|
|
if port == 0 {
|
|
|
|
|
port = 8080
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &ReverbService{
|
|
|
|
|
baseService: baseService{
|
|
|
|
|
name: "Reverb",
|
|
|
|
|
port: port,
|
|
|
|
|
dir: dir,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReverbOptions configures the Reverb service.
|
|
|
|
|
type ReverbOptions struct {
|
|
|
|
|
Port int
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Start launches the Laravel Reverb WebSocket server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *ReverbService) Start(ctx context.Context) error {
|
|
|
|
|
args := []string{
|
|
|
|
|
"artisan", "reverb:start",
|
2026-01-31 11:39:19 +00:00
|
|
|
cli.Sprintf("--port=%d", s.port),
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s.startProcess(ctx, "php", args, nil)
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Stop terminates the Reverb WebSocket server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *ReverbService) Stop() error {
|
|
|
|
|
return s.stopProcess()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RedisService manages a local Redis server.
|
|
|
|
|
type RedisService struct {
|
|
|
|
|
baseService
|
|
|
|
|
configFile string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// NewRedisService creates a new Redis service.
|
|
|
|
|
func NewRedisService(dir string, opts RedisOptions) *RedisService {
|
|
|
|
|
port := opts.Port
|
|
|
|
|
if port == 0 {
|
|
|
|
|
port = 6379
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &RedisService{
|
|
|
|
|
baseService: baseService{
|
|
|
|
|
name: "Redis",
|
|
|
|
|
port: port,
|
|
|
|
|
dir: dir,
|
|
|
|
|
},
|
|
|
|
|
configFile: opts.ConfigFile,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RedisOptions configures the Redis service.
|
|
|
|
|
type RedisOptions struct {
|
|
|
|
|
Port int
|
|
|
|
|
ConfigFile string
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Start launches the Redis server.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *RedisService) Start(ctx context.Context) error {
|
|
|
|
|
args := []string{
|
2026-01-31 11:39:19 +00:00
|
|
|
"--port", cli.Sprintf("%d", s.port),
|
2026-01-28 19:14:06 +00:00
|
|
|
"--daemonize", "no",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if s.configFile != "" {
|
|
|
|
|
args = []string{s.configFile}
|
2026-01-31 11:39:19 +00:00
|
|
|
args = append(args, "--port", cli.Sprintf("%d", s.port), "--daemonize", "no")
|
2026-01-28 19:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return s.startProcess(ctx, "redis-server", args, nil)
|
|
|
|
|
}
|
|
|
|
|
|
feat: git command, build improvements, and go fmt git-aware (#74)
* feat(go): make go fmt git-aware by default
- By default, only check changed Go files (modified, staged, untracked)
- Add --all flag to check all files (previous behaviour)
- Reduces noise when running fmt on large codebases
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(build): minimal output by default, add missing i18n
- Default output now shows single line: "Success Built N artifacts (dir)"
- Add --verbose/-v flag to show full detailed output
- Add all missing i18n translations for build commands
- Errors still show failure reason in minimal mode
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: add root-level `core git` command
- Create pkg/gitcmd with git workflow commands as root menu
- Export command builders from pkg/dev (AddCommitCommand, etc.)
- Commands available under both `core git` and `core dev` for compatibility
- Git commands: health, commit, push, pull, work, sync, apply
- GitHub orchestration stays in dev: issues, reviews, ci, impact
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(qa): add docblock coverage checking
Implement docblock/docstring coverage analysis for Go code:
- New `core qa docblock` command to check coverage
- Shows compact file:line list when under threshold
- Integrate with `core go qa` as a default check
- Add --docblock-threshold flag (default 80%)
The checker uses Go AST parsing to find exported symbols
(functions, types, consts, vars) without documentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- Fix doc comment: "status" → "health" in gitcmd package
- Implement --check flag for `core go fmt` (exits non-zero if files need formatting)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* docs: add docstrings for 100% coverage
Add documentation comments to all exported symbols:
- pkg/build: ProjectType constants
- pkg/cli: LogLevel, RenderStyle, TableStyle
- pkg/framework: ServiceFor, MustServiceFor, Core.Core
- pkg/git: GitError.Error, GitError.Unwrap
- pkg/i18n: Handler Match/Handle methods
- pkg/log: Level constants
- pkg/mcp: Tool input/output types
- pkg/php: Service constants, QA types, service methods
- pkg/process: ServiceError.Error
- pkg/repos: RepoType constants
- pkg/setup: ChangeType, ChangeCategory constants
- pkg/workspace: AddWorkspaceCommands
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* chore: standardize line endings to LF
Add .gitattributes to enforce LF line endings for all text files.
Normalize all existing files to use Unix-style line endings.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback
- cmd_format.go: validate --check/--fix mutual exclusivity, capture stderr
- cmd_docblock.go: return error instead of os.Exit(1) for proper error handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address CodeRabbit review feedback (round 2)
- linuxkit.go: propagate state update errors, handle cmd.Wait() errors in waitForExit
- mcp.go: guard against empty old_string in editDiff to prevent runaway edits
- cmd_docblock.go: log parse errors instead of silently skipping
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:48:44 +00:00
|
|
|
// Stop terminates Redis using the shutdown command.
|
2026-01-28 19:14:06 +00:00
|
|
|
func (s *RedisService) Stop() error {
|
|
|
|
|
// Try graceful shutdown via redis-cli
|
2026-01-31 11:39:19 +00:00
|
|
|
cmd := exec.Command("redis-cli", "-p", cli.Sprintf("%d", s.port), "shutdown", "nosave")
|
2026-01-28 19:14:06 +00:00
|
|
|
cmd.Run() // Ignore errors
|
|
|
|
|
|
|
|
|
|
return s.stopProcess()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// tailReader wraps a file and provides tailing functionality.
|
|
|
|
|
type tailReader struct {
|
|
|
|
|
file *os.File
|
|
|
|
|
reader *bufio.Reader
|
|
|
|
|
closed bool
|
|
|
|
|
mu sync.RWMutex
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func newTailReader(file *os.File) *tailReader {
|
|
|
|
|
return &tailReader{
|
|
|
|
|
file: file,
|
|
|
|
|
reader: bufio.NewReader(file),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (t *tailReader) Read(p []byte) (n int, err error) {
|
|
|
|
|
t.mu.RLock()
|
|
|
|
|
if t.closed {
|
|
|
|
|
t.mu.RUnlock()
|
|
|
|
|
return 0, io.EOF
|
|
|
|
|
}
|
|
|
|
|
t.mu.RUnlock()
|
|
|
|
|
|
|
|
|
|
n, err = t.reader.Read(p)
|
|
|
|
|
if err == io.EOF {
|
|
|
|
|
// Wait a bit and try again (tailing behavior)
|
|
|
|
|
time.Sleep(100 * time.Millisecond)
|
|
|
|
|
return 0, nil
|
|
|
|
|
}
|
|
|
|
|
return n, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (t *tailReader) Close() error {
|
|
|
|
|
t.mu.Lock()
|
|
|
|
|
t.closed = true
|
|
|
|
|
t.mu.Unlock()
|
|
|
|
|
return t.file.Close()
|
|
|
|
|
}
|