From 076045361a37953982407e72973981ab4db2f5ed Mon Sep 17 00:00:00 2001 From: Elliott Hilaire <47168377+elliotthilaire-ca@users.noreply.github.com> Date: Thu, 19 Feb 2026 11:53:38 +1100 Subject: [PATCH 1/3] Add age, health, restarts to services ls --- internal/devbox/services.go | 4 ++-- internal/services/client.go | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/devbox/services.go b/internal/devbox/services.go index 10237905bd0..5ee875e9a80 100644 --- a/internal/devbox/services.go +++ b/internal/devbox/services.go @@ -123,9 +123,9 @@ func (d *Devbox) ListServices(ctx context.Context, runInCurrentShell bool) error fmt.Fprintln(d.stderr, "Error listing services: ", err) } else { fmt.Fprintln(d.stderr, "Services running in process-compose:") - fmt.Fprintln(tw, "NAME\tSTATUS\tEXIT CODE") + fmt.Fprintln(tw, "NAME\tSTATUS\tAGE\tHEALTH\tRESTARTS\tEXIT CODE") for _, s := range pcSvcs { - fmt.Fprintf(tw, "%s\t%s\t%d\n", s.Name, s.Status, s.ExitCode) + fmt.Fprintf(tw, "%s\t%s\t%s\t%s\t%d\t%d\n", s.Name, s.Status, s.Age, s.Health, s.Restarts, s.ExitCode) } tw.Flush() } diff --git a/internal/services/client.go b/internal/services/client.go index d33b9817cbe..c16c3365cf0 100644 --- a/internal/services/client.go +++ b/internal/services/client.go @@ -10,6 +10,7 @@ import ( "fmt" "io" "net/http" + "time" "github.com/f1bonacc1/process-compose/src/types" ) @@ -19,6 +20,9 @@ type processStates = types.ProcessesState type Process struct { Name string Status string + Age time.Duration + Health string + Restarts int ExitCode int } @@ -93,6 +97,9 @@ func ListServices(ctx context.Context, projectDir string, w io.Writer) ([]Proces results = append(results, Process{ Name: process.Name, Status: process.Status, + Age: process.Age.Round(time.Second), + Health: process.Health, + Restarts: process.Restarts, ExitCode: process.ExitCode, }) } From 8eeba99691ffcda5e47895e51a803869b7c6deb7 Mon Sep 17 00:00:00 2001 From: Elliott Hilaire <47168377+elliotthilaire-ca@users.noreply.github.com> Date: Thu, 26 Feb 2026 08:54:10 +1100 Subject: [PATCH 2/3] Run `devbox run fmt` --- internal/services/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/client.go b/internal/services/client.go index c16c3365cf0..75ca717286e 100644 --- a/internal/services/client.go +++ b/internal/services/client.go @@ -20,7 +20,7 @@ type processStates = types.ProcessesState type Process struct { Name string Status string - Age time.Duration + Age time.Duration Health string Restarts int ExitCode int From 05788d6454b33cb9a156603219a4ae5912e8453b Mon Sep 17 00:00:00 2001 From: Elliott Hilaire <47168377+elliotthilaire-ca@users.noreply.github.com> Date: Thu, 26 Feb 2026 09:12:36 +1100 Subject: [PATCH 3/3] Add PID and NAMESPACE to output of `devbox services ls` --- internal/devbox/services.go | 4 ++-- internal/services/client.go | 28 ++++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/internal/devbox/services.go b/internal/devbox/services.go index 5ee875e9a80..a1fc49d73e9 100644 --- a/internal/devbox/services.go +++ b/internal/devbox/services.go @@ -123,9 +123,9 @@ func (d *Devbox) ListServices(ctx context.Context, runInCurrentShell bool) error fmt.Fprintln(d.stderr, "Error listing services: ", err) } else { fmt.Fprintln(d.stderr, "Services running in process-compose:") - fmt.Fprintln(tw, "NAME\tSTATUS\tAGE\tHEALTH\tRESTARTS\tEXIT CODE") + fmt.Fprintln(tw, "PID\tNAME\tNAMESPACE\tSTATUS\tAGE\tHEALTH\tRESTARTS\tEXIT CODE") for _, s := range pcSvcs { - fmt.Fprintf(tw, "%s\t%s\t%s\t%s\t%d\t%d\n", s.Name, s.Status, s.Age, s.Health, s.Restarts, s.ExitCode) + fmt.Fprintf(tw, "%d\t%s\t%s\t%s\t%s\t%s\t%d\t%d\n", s.PID, s.Name, s.Namespace, s.Status, s.Age, s.Health, s.Restarts, s.ExitCode) } tw.Flush() } diff --git a/internal/services/client.go b/internal/services/client.go index 75ca717286e..cebee8b233b 100644 --- a/internal/services/client.go +++ b/internal/services/client.go @@ -18,12 +18,14 @@ import ( type processStates = types.ProcessesState type Process struct { - Name string - Status string - Age time.Duration - Health string - Restarts int - ExitCode int + PID int + Name string + Namespace string + Status string + Age time.Duration + Health string + Restarts int + ExitCode int } func StartServices(ctx context.Context, w io.Writer, serviceName, projectDir string) error { @@ -95,12 +97,14 @@ func ListServices(ctx context.Context, projectDir string, w io.Writer) ([]Proces } for _, process := range processes.States { results = append(results, Process{ - Name: process.Name, - Status: process.Status, - Age: process.Age.Round(time.Second), - Health: process.Health, - Restarts: process.Restarts, - ExitCode: process.ExitCode, + PID: process.Pid, + Name: process.Name, + Namespace: process.Namespace, + Status: process.Status, + Age: process.Age.Round(time.Second), + Health: process.Health, + Restarts: process.Restarts, + ExitCode: process.ExitCode, }) } return results, nil