Nothing in the tree could be renamed, moved or removed, and an approved person stayed in the project they were first put in — from the web or the CLI. Now: - /admin/users is the tree, each project opening onto its people and keys, with approve, move, suspend, reinstate and remove for people, revoke for keys, and add, rename, move and remove at every level, plus a search over every account. Forms post and get the page back, so it works with no script; htmx 2.0.11 (0BSD, embedded, checked against npm's integrity hash) swaps only the changed part, keeping open projects open. - llmgw org tree/add/rename/move/remove, users move/delete, and keys list --all. - Projects, teams and organizations are named by id, path (Acme/platform/gateway) or unique name; users by id or email. With a single project --project can be left out, instead of defaulting to "default", which a tree built from the web does not have. Moving a person moves the keys they made; operator keys stay with the project. Only empty things are removed, and never a project that had a key, since usage history refers to it. Also: keys init no longer reparents an existing team or project; reinstating an account with no project is refused (a rejected signup used to come back active and fail at its first key); rejecting a signup removes it; keys limits --budget takes whole units like the quotas page. Checked in headless Chrome: a move from an open project updates the page in place, keeps the project open, and the search still filters. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
53 lines
1.3 KiB
Go
53 lines
1.3 KiB
Go
// Package cli builds llmgw's command line surface.
|
|
package cli
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/obs"
|
|
"gitea.mynodes.xyz/ilker/llmgw/internal/version"
|
|
)
|
|
|
|
type globalFlags struct {
|
|
logLevel string
|
|
logFormat string
|
|
}
|
|
|
|
var global globalFlags
|
|
|
|
// Root returns the root command with all subcommands attached.
|
|
func Root() *cobra.Command {
|
|
root := &cobra.Command{
|
|
Use: "llmgw",
|
|
Short: "LLM gateway for multi-fabric InfiniBand and heterogeneous GPU clusters",
|
|
Long: "llmgw serves LLMs running on your own GPU servers behind a single\n" +
|
|
"OpenAI-compatible endpoint. One binary, different roles per subcommand.",
|
|
Version: version.Version,
|
|
SilenceUsage: true,
|
|
SilenceErrors: true,
|
|
PersistentPreRun: func(_ *cobra.Command, _ []string) {
|
|
obs.Setup(obs.Options{Level: global.logLevel, Format: global.logFormat})
|
|
},
|
|
}
|
|
|
|
pf := root.PersistentFlags()
|
|
pf.StringVar(&global.logLevel, "log-level", "info", "log level: debug|info|warn|error")
|
|
pf.StringVar(&global.logFormat, "log-format", "text", "log format: text|json")
|
|
|
|
root.AddCommand(
|
|
newServerCmd(),
|
|
newAgentCmd(),
|
|
newCtlCmd(),
|
|
newTenancyCmd(),
|
|
newUsersCmd(),
|
|
newOrgCmd(),
|
|
newMirrorCmd(),
|
|
newSimEngineCmd(),
|
|
)
|
|
return root
|
|
}
|
|
|
|
func logger() *slog.Logger { return slog.Default() }
|