fix(cli): address greptile review comments

This commit is contained in:
Dhruv Sharma 2026-05-31 21:37:43 +05:30 committed by harshitsinghbhandari
parent 4671d27307
commit f72facb9e5
4 changed files with 24 additions and 11 deletions

View File

@ -8,6 +8,7 @@ require (
github.com/go-chi/chi/v5 v5.1.0
github.com/pressly/goose/v3 v3.27.1
github.com/spf13/cobra v1.10.1
golang.org/x/sys v0.43.0
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.51.0
)
@ -24,7 +25,6 @@ require (
github.com/spf13/pflag v1.0.9 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.43.0 // indirect
modernc.org/libc v1.72.3 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect

View File

@ -8,9 +8,10 @@ import (
func newCompletionCommand() *cobra.Command {
return &cobra.Command{
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generate shell completion scripts",
Args: cobra.ExactArgs(1),
Use: "completion [bash|zsh|fish|powershell]",
Short: "Generate shell completion scripts",
Args: cobra.ExactArgs(1),
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
RunE: func(cmd *cobra.Command, args []string) error {
root := cmd.Root()
out := cmd.OutOrStdout()

View File

@ -2,18 +2,31 @@
package cli
import "os"
import (
"errors"
"os"
"golang.org/x/sys/windows"
)
func processAlive(pid int) bool {
if pid <= 0 {
return false
}
p, err := os.FindProcess(pid)
handle, err := windows.OpenProcess(windows.SYNCHRONIZE, false, uint32(pid))
if err != nil {
if errors.Is(err, windows.ERROR_ACCESS_DENIED) {
return true
}
return false
}
defer windows.CloseHandle(handle)
status, err := windows.WaitForSingleObject(handle, 0)
if err != nil {
return false
}
_ = p.Release()
return true
return status == uint32(windows.WAIT_TIMEOUT)
}
func signalTerm(pid int) error {

View File

@ -103,9 +103,8 @@ logic in-process. The rewrite needs the CLI to sit outside the core daemon.
## Current Legacy CLI Inventory
Inventory source: installed `ao` binary at version `0.9.2`, plus
`/Users/dhruvsharma/Development/agent-orchestrator/packages/cli/src/program.ts`
and `packages/cli/src/commands/*.ts`.
Inventory source: installed `ao` binary at version `0.9.2`, plus the old
`packages/cli/src/program.ts` and `packages/cli/src/commands/*.ts` files.
Count: