cmd

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright © 2024 Lawrence McDaniel <lawrence@querium.com>

Copyright © 2024 Lawrence McDaniel <lawrence@querium.com>

Copyright © 2024 Lawrence McDaniel lawrence@querium.com

Copyright © 2024 Lawrence McDaniel <lawrence@querium.com>

Copyright © 2024 Lawrence McDaniel <lawrence@querium.com>

Copyright © 2024 Lawrence McDaniel <lawrence@querium.com>

Index

Constants

View Source
const (
	RootDomain  = "platform.smarter.sh"
	ApiBasePath = "/api/v1/cli/"
)

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "smarter",
	Short: "A command-line interface for working with Smarter resources",
	Long: `A command-line interface for working with Smarter resources.
Using the smarter cli, you can create Smarter plugins, add these to a ChatBot,
and deploy the ChatBot to a custom URL. You can interact with the ChatBot
on the command line, view chat log data, and manage your Smarter account.
Support: https://smarter.sh and support@smarter.sh.`,
}
View Source
var Version string

Functions

func APIRequest

func APIRequest(slug string, kwargs map[string]string, fileContents ...string) ([]byte, error)

func ConsoleOutput

func ConsoleOutput(bodyJson []byte)

func ErrorOutput

func ErrorOutput(err error)

func Execute

func Execute(version string)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the RootCmd.

func JsonOutput

func JsonOutput(bodyJson []byte)

func TableOutput

func TableOutput(bodyJson []byte)

func YamlOutput

func YamlOutput(bodyJson []byte)

Types

type Body

type Body struct {
	Data    Data   `json:"data"`
	Message string `json:"message"`
}

type Data

type Data struct {
	ApiVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
	Name       string `json:"name"`
	Metadata   struct {
		Count int `json:"count"`
	} `json:"metadata"`
	Kwargs map[string]interface{} `json:"kwargs"`
	Data   InnerData              `json:"data"`
}

type InnerData

type InnerData struct {
	Titles []Title `json:"titles"`
	Items  []Item  `json:"items"`
}

type Item

type Item map[string]interface{}

type Title

type Title struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL