Skip to content

Commit f5502c3

Browse files
committed
Add AI agent command to CLI
2 parents 1c4f5f1 + 6ae4f1f commit f5502c3

5 files changed

Lines changed: 477 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ else()
105105
set(_VIX_P2P_DIR "${_VIX_MODULES_DIR}/p2p")
106106
set(_VIX_SYNC_DIR "${_VIX_MODULES_DIR}/sync")
107107
set(_VIX_CACHE_DIR "${_VIX_MODULES_DIR}/cache")
108+
set(_VIX_AGENT_DIR "${_VIX_MODULES_DIR}/agent")
108109

109110
set(_LOCAL_LAYOUT_OK FALSE)
110111
if (EXISTS "${_VIX_CORE_DIR}/CMakeLists.txt" AND EXISTS "${_VIX_UTILS_DIR}/CMakeLists.txt")
@@ -146,6 +147,10 @@ else()
146147
add_subdirectory("${_VIX_CACHE_DIR}" "${CMAKE_BINARY_DIR}/_vix_cache")
147148
endif()
148149

150+
if (EXISTS "${_VIX_AGENT_DIR}/CMakeLists.txt" AND NOT TARGET vix::ai_agent)
151+
add_subdirectory("${_VIX_AGENT_DIR}" "${CMAKE_BINARY_DIR}/_vix_ai_agent")
152+
endif()
153+
149154
if (EXISTS "${_VIX_P2P_DIR}/CMakeLists.txt" AND NOT TARGET vix::p2p)
150155
add_subdirectory("${_VIX_P2P_DIR}" "${CMAKE_BINARY_DIR}/_vix_p2p")
151156
endif()
@@ -186,6 +191,10 @@ else()
186191
list(APPEND _VIX_LOCAL_LINK_TARGETS vix::cache)
187192
endif()
188193

194+
if (TARGET vix::ai_agent)
195+
list(APPEND _VIX_LOCAL_LINK_TARGETS vix::ai_agent)
196+
endif()
197+
189198
if (TARGET vix::p2p)
190199
list(APPEND _VIX_LOCAL_LINK_TARGETS vix::p2p)
191200
endif()
@@ -200,6 +209,7 @@ else()
200209
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_CRYPTO_DIR}/include")
201210
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_SYNC_DIR}/include")
202211
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_CACHE_DIR}/include")
212+
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_AGENT_DIR}/include")
203213
vix_append_if_exists(_VIX_LOCAL_INCLUDE_DIRS "${_VIX_P2P_DIR}/include")
204214

205215
if (_VIX_LOCAL_LINK_TARGETS)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/**
2+
*
3+
* @file AgentCommand.hpp
4+
* @author Gaspard Kirira
5+
*
6+
* Copyright 2026, Gaspard Kirira.
7+
* All rights reserved.
8+
* https://github.com/vixcpp/vix
9+
*
10+
* Use of this source code is governed by a MIT license
11+
* that can be found in the License file.
12+
*
13+
* Vix.cpp
14+
*
15+
*/
16+
#ifndef VIX_AGENT_COMMAND_HPP
17+
#define VIX_AGENT_COMMAND_HPP
18+
19+
#include <string>
20+
#include <vector>
21+
22+
namespace vix::commands::AgentCommand
23+
{
24+
int run(const std::vector<std::string> &args);
25+
int help();
26+
}
27+
28+
#endif // VIX_AGENT_COMMAND_HPP

src/CLI.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <vix/cli/commands/CleanCommand.hpp>
5050
#include <vix/cli/commands/ResetCommand.hpp>
5151
#include <vix/cli/commands/TaskCommand.hpp>
52+
#include <vix/cli/commands/AgentCommand.hpp>
5253
#include <vix/utils/Env.hpp>
5354
#include <vix/cli/Style.hpp>
5455
#include <vix/utils/Logger.hpp>
@@ -282,6 +283,8 @@ namespace vix
282283
{ return commands::ResetCommand::run(args); };
283284
commands_["task"] = [](auto args)
284285
{ return commands::TaskCommand::run(args); };
286+
commands_["agent"] = [](auto args)
287+
{ return commands::AgentCommand::run(args); };
285288

286289
commands_["-h"] = [this](auto args)
287290
{ return help(args); };

0 commit comments

Comments
 (0)