Skip to content

abapify/codygen

Repository files navigation

Codygen ABAP use case

What is Codygen?

Codygen - is a Cody CLI wrapper delivering following features:

  • construct the prompt from other files
  • provide the context files
  • call chat command
  • parse chat response and fetch file content from the response and store it to the drive

Prerequisites

  • Install Cody CLI, or preferably open in a devcontainer ( it's just enough to open in a Codespace )
  • Login to Cody CLI with your sourcegraph account

Use cases

Petstore openAPI spec generation ( only descriptor )

Here is how we generate this spec

import { config, from } from 'codygen';
import { glob } from 'node:fs/promises';

export default config({
    prompt: from('prompts').read(['petstore.md', 'abap.md']),
    context: Array.fromAsync(
        glob([
            'specs/openapi/openapi_3_0.yaml',
            'specs/petstore/petstore3.json',
            'src/openapi/zif_openapi_3_0.intf.abap',
            'samples/zcl_petstore_v3.clas.abap'
        ])
    ),
    output: 'src/petstore',
});
  • Run a command like npx codygen --config codygen-petstore.config.ts

Releases

No releases published

Packages

No packages published