feat(cli): add bots and docker compose commands

This commit is contained in:
晨苒
2026-04-14 01:35:07 +08:00
parent d50eeea114
commit 1a6d12a137
7 changed files with 950 additions and 0 deletions
+10
View File
@@ -77,6 +77,16 @@ func (c *Client) ListBots(ctx context.Context) ([]bots.Bot, error) {
return resp.Items, err
}
func (c *Client) CreateBot(ctx context.Context, req bots.CreateBotRequest) (bots.Bot, error) {
var resp bots.Bot
err := c.doJSON(ctx, http.MethodPost, "/bots", req, &resp)
return resp, err
}
func (c *Client) DeleteBot(ctx context.Context, botID string) error {
return c.doJSON(ctx, http.MethodDelete, fmt.Sprintf("/bots/%s", botID), nil, nil)
}
func (c *Client) ListSessions(ctx context.Context, botID string) ([]session.Session, error) {
var resp struct {
Items []session.Session `json:"items"`