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
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,19 @@ build-docker-embed-runtime-embed: build-docker-embed-images patch-docker-embed-i
build-picoclaw-runtime-embed: build-docker-embed-runtime-embed

build-picoclaw-manager-image: stage-docker-embed-cli
chmod +x scripts/prepare-docker-embed-dist.sh scripts/build-docker-embed-images.sh
scripts/prepare-docker-embed-dist.sh picoclaw-manager
chmod +x scripts/prepare-docker-embed-dist.sh scripts/patch-docker-embed-image-refs.sh scripts/build-docker-embed-images.sh
scripts/prepare-docker-embed-dist.sh
ACR_REGISTRY="$(ACR_REGISTRY)" VERSION="$(DOCKER_EMBED_IMAGE_TAG)" \
scripts/patch-docker-embed-image-refs.sh
ACR_REGISTRY="$(ACR_REGISTRY)" PICOCLAW_BASE_IMAGE="$(PICOCLAW_BASE_IMAGE)" \
DOCKER_EMBED_IMAGE_TAG="$(DOCKER_EMBED_IMAGE_TAG)" \
scripts/build-docker-embed-images.sh picoclaw-manager

build-picoclaw-worker-image: stage-docker-embed-cli
chmod +x scripts/prepare-docker-embed-dist.sh scripts/build-docker-embed-images.sh
scripts/prepare-docker-embed-dist.sh picoclaw-worker
chmod +x scripts/prepare-docker-embed-dist.sh scripts/patch-docker-embed-image-refs.sh scripts/build-docker-embed-images.sh
scripts/prepare-docker-embed-dist.sh
ACR_REGISTRY="$(ACR_REGISTRY)" VERSION="$(DOCKER_EMBED_IMAGE_TAG)" \
scripts/patch-docker-embed-image-refs.sh
ACR_REGISTRY="$(ACR_REGISTRY)" PICOCLAW_BASE_IMAGE="$(PICOCLAW_BASE_IMAGE)" \
DOCKER_EMBED_IMAGE_TAG="$(DOCKER_EMBED_IMAGE_TAG)" \
scripts/build-docker-embed-images.sh picoclaw-worker
Expand Down
35 changes: 28 additions & 7 deletions cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
"strings"

agentcmd "csgclaw/cli/agent"
"csgclaw/cli/bot"
"csgclaw/cli/command"
completioncmd "csgclaw/cli/completion"
hubcmd "csgclaw/cli/hub"
"csgclaw/cli/member"
"csgclaw/cli/message"
modelcmd "csgclaw/cli/model"
participantcmd "csgclaw/cli/participant"
"csgclaw/cli/room"
servecmd "csgclaw/cli/serve"
skillcmd "csgclaw/cli/skill"
Expand Down Expand Up @@ -79,8 +79,9 @@ func (a *App) registerDefaultCommands() {
hubcmd.NewCmd(),
skillcmd.NewCmd(),
modelcmd.NewCmd(),
participantcmd.NewCmd(),
participantcmd.NewAliasCmd("pt"),
usercmd.NewCmd(),
bot.NewCmd(),
room.NewCmd(),
member.NewCmd(),
message.NewCmd(),
Expand Down Expand Up @@ -205,11 +206,10 @@ func (a *App) usage() {
fmt.Fprintln(a.stderr, " csgclaw [global-flags] <command> [args]")
fmt.Fprintln(a.stderr)
fmt.Fprintln(a.stderr, "Available Commands:")
for _, cmd := range a.order {
if hidden, ok := cmd.(interface{ Hidden() bool }); ok && hidden.Hidden() {
continue
}
fmt.Fprintf(a.stderr, " %-8s %s\n", cmd.Name(), cmd.Summary())
commands := a.visibleCommands()
width := commandNameWidth(commands)
for _, cmd := range commands {
fmt.Fprintf(a.stderr, " %-*s %s\n", width, cmd.Name(), cmd.Summary())
}
fmt.Fprintln(a.stderr)
fmt.Fprintln(a.stderr, "Examples:")
Expand All @@ -230,6 +230,27 @@ func (a *App) usage() {
fmt.Fprintln(a.stderr, " --version, -V Print version and exit")
}

func (a *App) visibleCommands() []command.Command {
commands := make([]command.Command, 0, len(a.order))
for _, cmd := range a.order {
if hidden, ok := cmd.(interface{ Hidden() bool }); ok && hidden.Hidden() {
continue
}
commands = append(commands, cmd)
}
return commands
}

func commandNameWidth(commands []command.Command) int {
width := 8
for _, cmd := range commands {
if n := len(cmd.Name()); n > width {
width = n
}
}
return width + 1
}

func (a *App) printVersion(output string) error {
version := appversion.Current()
if output == "json" {
Expand Down
Loading
Loading