Skip to content

Chatbot-Maker/babysuri-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

babysuri

CLI para gerenciar chatbots da Chatbot Maker no cluster AKS cbm-aks-stg.


Pré-requisitos

  • kubectl instalado e no PATH
  • az CLI instalado
  • Credenciais configuradas para o cluster (esse funciona para STG, adapte se precisar rodar em outro ambiente):
az login
az aks get-credentials --resource-group cbm.platform.chatbots.aks --name cbm-aks-stg --overwrite-existing

A CLI exibe um aviso se o contexto kubectl não for cbm-aks-stg (se tiver rodando em produção), mas funciona normal.


Instalação

Linux / macOS — um comando

curl -fsSL https://raw.githubusercontent.com/chatbot-maker/babysuri-cli/main/scripts/install.sh | bash

Detecta o OS e arquitetura automaticamente, baixa o binário mais recente e instala em /usr/local/bin. Para instalar em outro diretório: INSTALL_DIR=~/.local/bin curl ... | bash

Windows — PowerShell

irm https://raw.githubusercontent.com/chatbot-maker/babysuri-cli/main/scripts/install.ps1 | iex

Instala em %LOCALAPPDATA%\babysuri e adiciona ao PATH do usuário automaticamente. Abra um novo terminal após a instalação.

Build local

git clone https://github.com/chatbot-maker/babysuri-cli
cd babysuri-cli
make build

Comandos

babysuri <comando> [args]
Comando Descrição
list Lista todos os deployments no namespace babysuri
status <id> Status detalhado: pods, CPU, RAM, node
start <id> Escala o deployment para 1 réplica
stop <id> Escala o deployment para 0 réplicas
restart <id> Faz rollout restart do deployment
logs <id> Stream de logs do pod (Ctrl+C para sair)
top Uso de CPU/RAM de todos os pods

Exemplos

# Listar todos os chatbots
babysuri list

# Ver status detalhado do chatbot cb1234
babysuri status cb1234

# Iniciar chatbot parado
babysuri start cb1234

# Parar chatbot
babysuri stop cb1234

# Reiniciar
babysuri restart cb1234

# Logs em tempo real (últimas 200 linhas)
babysuri logs cb1234 --tail 200

# Uso de recursos de todos os pods
babysuri top

Publicando um release

git tag v1.0.0
git push origin v1.0.0

O GitHub Actions detecta a tag, roda o goreleaser e cria a release automaticamente com binários para Linux, macOS e Windows.


Desenvolvimento

# Build local
make build

# Rodar direto
make run ARGS="list"

# Snapshot multiplataforma (requer goreleaser)
make snapshot

Estrutura do projeto

babysuri-cli/
├── main.go
├── cmd/                  # Subcomandos cobra
│   ├── root.go
│   ├── list.go
│   ├── status.go
│   ├── scale.go          # start / stop / restart
│   ├── logs.go
│   └── top.go
├── internal/
│   ├── k8s/              # Cliente Kubernetes (client-go)
│   │   └── client.go
│   └── ui/               # Componentes TUI (Charm)
│       ├── styles.go
│       ├── spinner.go
│       └── table.go
├── .goreleaser.yaml
└── Makefile

Stack

Biblioteca Uso
cobra Framework CLI / subcomandos
bubbletea Loop TUI (spinner)
lipgloss Estilos e cores no terminal
bubbles Tabelas, spinners prontos
client-go Cliente Kubernetes
goreleaser Build / release multiplataforma

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors