agently

package
v0.2.28 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string)

Run parses flags and executes the selected command.

func RunWithCommands

func RunWithCommands(args []string)

RunWithCommands is kept for symmetry with scy CLI.

func SetVersion added in v0.2.6

func SetVersion(v string)

SetVersion initializes the version string if non-empty.

func Version added in v0.2.6

func Version() string

Version returns the current CLI version string.

Types

type ChatCmd

type ChatCmd struct {
	AgentID   string `short:"a" long:"agent-id" description:"agent id"`
	Query     string `short:"q" long:"query"    description:"user query"`
	ConvID    string `short:"c" long:"conv"     description:"conversation ID (optional)"`
	Policy    string `short:"p" long:"policy" description:"tool policy: auto|ask|deny" default:"auto"`
	ResetLogs bool   `long:"reset-logs" description:"truncate/clean log files before each run"  `
	Timeout   int    `short:"t" long:"timeout" description:"timeout in seconds for the agent response (0=none)" `
	User      string `short:"u" long:"user" description:"user id for the chat" default:"devuser"`

	// Arbitrary JSON payload that will be forwarded to the agent as contextual
	// information. It can be supplied either as an inline JSON string or as
	// @<path> pointing to a file containing the JSON document.
	Context string `long:"context" description:"inline JSON object or @file with context data"`

	// Attach allows adding one or more files to the LLM request. Repeatable.
	// Format: <path>[::caption]
	Attach []string `long:"attach" description:"file to attach (repeatable). Format: <path>[::caption]"`
}

ChatCmd handles interactive/chat queries.

func (*ChatCmd) Execute

func (c *ChatCmd) Execute(_ []string) error

type ExecCmd

type ExecCmd struct {
	Name       string `short:"n" long:"name" positional-arg-name:"tool" description:"Tool name (service_method)" required:"yes"`
	Inline     string `short:"i" long:"input" description:"Inline JSON arguments (object)"`
	File       string `short:"f" long:"file" description:"Path to JSON file with arguments (use - for stdin)"`
	TimeoutSec int    `long:"timeout" description:"Seconds to wait for completion" default:"120"`
	JSON       bool   `long:"json" description:"Print result as JSON"`
}

ExecCmd executes a registered tool via the Agently executor. It mirrors the provides a consistent experience for ad‑hoc tool execution.

func (*ExecCmd) Execute

func (c *ExecCmd) Execute(_ []string) error

type ListCmd

type ListCmd struct{}

ListCmd prints conversation IDs known to the history store.

func (*ListCmd) Execute

func (c *ListCmd) Execute(_ []string) error

type ListToolsCmd

type ListToolsCmd struct {
	Name string `short:"n" long:"name" description:"Tool name (service_method) to show full definition"`
	JSON bool   `long:"json" description:"Print result as JSON instead of table/plain text"`
}

ListToolsCmd prints all registered tools (service/method) with optional description. ListToolsCmd prints all registered tools or details for a single tool.

Without any flags it prints a table containing tool name and description.

When -n/--name is supplied it looks up that specific tool and prints its definition. Use --json to emit the definition as prettified JSON rather than a human-readable format. When --json is provided without --name the full catalogue is printed as JSON.

func (*ListToolsCmd) Execute

func (c *ListToolsCmd) Execute(_ []string) error

type McpAddCmd

type McpAddCmd struct {
	Name string `short:"n" long:"name" required:"yes" description:"identifier"`

	// Accept legacy and new aliases: stdio|sse|streaming plus streamable/streamableHTTP
	Type string `` /* 127-byte string literal not displayed */

	// HTTP
	URL string `long:"url" description:"server URL when type=sse|streaming"`

	// stdio
	Command   string   `long:"command" description:"command path when type=stdio"`
	Arguments []string `long:"arg" description:"extra arguments (repeatable)"`
}

func (*McpAddCmd) Execute

func (c *McpAddCmd) Execute(_ []string) error

type McpCmd

type McpCmd struct {
	Add    *McpAddCmd    `command:"add" description:"Add or update MCP server"`
	Remove *McpRemoveCmd `command:"remove" description:"Delete MCP server"`
	List   *McpListCmd   `command:"list" description:"List MCP servers"`
}

type McpListCmd

type McpListCmd struct {
	JSON bool `long:"json" description:"output full JSON objects"`
}

func (*McpListCmd) Execute

func (c *McpListCmd) Execute(_ []string) error

type McpRemoveCmd

type McpRemoveCmd struct {
	Name string `short:"n" long:"name" required:"yes" description:"identifier to delete"`
}

func (*McpRemoveCmd) Execute

func (c *McpRemoveCmd) Execute(_ []string) error

type ModelResetCmd

type ModelResetCmd struct {
	Agent string `short:"a" long:"agent" description:"agent file name (without extension)" required:"yes"`
}

func (*ModelResetCmd) Execute

func (c *ModelResetCmd) Execute(_ []string) error

type ModelSwitchCmd

type ModelSwitchCmd struct {
	Agent string `short:"a" long:"agent" description:"agent file name (without extension)" required:"yes"`
	Model string `short:"m" long:"model" description:"model name to set as default" required:"yes"`
}

func (*ModelSwitchCmd) Execute

func (c *ModelSwitchCmd) Execute(_ []string) error

type Options

type Options struct {
	Version     bool            `short:"v" long:"version" description:"Show agently version and exit"`
	Config      string          `short:"f" long:"config" description:"executor config YAML/JSON path"`
	Chat        *ChatCmd        `command:"chat"  description:"Chat with an agent (single turn or continuation)"`
	List        *ListCmd        `command:"list"  description:"List existing conversations"`
	ListTools   *ListToolsCmd   `command:"list-tools" description:"List available tools"`
	Exec        *ExecCmd        `command:"exec" description:"Execute a tool"`
	Run         *RunCmd         `command:"run"   description:"Run agentic workflow from JSON input"`
	ModelSwitch *ModelSwitchCmd `command:"model-switch" description:"Switch agent default model"`
	ModelReset  *ModelResetCmd  `command:"model-reset" description:"Clear agent model override"`
	Workspace   *WorkspaceCmd   `command:"ws" description:"Workspace CRUD operations"`
	Serve       *ServeCmd       `command:"serve" description:"StartedAt HTTP server"`
	MCP         *McpCmd         `command:"mcp" description:"Manage MCP servers"`
}

Options is the root command that groups sub-commands. The struct tags are interpreted by github.com/jessevdk/go-flags.

func (*Options) Init

func (o *Options) Init(firstArg string)

Init instantiates the sub-command referenced by the first argument so that flags.Parse can populate its fields.

type RunCmd

type RunCmd struct {
	Location  string `short:"l" long:"location" description:"agent definition path"`
	InputFile string `short:"i" long:"input"    description:"JSON file with QueryInput (stdin if empty)"`
	Policy    string `long:"policy" description:"tool policy: auto|ask|deny" default:"auto"`
}

RunCmd executes full agentic workflow from JSON payload.

func (*RunCmd) Execute

func (r *RunCmd) Execute(_ []string) error

type ServeCmd

type ServeCmd struct {
	Addr   string `short:"a" long:"addr" description:"listen address" default:":8080"`
	Policy string `short:"p" long:"policy" description:"tool policy: auto|ask|deny" default:"auto"`

	// Unified log file capturing LLM, tool and task events. Defaults to
	// "agently.log" in the current working directory when empty.
	Log string `long:"log" description:"unified log (LLM, TOOL, TASK)" default:"agently.log"`
}

ServeCmd starts the embedded HTTP server. Usage: agently serve --addr :8080

func (*ServeCmd) Execute

func (s *ServeCmd) Execute(_ []string) error

type WorkspaceCmd

type WorkspaceCmd struct {
	List   *WsListCmd   `command:"list" description:"List resources (agents|models|workflows)"`
	Get    *WsGetCmd    `command:"get" description:"Print resource YAML"`
	Add    *WsAddCmd    `command:"add" description:"Add or overwrite a resource"`
	Remove *WsRemoveCmd `command:"remove" description:"Delete resource"`
}

WorkspaceCmd groups workspace sub-commands.

type WsAddCmd

type WsAddCmd struct {
	File string `short:"f" long:"file" description:"YAML file ('-' for stdin)"`
	// contains filtered or unexported fields
}

---- add ------------------------------------------------------------------

func (*WsAddCmd) Execute

func (c *WsAddCmd) Execute(_ []string) error

type WsGetCmd

type WsGetCmd struct {
	// contains filtered or unexported fields
}

---- get ------------------------------------------------------------------

func (*WsGetCmd) Execute

func (c *WsGetCmd) Execute(_ []string) error

type WsListCmd

type WsListCmd struct {
	// contains filtered or unexported fields
}

---- list -----------------------------------------------------------------

func (*WsListCmd) Execute

func (c *WsListCmd) Execute(_ []string) error

type WsRemoveCmd

type WsRemoveCmd struct {
	// contains filtered or unexported fields
}

---- remove ---------------------------------------------------------------

func (*WsRemoveCmd) Execute

func (c *WsRemoveCmd) Execute(_ []string) error

Jump to

Keyboard shortcuts

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