nanoctl generate ai-node
command leverages OpenAI to automatically generate Blok Nodes based on natural language prompts. This powerful tool helps developers quickly scaffold production-ready bloks that follow the framework’s structural conventions.
By combining AI code generation with automatic registration in your project, this command significantly accelerates the Node development process while ensuring adherence to Blok standards.
Option | Type | Description | Default |
---|---|---|---|
--name | string | Name for the new Node (required) | None |
--prompt | string | Description of the Node’s functionality (required) | None |
--api-key | string | OpenAI API key (falls back to env variable) | OPENAI_API_KEY |
--type | string | Type of template: class or module | class |
--help | boolean | Show help | false |
generate ai-node
command:
./nodes/
with your specified name.Nodes.ts
registry file.--api-key
flag or OPENAI_API_KEY
environment variable)OPENAI_API_KEY
to your environment variables rather than passing it directly in the command line. This prevents accidental exposure and makes it easier to manage configurations across environments.
generate ai-node
:
The generate ai-node
command is a convenience tool—not a compiler or validator. It helps bootstrap a new node using AI assistance, but the resulting code is a code snippet, not a production-ready solution. Treat it as a draft you will refine, test, and adapt as needed.