feat: add standalone agent CLI command#8891
Open
localai-bot wants to merge 3 commits intomudler:masterfrom
Open
feat: add standalone agent CLI command#8891localai-bot wants to merge 3 commits intomudler:masterfrom
localai-bot wants to merge 3 commits intomudler:masterfrom
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mudler
reviewed
Mar 9, 2026
| return fmt.Errorf("failed to create agent %q: %w", agentConfig.Name, err) | ||
| } | ||
|
|
||
| xlog.Info("Agent started successfully", "name", agentConfig.Name) |
Owner
There was a problem hiding this comment.
Optionally, if the user specifies a prompt, we will ask to the agent directly and exit. no background service
mudler
reviewed
Mar 9, 2026
core/cli/agent_test.go
Outdated
| "github.com/mudler/LocalAGI/core/state" | ||
| ) | ||
|
|
||
| func TestIsJSONFile(t *testing.T) { |
Owner
There was a problem hiding this comment.
tests should be written with ginkgo as the others
mudler
reviewed
Mar 9, 2026
core/cli/agent.go
Outdated
| // loadFromRegistry fetches an agent configuration from the agent hub registry. | ||
| func (a *AgentRunCMD) loadFromRegistry(name string) (*state.AgentConfig, error) { | ||
| hubURL := strings.TrimRight(a.AgentHubURL, "/") | ||
| endpoint := fmt.Sprintf("%s/api/agents/%s", hubURL, name) |
Owner
There was a problem hiding this comment.
there is no such endpoint . This is an example of URL of an agent: https://agenthub.localai.io/agents/OpenCodeAgent.json
Contributor
Author
Fix Update AddressedI've addressed the review feedback from @mudler: Changes Made:
Commit:
All changes have been pushed to the branch. Awaiting CI confirmation and further review. |
localai-bot
added a commit
to localai-bot/LocalAI
that referenced
this pull request
Mar 10, 2026
- Add --prompt flag to allow sending a prompt to the agent directly - Add sendPrompt() method to handle HTTP request to agent - AgentHub URL was already using correct format (/agents/%s.json) Addresses PR review feedback for PR mudler#8891 Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
localai-bot
added a commit
to localai-bot/LocalAI
that referenced
this pull request
Mar 11, 2026
- Add --prompt flag to allow sending a prompt to the agent directly - Add sendPrompt() method to handle HTTP request to agent - AgentHub URL was already using correct format (/agents/%s.json) Addresses PR review feedback for PR mudler#8891 Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
1447777 to
42e74fd
Compare
- Add 'local-ai agent run' command for standalone agent execution - Support running agents from JSON config file or agent registry lookup - Add agent configuration parsing and validation - Implement standalone agent execution with signal handling - Add comprehensive tests - Update documentation Signed-off-by: claude-agent-1 <claude-agent-1@localai.io>
- Convert agent_test.go from standard Go testing to ginkgo/gomega framework - Add cli_suite_test.go for ginkgo test runner - Fix agent registry URL to use correct format: /agents/<name>.json - Add comment explaining future prompt behavior (ask agent directly and exit) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: claude-agent-1 <claude-agent-1@localai.io>
- Add --prompt flag to allow sending a prompt to the agent directly - Add sendPrompt() method to handle HTTP request to agent - AgentHub URL was already using correct format (/agents/%s.json) Addresses PR review feedback for PR mudler#8891 Signed-off-by: localai-bot <localai-bot@users.noreply.github.com> Signed-off-by: claude-agent-1 <claude-agent-1@localai.io>
42e74fd to
dbf0d30
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implemented a new CLI command for running agents in standalone mode in LocalAI.
Changes
local-ai agent run <agent-name>commandlocal-ai agent run --config <path/to/agent.json>commandImplementation
core/cli/agent.go,core/cli/agent_test.gocore/cli/cli.go,docs/content/features/agents.mdThis addresses the P0 task for standalone agent execution CLI in both LocalAI and LocalAGI repositories.
Closes task: 20260308_214118_p0_agent_standalone_cli