Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 31 additions & 28 deletions cmd/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ Examples:
agentuity project delete
agentuity project rm`,
Aliases: []string{"rm", "del"},
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
defer cancel()
Expand All @@ -799,43 +798,47 @@ Examples:
apiUrl, _, _ := util.GetURLs(logger)
orgId, _ := cmd.Flags().GetString("org-id")

var projects []project.ProjectListData
action := func() {
projects = listProjects(ctx, logger, apiUrl, apikey, orgId)
}
tui.ShowSpinner("fetching projects ...", action)
var options []tui.Option
for _, project := range projects {
desc := project.Description
if desc == "" {
desc = emptyProjectDescription
}
options = append(options, tui.Option{
ID: project.ID,
Text: tui.Bold(tui.PadRight(project.Name, 20, " ")) + tui.Muted(project.ID),
})
}
var selected []string
if len(args) > 0 {
selected = args
} else {

if len(options) == 0 {
showNoProjects(orgId)
return
}
var projects []project.ProjectListData
action := func() {
projects = listProjects(ctx, logger, apiUrl, apikey, orgId)
}
tui.ShowSpinner("fetching projects ...", action)
var options []tui.Option
for _, project := range projects {
options = append(options, tui.Option{
ID: project.ID,
Text: tui.Bold(tui.PadRight(project.Name, 20, " ")) + tui.Muted(project.ID),
})
}

selected := tui.MultiSelect(logger, "Select one or more projects to delete", "", options)
if len(options) == 0 {
showNoProjects(orgId)
return
}

if len(selected) == 0 {
tui.ShowWarning("no projects selected")
return
selected = tui.MultiSelect(logger, "Select one or more projects to delete", "", options)

if len(selected) == 0 {
tui.ShowWarning("no projects selected")
return
}
}

if !tui.Ask(logger, "Are you sure you want to delete the selected projects?", true) {
force, _ := cmd.Flags().GetBool("force")

if !force && !tui.Ask(logger, "Are you sure you want to delete the selected projects?", true) {
tui.ShowWarning("cancelled")
return
}

var deleted []string

action = func() {
action := func() {
var err error
deleted, err = project.DeleteProjects(ctx, logger, apiUrl, apikey, selected)
if err != nil {
Expand Down Expand Up @@ -957,5 +960,5 @@ func init() {
projectImportCmd.Flags().MarkHidden("org-id")

projectDeleteCmd.Flags().String("org-id", "", "Only delete the projects in the specified organization")

projectDeleteCmd.Flags().Bool("force", false, "Force the removal without confirmation")
}
1 change: 1 addition & 0 deletions internal/ignore/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func (r *Rules) AddDefaults() {
r.parseRule("**/.vscode/**")
r.parseRule("**/.agentuity-*")
r.parseRule("**/biome.json")
r.parseRule("**/.DS_Store")
}

// Add a rule to the ignore set.
Expand Down
Loading