YouBothAgent▾
You — Business rules and flows you own. Read these yourself.
Both — Know the idea; your agent follows the details.
Agent — Conventions and references your agent follows. Look up as needed.
CLI Reference▾
AkanJS Reference▾
Module CLI
Six commands that create, remove and fill in modules inside an app or library. Use
create-module for a feature built around a stored model, create-service for one that is not.Words Used on This Page
TermDescription
database module
A module built around one stored model, in
lib/<module>/.service module
Behavior not tied to one stored model, such as notifications, in
lib/_<service>/.sys
The app or library that holds the module:
shop in shop:story.scaffold
The starter code a command writes, meant to be edited.
report
What a create command prints at the end: the files it wrote and the commands to run next.
Files a New Module Gets
File
create-module
create-service
Model and logic
.abstract.md
✓
✓
The module's rules and workflows, in prose.
.constant.ts
✓
The fields and the Light class.
.document.ts
✓
Queries and state changes on the stored record.
.dictionary.ts
✓
✓
English and Korean labels.
.service.ts
✓
✓
The business logic.
.signal.ts
✓
✓
The endpoints callers reach.
.store.ts
✓
✓
Client state and actions.
UI
.View.tsx
✓
The detail screen for one record.
.Unit.tsx
✓
One row or card in a list.
.Template.tsx
✓
The create and edit form.
.Zone.tsx · .Util.tsx
✓
A page section, and small domain helpers such as a remove button.
✓WrittenNot written
The other three create commands fill in one UI file of an existing module:
create-view the View, create-unit the Unit, and create-template the Template.Rules All Six Share
- Name the target, or pick it from a list.
create-moduleandcreate-servicetake the app or library as their second argument; the other four take<sys>:<module>. Leave it out and the CLI asks. - Only database modules can be picked. A folder with an underscore, such as
lib/_<service>orlib/__scalar, never appears as asys:module. - Create commands end with a report. It lists the files written and the next steps,
akan sync <sys>andakan lint <sys>. Add-o jsonfor the same report as one JSON object. remove-moduleprints no report. Runakan sync <sys>after it yourself.


Commit before you run these. A create command writes its scaffold over any file at the same path, and
remove-module deletes the folder without asking.Related Pages
create-module
Create a database module in an app or library.
It writes the standard module files into
lib/<module>/, and route files too with --page.Signature
Arguments
module-nameStringrequired
Module name. Spaces are removed and the first letter is lowercased; asked for if left out.
sysString
The app or library to write into, such as
shop. Leave it out to pick one from a list.Options
--pageBooleandefault false-p
Also write CRUD routes for the module. Apps only; a library ignores it.
--formatStringdefault markdownmarkdown | json · -o
markdown is for a person to read; json is the same report as one object, for scripts and agents.Notes
NameDescription
files
Twelve files: abstract, constant, dictionary, document, service, signal, store and five UI files.
--page
Writes list, new, detail and edit routes under
page/(<app>)/(public)/<module>/.guards
The slice reads with
Public; root and cru are Admin from @libs/shared/srvkit.without libs/shared
root and cru are None, so nothing writes until you name a guard.same name
A module that already has the name is overwritten file by file, so commit first.
Examples
create-service
Create a service module: behavior that is not centered on one stored model.
It lands in
lib/_<service>/, with no constant, document or UI files.Signature
Arguments
service-nameStringrequired
Service name. Spaces and leading underscores are removed, and the first letter is lowercased.
sysString
The app or library to write into, such as
shop. Leave it out to pick one from a list.Options
--formatStringdefault markdownmarkdown | json · -o
markdown is for a person to read; json is the same report as one object, for scripts and agents.Notes
NameDescription
files
Five files: abstract, dictionary, service, signal and store.
file names
Only the folder has the underscore:
lib/_noti/noti.service.ts, lib/_noti/noti.abstract.md.UI
A service module holds only Zone and Util files; write them by hand.
Examples
remove-module
Remove a database module from an app or library.
It deletes the whole
lib/<module>/ folder at once, without asking.Signature
Notes
NameDescription
sys:module
Name the module as
<sys>:<module>, such as shop:story. Leave it out to pick the sys, then the module.database modules only
A service module in
lib/_<service> or a scalar in lib/__scalar is not listed.what stays
Routes made with
--page and imports in other modules stay; remove them yourself.afterwards
Run
akan sync <sys> so the generated files drop the module.Examples
create-view
Write the View file of an existing module: the detail screen for one record.
It is always a server component, so it never carries "use client".
Signature
Options
--formatStringdefault markdownmarkdown | json · -o
markdown is for a person to read; json is the same report as one object, for scripts and agents.Notes
NameDescription
sys:module
Name the module as
<sys>:<module>, such as shop:story. Leave it out to pick the sys, then the module.database modules only
A service module in
lib/_<service> or a scalar in lib/__scalar is not listed.writes
lib/<module>/<Module>.View.tsx, exporting General.name field
The scaffold renders only the module's
name field; swap in the fields you need.existing file
A file already at that path is overwritten with the scaffold, so commit first.
Examples
create-unit
Write the Unit file of an existing module: one row or card in a list.
It takes the module's Light data and, like View, is always a server component.
Signature
Options
--formatStringdefault markdownmarkdown | json · -o
markdown is for a person to read; json is the same report as one object, for scripts and agents.Notes
NameDescription
sys:module
Name the module as
<sys>:<module>, such as shop:story. Leave it out to pick the sys, then the module.database modules only
A service module in
lib/_<service> or a scalar in lib/__scalar is not listed.writes
lib/<module>/<Module>.Unit.tsx, exporting Card.name field
The scaffold renders only the module's
name field; swap in the fields you need.existing file
A file already at that path is overwritten with the scaffold, so commit first.
Examples
create-template
Write the Template file of an existing module: its create and edit form.
It is bound to the store's form state, so it is always a client component with "use client" on line 1.
Signature
Options
--formatStringdefault markdownmarkdown | json · -o
markdown is for a person to read; json is the same report as one object, for scripts and agents.Notes
NameDescription
sys:module
Name the module as
<sys>:<module>, such as shop:story. Leave it out to pick the sys, then the module.database modules only
A service module in
lib/_<service> or a scalar in lib/__scalar is not listed.writes
lib/<module>/<Module>.Template.tsx, exporting the General form.name field
The scaffold renders only the module's
name field; swap in the fields you need.existing file
A file already at that path is overwritten with the scaffold, so commit first.
Examples