Intent-driven generation
udiot create (alias c) asks a model what you described, then writes it with
the same generators as udiot generate.
npx --no-install udiot create --help
npx --no-install udiot create "an order service that lists open orders" --dry-run
Setup
Enable AI in udiot.config.json and provide a key:
{ "framework": { "ai": { "enabled": true, "model": "gpt-4o-mini" } } }
export OPENAI_API_KEY=...
# Optional: any OpenAI-compatible endpoint
export OPENAI_BASE_URL=https://llm.internal.example/v1
Requests go through the framework's LLM client, so the openai package (an
optional peer) must be installed. framework.ai.temperature and
framework.ai.contextWindow (used as the response token limit) apply.
What happens
- The description is sent to the model, which returns the type (
component,service,controller,eventorhandler), a name, and props, methods, endpoints or event fields. - The matching generator renders the files. For components, services and
controllers the model then writes each method body; a body it cannot write
stays a
TODOstub. - The generated files are sent back to the model for review, and its findings are reported. Pages, features and modules are not generated.
Options are those of generate: --dry-run, --yes, --force,
--with-tests, --description, --event-name, --event-category,
--event-version, --event-docs and --for-event. Writing asks for
confirmation unless --yes or --dry-run is given.
--dry-run previews the files; the model is still called, so it still costs
tokens and still sends your description to the provider.
Treat the output as scaffolding: model-written code can be wrong. Review imports, authorization, validation and persistence, compile it, and test it. Do not put credentials or private data in descriptions.