Files
LazyPM/pkg/cli/commands/create.go
Robin Olsen 0dcfe3989d refine architecture
change module name to repo
2026-02-02 11:22:20 +01:00

35 lines
756 B
Go

package commands
import (
"github.com/LazyBachelor/LazyPM/internal/models"
"fmt"
"os"
"github.com/spf13/cobra"
)
var createCmd = &cobra.Command{
Use: "create",
Short: "Create a new issue",
Long: `Create a new issue with the specified details.`,
RunE: runCreateCmd,
}
func runCreateCmd(cmd *cobra.Command, args []string) error {
issue := &models.Issue{
Title: "test",
Description: "This is a test issue created by the CLI.",
Status: models.StatusOpen,
IssueType: models.TypeBug,
Priority: 0,
}
err := svc.Beads.CreateIssue(cmd.Context(), issue, "test_actor")
if err != nil {
fmt.Fprintf(os.Stderr, "Error creating issue: %v\n", err)
os.Exit(1)
}
fmt.Printf("Created issue: %s\n", issue.ID)
return nil
}