Skip to content

P0: Add foreground mode with --prompt flag to 'local-agi agent run' #453

Description

@localai-bot

Overview

Add a foreground mode to the local-agi agent run command that allows running an agent synchronously with a prompt and printing the output directly to the foreground.

Current State

Issue #448 was closed, implementing the local-agi agent run command for standalone agent execution. However, the current implementation runs agents in background mode.

New Requirement

Add support for foreground execution mode with the following usage:

Expected Usage

Requirements

  1. Add a --prompt flag to the local-agi agent run command
  2. When --prompt is provided:
    • Create an agent instance (from name or JSON import)
    • Execute the agent's Ask("") method with the provided prompt
    • Collect and print the output directly to stdout
    • Exit after the operation completes (no background process)
  3. The foreground mode should work alongside the existing background mode
  4. Proper error handling and output formatting

Priority

P0 - This is a high-priority enhancement to the agent CLI functionality.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions