- Change module from forge.lthn.ai/core/go to forge.lthn.ai/core/cli - Remove pkg/ directory (now served from core/go) - Add require + replace for forge.lthn.ai/core/go => ../go - Update go.work to include ../go workspace module - Fix all internal/cmd/* imports: pkg/ refs → forge.lthn.ai/core/go/pkg/ - Rename internal/cmd/sdk package to sdkcmd (avoids conflict with pkg/sdk) - Remove SDK library files from internal/cmd/sdk/ (now in core/go/pkg/sdk/) - Remove duplicate RAG helper functions from internal/cmd/rag/ - Remove stale cmd/core-ide/ (now in core/ide repo) - Update IDE variant to remove core-ide import - Fix test assertion for new module name - Run go mod tidy to sync dependencies core/cli is now a pure CLI application importing core/go for packages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Claude <developers@lethean.io> Reviewed-on: #1
94 lines
2.3 KiB
Go
94 lines
2.3 KiB
Go
// Package ai provides AI agent task management and Claude Code integration.
|
|
//
|
|
// Commands:
|
|
// - tasks: List tasks from the agentic service
|
|
// - task: View, claim, or auto-select tasks
|
|
// - task:update: Update task status and progress
|
|
// - task:complete: Mark tasks as completed or failed
|
|
// - task:commit: Create commits with task references
|
|
// - task:pr: Create pull requests linked to tasks
|
|
// - claude: Claude Code CLI integration (planned)
|
|
// - rag: RAG tools (ingest, query, collections)
|
|
// - metrics: View AI/security event metrics
|
|
package ai
|
|
|
|
import (
|
|
ragcmd "forge.lthn.ai/core/cli/internal/cmd/rag"
|
|
"forge.lthn.ai/core/go/pkg/cli"
|
|
"forge.lthn.ai/core/go/pkg/i18n"
|
|
)
|
|
|
|
func init() {
|
|
cli.RegisterCommands(AddAICommands)
|
|
}
|
|
|
|
var aiCmd = &cli.Command{
|
|
Use: "ai",
|
|
Short: i18n.T("cmd.ai.short"),
|
|
Long: i18n.T("cmd.ai.long"),
|
|
}
|
|
|
|
var claudeCmd = &cli.Command{
|
|
Use: "claude",
|
|
Short: i18n.T("cmd.ai.claude.short"),
|
|
Long: i18n.T("cmd.ai.claude.long"),
|
|
}
|
|
|
|
var claudeRunCmd = &cli.Command{
|
|
Use: "run",
|
|
Short: i18n.T("cmd.ai.claude.run.short"),
|
|
RunE: func(cmd *cli.Command, args []string) error {
|
|
return runClaudeCode()
|
|
},
|
|
}
|
|
|
|
var claudeConfigCmd = &cli.Command{
|
|
Use: "config",
|
|
Short: i18n.T("cmd.ai.claude.config.short"),
|
|
RunE: func(cmd *cli.Command, args []string) error {
|
|
return showClaudeConfig()
|
|
},
|
|
}
|
|
|
|
func initCommands() {
|
|
// Add Claude subcommands
|
|
claudeCmd.AddCommand(claudeRunCmd)
|
|
claudeCmd.AddCommand(claudeConfigCmd)
|
|
|
|
// Add Claude command to ai
|
|
aiCmd.AddCommand(claudeCmd)
|
|
|
|
// Add agentic task commands
|
|
AddAgenticCommands(aiCmd)
|
|
|
|
// Add RAG subcommands (core ai rag ...)
|
|
ragcmd.AddRAGSubcommands(aiCmd)
|
|
|
|
// Add metrics subcommand (core ai metrics)
|
|
addMetricsCommand(aiCmd)
|
|
|
|
// Add agent management commands (core ai agent ...)
|
|
AddAgentCommands(aiCmd)
|
|
|
|
// Add rate limit management commands (core ai ratelimits ...)
|
|
AddRateLimitCommands(aiCmd)
|
|
|
|
// Add dispatch commands (core ai dispatch run/watch/status)
|
|
AddDispatchCommands(aiCmd)
|
|
}
|
|
|
|
// AddAICommands registers the 'ai' command and all subcommands.
|
|
func AddAICommands(root *cli.Command) {
|
|
initCommands()
|
|
root.AddCommand(aiCmd)
|
|
}
|
|
|
|
func runClaudeCode() error {
|
|
// Placeholder - will integrate with claude CLI
|
|
return nil
|
|
}
|
|
|
|
func showClaudeConfig() error {
|
|
// Placeholder - will show claude configuration
|
|
return nil
|
|
}
|