Ai
Axolotl CLI enables to use prepared AI prompt to generate resolvers code and (soon) generate test code for those resolvers
Generate graphql schema
Provide OPEN_AI_API_KEY env variable and run
npx OPENAI_AI_API_KEY=xxx axolotl gai "schema for booking.com like system"
This command will generate the graphql schema
Config params
prompt_info - you can add 'baked' additional prompt information into your axolotl config file
{
"graphql_prompt_info": "use pipes",
"agent_model": "gpt-4.1-nano"
}
Prompt info can be also a txt file for bigger prompts
{
"graphql_prompt_info": "graphql.txt",
"agent_model": "gpt-4.1-nano"
}
Generate backend resolver
Given schema.graphql
type User{
username: String!
posts: [Post!]
}
type Post{
title: String!
content: String!
user: User!
}
Provide OPEN_AI_API_KEY env variable and run
npx OPENAI_AI_API_KEY=xxx axolotl ai path/to/schema.graphql User posts "resolver to list all the posts user has created use mongodb"
This command will generate the axolotl compatible typescript backend code for the resolver and copy it to clipboard
Config params
prompt_info - you can add 'baked' additional prompt information into your axolotl config file
{
"prompt_info": "use postgres with drizzle library to manage database",
"agent_model": "gpt-4.1-nano"
}
Generate frontend react component
This agent generates react components that communicate with provided backend.
Given schema.graphql
type User{
username: String!
posts: [Post!]
}
type Post{
title: String!
content: String!
user: User!
}
type Query{
posts: [Post!]
}
Provide OPEN_AI_API_KEY env variable and run
npx OPENAI_AI_API_KEY=xxx axolotl fai path/to/schema.graphql User posts "component showing list of posts with title and author username"
This command will generate the component
Config params
prompt_info - you can add 'baked' additional prompt information into your axolotl config file
{
"frontend_prompt_info": "use shadcn components: Input, Button, Select",
"agent_model": "gpt-4.1-nano"
}
Generate code
You can also generate typescript code - universal one for webhooks utility functions etc
npx axolotl cai schema.graphql "stripe webhook to handle payments"