Documentation
¶
Index ¶
- Variables
- func AddCmdInit(cmd *cobra.Command)
- func CMD_addRepository(repoURL string, token string, user string) error
- func CMD_ask(question string) error
- func CMD_info(debug bool) error
- func CMD_loadCSVs(dbPath string, files []string) error
- func CMD_plan(topics []string, script string) error
- func CMD_pullRepos(topics []string, githubToken string, githubUser string, githubUpdateToken bool) error
- func CMD_runScript(scriptName string, topics []string, all bool, count bool, ...) error
- func CMD_syncRepos() error
- func LoadCmdInit(cmd *cobra.Command)
- func PullCmdInit(cmd *cobra.Command)
- func RunCmdInit(cmd *cobra.Command)
Constants ¶
This section is empty.
Variables ¶
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] token, _ := cmd.Flags().GetString("githubToken") user, _ := cmd.Flags().GetString("githubUser") return CMD_addRepository(repoURL, token, user) }, }
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 CMD_ask(question) }, }
var InfoCmd = &cobra.Command{ Use: "info", Short: "Displays information about projects and available scripts", RunE: func(cmd *cobra.Command, args []string) error { debug, _ := cmd.Flags().GetBool("debug") return CMD_info(debug) }, }
var LoadCmd = &cobra.Command{ Use: "load [flags] <csv1> <csv2> …", Short: "Load one or more CSV files into an SQLite database", Args: cobra.MinimumNArgs(0), RunE: withMetrics(func(cmd *cobra.Command, args []string) error { dbPath, _ := cmd.Flags().GetString("db") return CMD_loadCSVs(dbPath, args) }), }
var PlanCmd = &cobra.Command{ Use: "plan [script]", Short: "Plan changes across projects", Args: cobra.MaximumNArgs(1), RunE: withMetrics(func(cmd *cobra.Command, args []string) error { topics, _ := cmd.Flags().GetStringSlice("topics") var script string if len(args) > 0 { script = args[0] } return CMD_plan(topics, script) }), }
var PullCmd = &cobra.Command{ Use: "pull", Short: "Pull the latest changes for all repositories in projects.json", RunE: withMetrics(func(cmd *cobra.Command, args []string) error { topics, _ := cmd.Flags().GetStringSlice("topics") githubToken, _ := cmd.Flags().GetString("githubToken") githubUser, _ := cmd.Flags().GetString("githubUser") githubUpdateToken, _ := cmd.Flags().GetBool("githubUpdateToken") return CMD_pullRepos(topics, githubToken, githubUser, githubUpdateToken) }), }
var RunCmd = &cobra.Command{ Use: "run [scriptName]", Short: "Run scripts across all projects in your configuration.", RunE: withMetrics(func(cmd *cobra.Command, args []string) error { topics, _ := cmd.Flags().GetStringSlice("topics") count, _ := cmd.Flags().GetBool("count") all, _ := cmd.Flags().GetBool("all") outputFormats, _ := cmd.Flags().GetStringSlice("output") scriptName, _ := cmd.Flags().GetString("script") return CMD_runScript(scriptName, topics, all, count, outputFormats, args) }), }
var SyncCmd = &cobra.Command{ Use: "sync", Short: "Sync project metadata from all configured code repositories.", RunE: func(cmd *cobra.Command, args []string) error { return CMD_syncRepos() }, }
SyncCmd is a Cobra command that synchronizes project metadata from a specified code repository. Currently, it supports syncing from GitHub. The command requires a single argument specifying the repository type (e.g., "github"). It uses the GITHUB_TOKEN environment variable for authentication.
Functions ¶
func AddCmdInit ¶ added in v0.5.2
func CMD_addRepository ¶
CMD_addRepository clones the repo (if not present) and stores it in projects.json.
func CMD_ask ¶
CMD_ask calls the OpenAI API with the question, extracts the TypeScript code, and saves it to ./scripts/<question>.ts.
func CMD_loadCSVs ¶ added in v0.5.0
CMD_loadCSVs loads each CSV in files into the SQLite DB.
func CMD_pullRepos ¶
func CMD_pullRepos(topics []string, githubToken string, githubUser string, githubUpdateToken bool) error
CMD_pullRepos pulls or clones every repo whose topic matches. It keeps going even if some repos fail and returns a joined error list.
func CMD_runScript ¶
func CMD_syncRepos ¶
func CMD_syncRepos() error
func LoadCmdInit ¶ added in v0.5.0
func PullCmdInit ¶ added in v0.5.2
func RunCmdInit ¶
Types ¶
This section is empty.