Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CreateCmd = &cobra.Command{ Use: "create", Short: "Create a new workspace", Long: `Create a new workspace with selected tasks`, Run: func(cmd *cobra.Command, args []string) { source, _ := cmd.Flags().GetString("from-json") if source != "" { workspaces, err := repository.ReadJSONSource[[]models.Workspace](source) if err != nil { styles.PrintError(fmt.Sprintf("Failed to read source: %v", err)) os.Exit(1) } if err := repository.ImportWorkspaces(workspaces); err != nil { styles.PrintError(fmt.Sprintf("Import failed:\n%v", err)) os.Exit(1) } styles.PrintSuccess(fmt.Sprintf("%d workspace(s) imported successfully!", len(workspaces))) os.Exit(0) } if err := CreateWorkspaceCommand(); err != nil { styles.PrintError(fmt.Sprintf("Failed to create workspace: %v", err)) } }, }
createWorkspaceCmd creates a new workspace, or imports workspaces from JSON when --from-json is set.
var DeleteCmd = &cobra.Command{ Use: "delete <name>", Short: "Delete a workspace", Long: `Delete a workspace with the specified name`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { workspaceName := args[0] if _, err := repository.FindWorkspaceByName(workspaceName); err != nil { styles.PrintError(fmt.Sprintf("Workspace '%s' not found", workspaceName)) return } if err := repository.DeleteWorkspace(workspaceName); err != nil { styles.PrintError(fmt.Sprintf("Failed to delete workspace '%s': %v", workspaceName, err)) return } styles.PrintSuccess(fmt.Sprintf("Workspace '%s' deleted successfully!", workspaceName)) }, }
DeleteCmd deletes a workspace specified by name.
var EditCmd = &cobra.Command{ Use: "edit <name>", Short: "Edit an existing workspace", Long: `Edit an existing workspace with the specified name`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { workspaceName := args[0] if err := EditWorkspaceCommand(workspaceName); err != nil { styles.PrintError(fmt.Sprintf("Failed to edit workspace '%s': %v", workspaceName, err)) } }, }
EditCmd opens the TUI form to edit an existing workspace.
var ListCmd = &cobra.Command{ Use: "list", Short: "List all workspaces", Long: `Display a list of all configured workspaces`, Run: func(cmd *cobra.Command, args []string) { styles.PrintInfo("Workspace listing not yet implemented") }, }
listWorkspacesCmd lists all saved workspaces
var RunCmd = &cobra.Command{ Use: "run <name>", Short: "Run a workspace", Long: `Execute all tasks defined in a workspace`, Args: cobra.ExactArgs(1), ValidArgsFunction: completeWorkspaceNames, Run: func(cmd *cobra.Command, args []string) { workspaceName := args[0] runner, err := vscode.NewRunner() if err != nil { styles.PrintError(fmt.Sprintf("Failed to connect to secure VSCode: %v", err)) return } if err := runner.RunWorkspace(workspaceName); err != nil { styles.PrintError(fmt.Sprintf("Error running workspace: %v", err)) return } }, }
RunCmd runs a workspace by name
Functions ¶
func CreateWorkspaceCommand ¶
func CreateWorkspaceCommand() error
CreateWorkspaceCommand creates a new workspace using the TUI form.
func EditWorkspaceCommand ¶
EditWorkspaceCommand edits an existing workspace using the TUI form.
func NewEditWorkspaceModel ¶
NewEditWorkspaceModel creates a workspace editing form with pre-filled data.
func NewWorkspaceModel ¶
NewWorkspaceModel creates a new workspace creation form.
Types ¶
type WorkspaceModel ¶
type WorkspaceModel struct {
// contains filtered or unexported fields
}
WorkspaceModel represents the form for creating/editing workspaces.
func (*WorkspaceModel) Init ¶
func (w *WorkspaceModel) Init() tea.Cmd
Init initializes the workspace form model.
func (*WorkspaceModel) View ¶
func (w *WorkspaceModel) View() string
View renders the workspace form.