Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AddCmd = &cobra.Command{ Use: "add <repo-url>", Short: "Add a new repository and clone it locally.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { repoURL := args[0] return addRepository(repoURL) }, }
View Source
var AskCmd = &cobra.Command{ Use: "ask <question>", Short: "Generate a TypeScript script from an OpenAI query.", Args: cobra.ArbitraryArgs, RunE: func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("please provide a question after 'query'") } question := strings.Join(args, " ") return askQuestion(question) }, }
View Source
var InfoCmd = &cobra.Command{ Use: "info", Short: "Displays information about projects and available scripts", RunE: func(cmd *cobra.Command, args []string) error { return displayInfo() }, }
InfoCmd represents the info command
View Source
var PRCmd = &cobra.Command{ Use: "pr <message>", Short: "Open a pull request for each repository (placeholder).", Args: cobra.ArbitraryArgs, RunE: WrapWithMetrics(func(cmd *cobra.Command, args []string) error { if len(args) == 0 { return errors.New("please provide a pull request message after 'pr'") } message := strings.Join(args, " ") return createPullRequest(message) }), }
View Source
var PullCmd = &cobra.Command{ Use: "pull", Short: "Pull the latest changes for all repositories in projects.json", RunE: WrapWithMetrics(func(cmd *cobra.Command, args []string) error { return pullAllRepositories(cmd) }), }
View Source
var RunCmd = &cobra.Command{ Use: "run [scriptName]", Short: "Run scripts across all projects in your configuration.", Args: cobra.MaximumNArgs(1), RunE: WrapWithMetrics(func(cmd *cobra.Command, args []string) error { // Optional argument: the user can provide a script name or path var scriptName string if len(args) == 1 { scriptName = args[0] } return runScript(cmd, scriptName) }), }
View Source
var SyncCmd = &cobra.Command{ Use: "sync <repository>", Short: "Sync project metadata from a specified code repository.", Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { repoType := strings.ToLower(args[0]) switch repoType { case "github": return syncFromGitHub() case "azure": fmt.Println("Azure sync is not implemented yet.") case "bitbucket": fmt.Println("Bitbucket sync is not implemented yet.") default: return errors.New("unsupported repository type") } return nil }, }
Functions ¶
func ExtractTypeScriptCode ¶
extractTypeScriptCode finds the first ```ts or ```typescript code block in a string and returns its contents.
func RunCmdInit ¶
Types ¶
type Project ¶
type Project struct {
Name string `json:"name"`
Path string `json:"path"`
RepoURL string `json:"repoUrl"`
Topics []string `json:"topics"`
Skip bool `json:"skip,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
}
Project and ProjectsJSON store information about cloned repos
type ProjectsJSON ¶
type ProjectsJSON struct {
Projects []Project `json:"projects"`
}
Click to show internal directories.
Click to hide internal directories.