Repository navigation
REPL Directives
English | Français
Since v0.10.0 (DA-030).
Last Updated: 2026-10-10
In the REPL, a line starting with : is a directive handled by the
framework itself; any other line is an application command. The set of
directives is fixed by the version of dynamic-cli. The optional
directives: section of the configuration can rename a directive and
replace its aliases and description, for instance to translate them. It
cannot add a directive, remove one or change its arguments.
Directives exist only in the REPL. In CLI mode, use --help / -h as
before; they also keep working in the REPL.
implementation |
Typed as | Aliases | Action |
|---|---|---|---|
repl_help |
:help [command] |
:h, :?
|
Show the application help, or the help of one command |
repl_load |
:load <path> |
— | Run every line of a script file in the current session |
repl_quit |
:quit |
:q |
Save the session history, then leave the REPL |
repl_exit |
:exit |
— | Leave the REPL without saving the session history |
directives: # Optional
- implementation: string # Required: directive to override (see table above)
name: string # Required: new name, typed after ':'
aliases: [string] # Optional: new aliases (default: [])
description: string # Required: text shown by :help| Field | Type | Required | Description |
|---|---|---|---|
implementation |
string | ✅ Yes | Directive to override: repl_help, repl_load, repl_quit or repl_exit
|
name |
string | ✅ Yes | Name typed after :, written without the :
|
aliases |
array | ❌ No | Other names typed after :; replaces the default aliases |
description |
string | ✅ Yes | Description shown in the help listing |
Entries are matched to directives by implementation:
- an entry replaces the
name, thealiasesand thedescriptionof its directive — all three, so an entry withoutaliasesleaves the directive with no alias at all; - a directive without an entry keeps its defaults;
- the arguments of a directive (
[command],<path>) are part of its action and cannot be configured.
French names for :help and :quit; :load and :exit keep their
defaults:
directives:
- implementation: repl_help
name: aide
aliases: [a, "?"]
description: "Afficher l'aide, ou l'aide d'une commande"
- implementation: repl_quit
name: quitter
aliases: [q]
description: "Enregistrer l'historique et quitter"In the REPL, :aide, :a and :? now show the help, :quitter and
:q leave it. :help and :h are no longer recognised: the error
lists the available directives.
An unknown implementation fails as soon as the file is loaded. The other
rules are checked by the configuration validator, which
CliBuilder::build() always runs:
-
implementationmust be one of the four values above; - each
implementationappears at most once; -
nameand every alias are non-empty, contain no whitespace and do not start with:(the REPL adds it); - names and aliases are unique across all directives after the
merge, defaults included: an override cannot take
qwhile:quitkeeps it as its alias.
Directive names are never compared with command names, since a directive
is always typed with its :. Conversely, command names and aliases may
not start with : (see Command Definition).
-
:quitand:exit::quitwrites the session history to disk, then leaves;:exitleaves without writing it. End of input (Ctrl-D) behaves like:quit. Any other way out — a handler callingstd::process::exit, a crash, the process being killed — leaves the history file as it was at the start of the session. -
Names typed without
::quitorexitalone is looked up as an application command. When the word is a directive name or alias (as configured) and the application has no command of that name, the error suggests the directive (:quit). The Complete Example of the configuration reference declares its ownexitcommand: there,exitruns that command and:exitthe directive. -
:loadscripts: each line runs as if typed, directives included, except:quitand:exit, which are reported and skipped. -
Help listing:
:help(and--helpin the REPL) shows the application help followed by aDIRECTIVESsection, under the effective names:DIRECTIVES: :help [command] Show the application help, or the help of a command [aliases: :h, :?] :load <path> Run every line of a script file :quit Save the session history and leave [aliases: :q] :exit Leave without saving the session history -
Completion: after a leading
:, Tab completes directive names and aliases, under their configured names.