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▾
Scalar CLI
Two commands that create and remove a scalar inside an app or library. A scalar is a reusable value object saved inside other models, not a model with its own table; for that, use
create-module.Words Used on This Page
TermDescription
A named group of fields saved inside other models, like
Price. It has no table of its own.sys
The app or library that holds the scalar:
shop in akan create-scalar price shop.scaffold
The starter code a command writes, meant to be edited.
report
What
create-scalar prints at the end: the files it wrote and the commands to run next.Files Each Command Touches
File
create-
scalar
scalar
remove-
scalar
scalar
Scaffolded into
lib/__scalar/<scalar>/<scalar>.abstract.md
✓
✓
What the value means and its reuse rules, as headings to fill in.
<scalar>.constant.ts
✓
✓
The class with the fields, starting with one placeholder
field: field(String).<scalar>.dictionary.ts
✓
✓
English and Korean labels, written with
scalarDictionary.<scalar>.document.ts
✓
✓
The server-side class, one line:
by(cnst.<Scalar>).Written by hand, in the same folder
<Scalar>.Template.tsx
✓
The editor for the value inside a parent form.
<Scalar>.Unit.tsx
✓
The display of the value inside a parent card or detail page.
Outside the folder
code that uses it
Fields such as
field(Price) and imports in other modules. Neither command touches them.✓Written or deletedNot touched
Rules to Know
- Name the target, or pick it from a list. The second argument is the app or library. Leave it out, or give a name that does not exist, and the CLI shows a list. A missing scalar name is asked for.
create-scalarnever overwrites. A file already at the path keeps its content, so running it again only restores missing files.create-scalarends 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-scalartakes the folder name exactly as typed. Nothing is lowercased, so writecoordinate, notCoordinate. It prints no report.


Check usages before you remove a scalar.
remove-scalar deletes the folder without asking and leaves every field and import that used it broken until you fix them.Related Pages
create-scalar
Create a scalar: a reusable value object or data shape that needs no table of its own.
It writes four files into
lib/__scalar/<scalar>/ and prints what it wrote.Signature
Arguments
scalar-nameStringrequired
Scalar name. Spaces are removed and the first letter is lowercased; asked for if left out.
sysString
The app or library, 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
Four files: abstract, constant, dictionary and document. Template and Unit are written by hand.
names
AccessToken becomes the folder accessToken and the class AccessToken.placeholder
Replace the placeholder
field in the constant and its label in the dictionary.existing file
A file already at the path keeps its content; only the formatter may tidy it.
Examples
remove-scalar
Remove a scalar from an app or library.
It deletes the whole
lib/__scalar/<scalar>/ folder at once, without asking.Signature
Arguments
scalar-nameStringrequired
The folder name under
lib/__scalar/, used exactly as typed; asked for if left out.sysString
The app or library, such as
shop. Leave it out to pick one from a list.Notes
NameDescription
check first
Modules, dictionaries, templates and service payload types often import a scalar.
exact name
Type the folder name, such as
accessToken. A name with no folder deletes nothing, silently.what stays
Fields and imports in other modules that use the scalar stay; remove them yourself.
afterwards
Run
akan sync <sys> so the generated files drop the scalar.Examples