CLI commands for module scaffolding.
This is the SHELL layer in Functional Core / Imperative Shell architecture. Responsibilities:
CLI commands for module scaffolding. This is the SHELL layer in Functional Core / Imperative Shell architecture. Responsibilities: - Parse command-line arguments using tools.cli - Orchestrate scaffolder service calls - Format output (list files, success/error messages) - Handle errors and exit codes
(dispatch-command verb opts service)Dispatch command to appropriate executor.
Args: verb: :generate, :field, :endpoint, :adapter, :help opts: Parsed command options service: Scaffolder service instance
Returns: Map with :status, :result, or :errors
Dispatch command to appropriate executor. Args: verb: :generate, :field, :endpoint, :adapter, :help opts: Parsed command options service: Scaffolder service instance Returns: Map with :status, :result, or :errors
(execute-adapter service opts)Execute adapter command - generate a new adapter implementation.
Execute adapter command - generate a new adapter implementation.
(execute-endpoint service opts)Execute endpoint command - add an endpoint to an existing module.
Execute endpoint command - add an endpoint to an existing module.
(execute-field service opts)Execute field command - add a field to an existing entity.
Execute field command - add a field to an existing entity.
(execute-generate service opts)Execute generate command.
Execute generate command.
(format-dry-run-text result)Format dry-run result as text.
Format dry-run result as text.
(format-error format-type errors)Format error message based on output format.
Format error message based on output format.
(format-error-text result)Format error result as text.
Format error result as text.
(format-file-list files)Format the touched files as a text list.
:note is printed where present. A bare skip: …/schema.clj says something
did not happen without saying what to do instead, which is barely better
than the false update: it replaced.
Format the touched files as a text list. `:note` is printed where present. A bare `skip: …/schema.clj` says something did not happen without saying what to do instead, which is barely better than the false `update:` it replaced.
(format-success format-type result)Format successful result based on output format.
Format successful result based on output format.
(format-success-text result)Format a successful result as text.
The heading and the next steps come from the result, not from a constant.
Every command shared one block of module-generation wording, so bb scaffold field announced "Successfully generated module" and then told the user to
register a module in Integrant — advice for a different command, printed
after adding a column (BOU-275).
Format a successful result as text. The heading and the next steps come from the result, not from a constant. Every command shared one block of module-generation wording, so `bb scaffold field` announced "Successfully generated module" and then told the user to register a module in Integrant — advice for a different command, printed after adding a column (BOU-275).
(parse-all-fields field-specs)Parse all field specifications.
Returns: [success? fields-or-errors]
Parse all field specifications. Returns: [success? fields-or-errors]
(parse-field-spec field-spec)Parse a field specification string into a field map.
Format: name:type[:required][:unique]
Examples: email:email:required:unique name:string:required age:integer status:enum
Returns: Map with keys: :name, :type, :required, :unique, or error map
Parse a field specification string into a field map. Format: name:type[:required][:unique] Examples: email:email:required:unique name:string:required age:integer status:enum Returns: Map with keys: :name, :type, :required, :unique, or error map
(parse-method-spec method-spec)Parse a method specification string into a method map. Format: name:arg1,arg2,... Returns: {:name "name" :args ["arg1" "arg2"]}
Parse a method specification string into a method map.
Format: name:arg1,arg2,...
Returns: {:name "name" :args ["arg1" "arg2"]}(run-cli! service args)Main CLI entry point for scaffolder module.
Args: service: Scaffolder service instance args: Command-line arguments vector
Returns: Exit status: 0 for success, 1 for error
Side effects: Prints to stdout/stderr based on command and format
Main CLI entry point for scaffolder module. Args: service: Scaffolder service instance args: Command-line arguments vector Returns: Exit status: 0 for success, 1 for error Side effects: Prints to stdout/stderr based on command and format
(validate-adapter-options opts)Validate required options for adapter command.
Validate required options for adapter command.
(validate-endpoint-options opts)Validate required options for endpoint command.
Validate required options for endpoint command.
(validate-field-options opts)Validate required options for field command.
Validate required options for field command.
(validate-generate-options opts)Validate required options for generate command.
Returns: [valid? error-messages]
Validate required options for generate command. Returns: [valid? error-messages]
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |