agently

package
v0.2.48 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 63 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 (repeatable)"`
	ConvID    string   `short:"c" long:"conv"     description:"conversation ID (optional)"`
	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"`
	API       string   `long:"api" description:"Agently base URL (skips auto-detect)" `
	Token     string   `long:"token" description:"Bearer token for API requests (overrides AGENTLY_TOKEN)" `
	OOB       bool     `long:"oob" description:"Use server-side OAuth2 out-of-band login (requires --oauth-secrets)"`
	OAuthCfg  string   `long:"oauth-config" description:"scy OAuth config URL for client-side OOB login (unused for server OOB)"`
	OAuthSec  string   `long:"oauth-secrets" description:"scy OAuth secrets URL for OOB login"`
	OAuthScp  string   `long:"oauth-scopes" description:"comma-separated OAuth scopes for OOB login"`
	Stream    bool     `long:"stream" description:"force SSE streaming (disable poll fallback)"`
	ElicitDef string   `long:"elicitation-default" description:"JSON or @file to auto-accept elicitations when stdin is not a TTY"`

	// 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>
	Attach []string `long:"attach" description:"file to attach (repeatable). Format: <path>"`
}

ChatCmd handles interactive/chat queries.

func (*ChatCmd) Execute

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

type ChatGPTLoginCmd added in v0.2.30

type ChatGPTLoginCmd struct {
	ClientURL          string `long:"clientURL" description:"scy resource for OAuth client config (must contain client_id, optional client_secret)"`
	TokensURL          string `long:"tokensURL" description:"scy resource where ChatGPT OAuth token state will be stored (default: derived from clientURL)"`
	Issuer             string `long:"issuer" description:"OAuth issuer base URL (default: from client config, else https://auth.openai.com)"`
	AllowedWorkspaceID string `long:"allowedWorkspaceID" description:"restrict login to a specific ChatGPT workspace/account id"`
	Originator         string `long:"originator" description:"originator query param used by OpenAI auth (default: codex_cli_rs)" default:"codex_cli_rs"`
	Port               int    `long:"port" description:"local callback server port (must match OAuth redirect allowlist; default: 1455)" default:"1455"`

	NoOpenBrowser bool `long:"no-open-browser" description:"do not open the authorization URL in the default browser"`
	NoMintAPIKey  bool `long:"no-mint-api-key" description:"do not mint and cache an OpenAI API key after login"`
	RequireMint   bool `long:"require-mint-api-key" description:"fail the command if API key minting fails"`
	TimeoutSec    int  `long:"timeout" description:"callback wait timeout in seconds" default:"300"`
}

func (*ChatGPTLoginCmd) Execute added in v0.2.30

func (c *ChatGPTLoginCmd) 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"`
	Scheduler    *SchedulerCmd    `command:"scheduler" description:"Scheduler runner and utilities"`
	MCP          *McpCmd          `command:"mcp" description:"Manage MCP servers"`
	ChatGPTLogin *ChatGPTLoginCmd `command:"chatgpt-login" description:"Login via ChatGPT OAuth and persist tokens for OpenAI providers"`
}

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 SchedulerCmd added in v0.2.31

type SchedulerCmd struct {
	Run SchedulerRunCmd `command:"run" description:"Run the scheduler watchdog loop"`
}

SchedulerCmd groups scheduler-related subcommands.

type SchedulerRunCmd added in v0.2.31

type SchedulerRunCmd struct {
	Interval string `long:"interval" description:"RunDue polling interval (e.g. 30s, 1m)" default:"30s"`
	Once     bool   `long:"once" description:"Run one RunDue cycle and exit"`
}

SchedulerRunCmd starts the scheduler watchdog loop as a dedicated process. Usage: agently scheduler run --interval 30s

func (*SchedulerRunCmd) Execute added in v0.2.31

func (s *SchedulerRunCmd) 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"`
	ExposeMCP bool   `` /* 130-byte string literal not displayed */

	// 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