These commands are always available in the Enkan REPL.
Start the Enkan system. All components are started in dependency order.
Stop the Enkan system. All components are stopped in reverse dependency order.
Stop and restart the Enkan system. This triggers class reloading
when META-INF/reload.xml is present in the classpath.
Shut down the Enkan system and exit the REPL process.
Show the list of available commands.
Show the middleware stack for the specified application component.
These commands run inside the REPL client (enkan-repl-client) itself and do
not require a connection to a running Enkan server.
Scaffold a new Enkan project using an AI assistant. Interactively collects the
project description, name, group ID, and output directory; shows a plan for
review (which can be revised or cancelled); writes a compilable project
skeleton; runs mvn validate then mvn compile -Pdev with an automatic fix
loop; and optionally launches the generated app and auto-connects the REPL to
it.
Unless your description explicitly asks for something else, /init generates a
project wired with:
DSLContext → Flyway migrationsJooqRecordDecodersTo opt into a different persistence stack, mention it in your description:
"A REST API using JPA/Hibernate" — allows jakarta.persistence.* imports"A guestbook app with Doma2" — allows org.seasar.doma.* importsThe generator still installs the default POM in those cases; add the
corresponding enkan-component-jpa / enkan-component-doma2 dependency
manually after generation.
The generator writes the following files deterministically from templates, so
the AI is only responsible for application-specific code:
| Fixed (template-generated) | Generated by the AI |
|---|---|
pom.xml | RoutesDef.java (route table) |
DevMain.java | *Controller.java |
*SystemFactory.java | Domain records + Raoh decoders |
*ApplicationFactory.java | V1__*.sql Flyway migrations |
jaxrs/JsonBodyReader.java, JsonBodyWriter.java | Unit tests |
This split guarantees that the parts of the project that need to be correct for
Enkan to even start up are never subject to LLM hallucinations.
Requires the following environment variables (or system properties):
| Env var | System property | Default |
|---|---|---|
ENKAN_AI_API_URL | enkan.ai.apiUrl | https://api.anthropic.com/v1 |
ENKAN_AI_API_KEY | enkan.ai.apiKey | (required) |
ENKAN_AI_MODEL | enkan.ai.model | claude-sonnet-4-5 |
ENKAN_VERSION | enkan.version | (read from jar pom.properties) |
ENKAN_VERSION / enkan.version overrides the version stamped into the
generated pom.xml. Normally you do not need to set it — it is auto-detected
from the packaged enkan-repl-client.jar — but running /init from a raw class
directory (e.g. during development of the init command itself) requires the
override.
Works with any OpenAI-compatible chat completion endpoint (OpenAI, Anthropic’s
OpenAI-compatible endpoint, LM Studio, Ollama, vLLM, etc.). See
Getting Started for a full walkthrough.
List all client-local commands, or show the detail for a single command
(e.g. /help init).
Connect the client to a running Enkan REPL server on the given port (host
defaults to localhost).
Exit the REPL client.
Registered by DevelCommandRegister. Requires the enkan-devel dependency.
Watch compiled class files for changes and automatically reset the application
when a modification is detected. Uses WatchService to monitor all
directories marked with META-INF/reload.xml.
See Development Tools for details on the class reloading mechanism.
Compile the project using the configured build tool.
By default, uses Maven (MavenCompiler). Can be configured to use Gradle
by passing a GradleCompiler to DevelCommandRegister.
Registered by KotowariCommandRegister. Available when using the Kotowari web framework.
Show the routing table for the specified application component.
Registered by MetricsCommandRegister. Requires the enkan-component-metrics dependency.
Display collected application metrics from the Metrics component.