first commit

This commit is contained in:
Robin Olsen
2026-01-31 16:00:23 +01:00
commit a3a1d71325
23 changed files with 614 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package commands
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/steveyegge/beads"
)
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 := &beads.Issue{
Title: "test",
Description: "This is a test issue created by the CLI.",
Status: beads.StatusOpen,
IssueType: beads.TypeBug,
Priority: 0,
}
err := svc.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
}

24
cmd/cli/commands/root.go Normal file
View File

@@ -0,0 +1,24 @@
package commands
import (
"beadstest/internal/service"
"github.com/spf13/cobra"
)
var svc *service.Service
var rootCmd = &cobra.Command{
Use: "pm",
Short: "Project Management CLI",
Long: `Project Management CLI for managing issues and tasks.`,
}
func Execute(beadsService *service.Service) error {
svc = beadsService
return rootCmd.Execute()
}
func init() {
rootCmd.AddCommand(createCmd)
}