Skip to content

langgenius/mosoo-cli-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mosoo-cli-go

Generated Go CLI for Mosoo integrators: Public Thread API, Console GraphQL, and console REST.

Build

make build

This clones or updates the Mosoo repository under .cache/mosoo, exports OpenAPI / GraphQL specs, renders specs/sources.yaml and overlays/*.yaml, runs Lathe code generation, and builds bin/mosoo.

Override the API host base baked into per-module defaults:

make build MOSOO_HOST_BASE=https://api.example.com

Requires Lathe on PATH for codegen (go install github.com/lathe-cli/lathe/cmd/lathe@main).

Install

make install

By default, installation uses go env GOBIN, or $(go env GOPATH)/bin when GOBIN is empty. Override the destination with BINDIR:

make install BINDIR="$HOME/.bin"

Command layout

cli.command_path is namespaced: every generated command lives under its source module (console, console-rest, or public-thread-api). Root-level flat mounting is not used because the CLI ships three API surfaces.

Help text, examples, and error hints for generated commands come from overlays/*.yaml (regenerated by scripts/render-overlays.ts during make build).

Hostnames and auth

Three API surfaces share one deployment but use different URL bases:

CLI module Default hostname (from MOSOO_HOST_BASE) Example paths
console, console-rest {base}/api /graphql, /access-tokens, /files
public-thread-api {base}/api/v1 /agents/{id}/threads, /threads/{id}/events

Defaults are baked at codegen time (MOSOO_HOST_BASE, default http://127.0.0.1:8787). Override any command with --hostname or $MOSOO_HOST.

Create a personal access token from the Mosoo web app, then log in once per hostname base (same token is fine):

mosoo auth login --hostname http://127.0.0.1:8787/api
mosoo auth login --hostname http://127.0.0.1:8787/api/v1 --skip-validate

auth login validates the token against GET /access-tokens on the /api host. The /api/v1 entry reuses the same credential; --skip-validate avoids a 404 on that base.

Common commands

mosoo console user viewer
mosoo console apps app-list --organization-id <org-id>
mosoo public-thread-api threads create --agent-id <agent-id> --file body.json
mosoo public-thread-api events list-events --thread-id <thread-id>
mosoo search "list apps" --json
mosoo commands show console apps app-list --json

Use commands show before executing an unfamiliar generated command so flags, body shape, auth, and output format are explicit.

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors