using System.CommandLine; using MycroForge.CLI.Commands.Attributes; using MycroForge.Core; using MycroForge.Core.Contract; namespace MycroForge.CLI.Commands; public partial class MycroForge { [RequiresFile("requirements.txt")] public class Hydrate : Command, ISubCommandOf { private readonly ProjectContext _context; public Hydrate(ProjectContext context) : base("hydrate", "Initialize venv and install dependencies from requirements.txt") { _context = context; this.SetHandler(ExecuteAsync); } private async Task ExecuteAsync() { await _context.Bash( "python3 -m venv .venv", "source .venv/bin/activate", "python3 -m pip install -r requirements.txt" ); } } }