From e54227533dd74b494e9c504f155d3c37c9b38514 Mon Sep 17 00:00:00 2001 From: WoutVossen Date: Sun, 29 Sep 2024 20:44:15 +0200 Subject: [PATCH] Improve documentation --- cmd/bundle.go | 2 ++ cmd/init.go | 2 ++ cmd/review.go | 12 +++++------- cmd/root.go | 3 +-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/bundle.go b/cmd/bundle.go index a32ecaf..240203e 100644 --- a/cmd/bundle.go +++ b/cmd/bundle.go @@ -84,6 +84,8 @@ var generateCmd = &cobra.Command{ Long: `Bundle your project into a single file, starting from the directory you are in. By default common configuration and setup files (ex. .vscode, .venv, package.lock) are ignored as well as non-text extensions like .jpeg, .png, .pdf. +For more information see: https://crevcli.com/docs + Example usage: crev bundle crev bundle --ignore-pre=tests,readme --ignore-ext=.txt diff --git a/cmd/init.go b/cmd/init.go index b03973c..9270722 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -11,8 +11,10 @@ import ( // Define a default template configuration var defaultConfig = []byte(`# Configuration for the crev tool +# for more info see: https://crevcli.com/docs # specify your CREV API key (necessary for review command) ! this overwrites the value you specify in the environment variable +# you can get one on: https://crevcli.com/api-key crev_api_key: # ex. csk_8e796a8f6fdb15f0902eee0d4138b9d5975e244e6cc61ef502feaf37af24c7cb # specify the prefixes of files and directories to ignore (by default common configuration files are ignored) ignore-pre: # ex. [tests, readme.md, scripts] diff --git a/cmd/review.go b/cmd/review.go index 41a9b52..202cfb6 100644 --- a/cmd/review.go +++ b/cmd/review.go @@ -12,17 +12,15 @@ import ( // reviewCmd represents the review command var reviewCmd = &cobra.Command{ Use: "review", - Short: "A brief description of your command", - Long: `A longer description that spans multiple lines and likely contains examples -and usage of using your command. For example: + Short: "Let an AI review your crev-project.txt", + Long: `Let an AI review the crev-project.txt you generated with the crev bundle command. -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application.`, +This command requires a CREV_API_KEY to be set as an environment variable or in your .crev-config.yaml. +You can generate an CREV_API_KEY on the crev website. For more information see: https://crevcli.com/docs`, Run: func(cmd *cobra.Command, args []string) { apiKey := viper.GetString("crev_api_key") if apiKey == "" { - log.Fatal(`Api key is required for review. Generate yours on: ... and set it as CREV_API_KEY env var or specify it under 'crev_api_key' key in your .crev-config.yaml. For more information see: ...`) + log.Fatal(`Api key is required for review. Get yours on: https://crevcli.com/api-key and set it as CREV_API_KEY env var or specify it under 'crev_api_key' key in your .crev-config.yaml. For more information see: https://crevcli.com/docs`) } dat, err := os.ReadFile("crev-project.txt") if err != nil { diff --git a/cmd/root.go b/cmd/root.go index 8f0e512..4fb2d9d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,8 +15,7 @@ var rootCmd = &cobra.Command{ Use: "crev", Version: Version, Short: "Initialize", - Long: `Allows you to generate a textual representation of -your code and let it be reviewed by an AI. + Long: `Allows you to bundle your codebase and let it be reviewed by an AI. For more information see: https://crevcli.com/docs `, }