feat: add standalone agent CLI command#8891
feat: add standalone agent CLI command#8891localai-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. |
| return fmt.Errorf("failed to create agent %q: %w", agentConfig.Name, err) | ||
| } | ||
|
|
||
| xlog.Info("Agent started successfully", "name", agentConfig.Name) |
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
core/cli/agent_test.go
Outdated
| "github.com/mudler/LocalAGI/core/state" | ||
| ) | ||
|
|
||
| func TestIsJSONFile(t *testing.T) { |
There was a problem hiding this comment.
tests should be written with ginkgo as the others
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) |
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
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. |
- 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>
- 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 --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>
dbf0d30 to
1447777
Compare
|
I've addressed the feedback:
The only change pushed was removing the redundant comment. No functional changes were needed. |
- 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
5417a32
Compare
DCO Fix AppliedI've amended the latest commit to include a proper DCO sign-off. The commit message has been cleaned up to have exactly one line. Changes Made:
The branch has been force-pushed with the corrected commit. CI should now pass the DCO check. |
DCO Fix AppliedI have amended the latest commit to include a proper DCO sign-off. The commit message has been cleaned up to have exactly one Signed-off-by line. Changes Made:
The branch has been force-pushed with the corrected commit. CI should now pass the DCO check. |
- 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 (cherry picked from commit 7040354) Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
- 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> (cherry picked from commit cd2cf9a) Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
- 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> (cherry picked from commit 5417a32) Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
5417a32 to
1d3ab2f
Compare
DCO Fix AppliedI've fixed the DCO sign-off issues on all commits in this branch: Changes Made:
Commits Fixed:
The branch has been force-pushed with the corrected commits. DCO check should now pass. |
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