Cloving Generate Context Command Documentation

Learn how to use the cloving generate context command to generate a context prompt for your Cloving project.

Usage

cloving generate context [options]

There is also shortcut to save you a few chars

cloving g context [options]

Description

The cloving generate context command helps you generate a detailed context prompt for your Cloving project. This prompt includes the description of the app, special file contents, context file contents, and the directory structure.

Options

This command uses the following options:

  • -f, --files: Specify filenames of files with context.

Interactive Prompts

The cloving generate context command uses the following interactive prompts:

  • Include context files: Prompt to include additional files or directories as context.
  • Copy to clipboard: Prompt to copy the generated context prompt to the clipboard.

Example Process

Example Context Generation Session

Here is an example of what a context generation session might look like:


$ cloving generate context
Enter the relative path of a file or directory you would like to include as context (or press enter to continue): src/utils/config_utils.ts
Enter the relative path of a file or directory you would like to include as context (or press enter to continue):

Generated Context Prompt:
```markdown
### Description of App

{
"languages": [
  {
    "name": "TypeScript",
    "version": "5.5.3",
    "primary": true,
    "directory": "src",
    "extension": ".ts"
  }
],
"frameworks": [
  {
    "name": "Node.js",
    "type": "Runtime environment",
    "primary": true,
    "directory": "src",
    "extension": ".js"
  }
],
"testingFrameworks": [
  {
    "name": "Jest",
    "type": "Testing framework",
    "version": "29.7.0",
    "directory": "tests"
  }
],
"buildTools": [
  {
    "name": "TypeScript Compiler (tsc)",
    "type": "Transpiler"
  },
  {
    "name": "Vite",
    "type": "Build tool",
    "version": "5.3.3"
  }
],
"packageManager": "Yarn",
"linters": [
  {
    "name": "ESLint",
    "version": "9.6.0"
  }
],
"projectType": "Command-line tool"
}

### Contents of src/utils/config_utils.ts

"// Sample content of config_utils.ts file"

### Directory structure

src/utils/config_utils.ts
src/utils/git_utils.ts
src/utils/string_utils.ts
src/utils/types.ts
src/utils/command_utils.ts
src/utils/model_utils.ts
src/cloving_gpt/adapters/ollama.ts
src/cloving_gpt/adapters/openai.ts
src/cloving_gpt/adapters/gpt4all.ts
src/cloving_gpt/adapters/gemini.ts
src/cloving_gpt/adapters/claude.ts
src/cloving_gpt/adapters/index.ts
src/cloving_gpt/adapters/mistral.ts
src/cloving_gpt/index.ts
src/commands/init.ts
src/commands/project/init.ts
src/commands/project/complete.ts
src/commands/project/plan.ts
src/commands/project/build.ts
src/commands/generate/unit_tests.ts
src/commands/generate/context.ts
src/commands/generate/review.ts
src/commands/generate/code.ts
src/commands/generate/commit.ts
src/commands/generate/shell.ts
src/commands/models.ts
src/commands/config.ts
src/index.ts
```

Do you want to copy the context prompt to your clipboard? (Y/n) Y
Context prompt copied to clipboard