Class: XAeonAgents::Cli
- Inherits:
-
Thor
- Object
- Thor
- XAeonAgents::Cli
- Defined in:
- lib/x_aeon_agents/cli.rb
Overview
Main X-Aeon Agents CLI
Class Method Summary collapse
-
.exit_on_failure? ⇒ Boolean
Returns whether to exit on command failure.
Instance Method Summary collapse
-
#commit ⇒ Object
Commits staged changes with an AI-generated commit message.
-
#create_pr ⇒ Object
Push changes on Github and create a Pull Request.
-
#generate_readme ⇒ Object
Generates or updates the project README file.
-
#generate_skills ⇒ Object
Generates skill files from ERB templates in skills.src/.
-
#implement(requirements) ⇒ Object
Implements arbitrary requirements using AI.
-
#implement_issue(github_issue_number) ⇒ Object
Implements a GitHub issue using AI.
-
#install_skills ⇒ Object
Installs skills and their dependencies from the .skills manifest.
-
#interpret_diffs(base = 'HEAD') ⇒ Object
Summarizes current git diffs relative to a base ref.
-
#prompt(user_prompt) ⇒ Object
Sends a one-shot prompt to the AI agent and prints the response.
-
#review_comments(pull_request_number = nil) ⇒ Object
Addresses review comments on a GitHub Pull Request.
-
#start_task ⇒ Object
Opens a new git worktree for a feature branch.
Class Method Details
.exit_on_failure? ⇒ Boolean
Returns whether to exit on command failure.
369 370 371 |
# File 'lib/x_aeon_agents/cli.rb', line 369 def self.exit_on_failure? true end |
Instance Method Details
#commit ⇒ Object
Commits staged changes with an AI-generated commit message.
68 69 70 71 72 73 |
# File 'lib/x_aeon_agents/cli.rb', line 68 def commit Agents::CommitterAgent.new( session_id: [:session_id], stage: [:stage].to_sym ).run end |
#create_pr ⇒ Object
Push changes on Github and create a Pull Request.
99 100 101 102 103 104 105 |
# File 'lib/x_aeon_agents/cli.rb', line 99 def create_pr agent_kwargs = { base_sha: [:base] } agent_kwargs[:requirements] = [:requirements] if [:requirements] Agents::PullRequestCreatorAgent.new(session_id: [:session_id]).run(**agent_kwargs) end |
#generate_readme ⇒ Object
Generates or updates the project README file.
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/x_aeon_agents/cli.rb', line 149 def generate_readme agent_kwargs = { gen_about: [:about], gen_quick_start: [:quick_start], gen_requirements: [:requirements], gen_features: [:features], gen_public_api: [:public_api], gen_documentation: [:documentation], gen_how_it_works: [:how_it_works], gen_development: [:development], gen_contributing: [:contributing], gen_license: [:license] } agent_kwargs[:readme_file_path] = [:readme_file_path] if [:readme_file_path] Agents::ReadmeGeneratorAgent.new(session_id: [:session_id]).run(**agent_kwargs) end |
#generate_skills ⇒ Object
Exits with status 1 if skill generation fails
Generates skill files from ERB templates in skills.src/.
192 193 194 195 196 197 198 |
# File 'lib/x_aeon_agents/cli.rb', line 192 def generate_skills result = Agents::SkillGeneratorAgent.new(session_id: [:session_id]).run( output_dir: [:output_dir], skill_names: [:skill] ) exit 1 unless result[:success] end |
#implement(requirements) ⇒ Object
Implements arbitrary requirements using AI.
247 248 249 250 251 252 253 |
# File 'lib/x_aeon_agents/cli.rb', line 247 def implement(requirements) Agents::DeveloperAgent.new( commit: [:commit], pull_request: [:pr], session_id: [:session_id] ).run(requirements:) end |
#implement_issue(github_issue_number) ⇒ Object
Implements a GitHub issue using AI.
219 220 221 222 223 224 225 |
# File 'lib/x_aeon_agents/cli.rb', line 219 def implement_issue(github_issue_number) Agents::IssueImplementerAgent.new( commit: true, pull_request: true, session_id: [:session_id] ).run(github_issue_number: Integer(github_issue_number)) end |
#install_skills ⇒ Object
Installs skills and their dependencies from the .skills manifest.
327 328 329 330 331 |
# File 'lib/x_aeon_agents/cli.rb', line 327 def install_skills Agents::SkillInstallerAgent.new(session_id: [:session_id]).run( agent: [:agent].to_sym ) end |
#interpret_diffs(base = 'HEAD') ⇒ Object
Summarizes current git diffs relative to a base ref.
275 276 277 278 279 280 281 282 283 284 |
# File 'lib/x_aeon_agents/cli.rb', line 275 def interpret_diffs(base = 'HEAD') output = Agents::GitDiffInterpreterAgent.new(session_id: [:session_id]).run(git_ref_base: base) puts <<~EO_OUTPUT ===== Code diffs interpretation: #{output[:one_line_summary].strip} #{output[:change_intent].strip} EO_OUTPUT end |
#prompt(user_prompt) ⇒ Object
Sends a one-shot prompt to the AI agent and prints the response.
304 305 306 307 308 |
# File 'lib/x_aeon_agents/cli.rb', line 304 def prompt(user_prompt) agent = Agents::ExecutorAgent.new(session_id: [:session_id], **Config.['free_simple']) agent.run(user_instructions: user_prompt) puts agent.conversation.last[:message] end |
#review_comments(pull_request_number = nil) ⇒ Object
Addresses review comments on a GitHub Pull Request.
32 33 34 35 36 |
# File 'lib/x_aeon_agents/cli.rb', line 32 def review_comments(pull_request_number = nil) Agents::ReviewResolverAgent.new(session_id: [:session_id]).run( pull_request_number: pull_request_number ? Integer(pull_request_number) : nil ) end |
#start_task ⇒ Object
Opens a new git worktree for a feature branch.
354 355 356 357 358 359 360 |
# File 'lib/x_aeon_agents/cli.rb', line 354 def start_task branch = [:branch] || begin puts 'Branch name:' $stdin.gets.strip end Agents::TaskStarterAgent.new(session_id: [:session_id]).run(branch_name: branch) end |