nlcli

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package nlcli implements natural language CLI dispatch: it sends a free-text user instruction plus the list of available cloop commands to an AI provider and receives back a concrete CLI invocation that can be re-executed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterpretResult

type InterpretResult struct {
	// Command is the cloop sub-command (e.g. "run", "task", "pivot").
	Command string `json:"command"`
	// Args are the positional and flag arguments for the sub-command.
	Args []string `json:"args"`
	// Explanation is a short human-readable description of what the resolved
	// command will do.
	Explanation string `json:"explanation"`
}

InterpretResult is the structured response returned by the AI.

func Interpret

func Interpret(
	ctx context.Context,
	p provider.Provider,
	model string,
	input string,
	availableCommands []string,
) (*InterpretResult, error)

Interpret sends the user instruction plus the available command list to the AI provider and returns the resolved sub-command, its arguments, and a plain English explanation of what will be run.

  • ctx — request context (use for timeout/cancellation)
  • p — AI provider to use for the call
  • model — model override; empty string uses the provider default
  • input — free-text user instruction (e.g. "show me what tasks are left")
  • availableCommands — slice of command name strings (e.g. "run", "status", ...)

Jump to

Keyboard shortcuts

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