Documentation
¶
Index ¶
- Variables
- func CMD_addRepository(repoURL 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) error
- func CMD_runScript(scriptName string, topics []string, count bool, outputFormats []string, ...) error
- func CMD_syncRepos() error
- func LoadCmdInit(cmd *cobra.Command)
- func RunCmdInit(cmd *cobra.Command)
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 CMD_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 CMD_ask(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 { debug, _ := cmd.Flags().GetBool("debug") return CMD_info(debug) }, }
View Source
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) }), }
View Source
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) }), }
View Source
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") return CMD_pullRepos(topics) }), }
View Source
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") outputFormats, _ := cmd.Flags().GetStringSlice("output") scriptName, _ := cmd.Flags().GetString("script") return CMD_runScript(scriptName, topics, count, outputFormats, args) }), }
View Source
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 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 ¶
CMD_pullRepos pulls the latest changes for all repositories listed in projects.json.
func CMD_runScript ¶
func CMD_syncRepos ¶
func CMD_syncRepos() error
func LoadCmdInit ¶ added in v0.5.0
func RunCmdInit ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.