CLI commands for user management.
This is the SHELL layer in Functional Core / Imperative Shell architecture. Responsibilities:
All business logic lives in wagoe.user.core.* and wagoe.user.shell.service. All observability is handled automatically by interceptors.
CLI commands for user management. This is the SHELL layer in Functional Core / Imperative Shell architecture. Responsibilities: - Parse command-line arguments using tools.cli - Orchestrate service calls (no business logic here) - Format output (table or JSON) - Handle errors and exit codes All business logic lives in wagoe.user.core.* and wagoe.user.shell.service. All observability is handled automatically by interceptors.
(create-cli-interceptor-context operation-type user-service args options)Creates interceptor context for CLI operations with real observability services.
Creates interceptor context for CLI operations with real observability services.
(dispatch-command verb opts service)Run the user command verb with opts. Returns a map with :status and
:entity-type and :data, or :message.
Run the user command `verb` with `opts`. Returns a map with :status and :entity-type and :data, or :message.
(execute-user-create service _error-reporter opts)Execute user create command using interceptor pipeline.
This version demonstrates the interceptor-based approach that eliminates manual observability boilerplate while providing comprehensive tracking.
Execute user create command using interceptor pipeline. This version demonstrates the interceptor-based approach that eliminates manual observability boilerplate while providing comprehensive tracking.
(execute-user-delete service _error-reporter opts)Execute user delete command using interceptor pipeline.
Execute user delete command using interceptor pipeline.
(execute-user-get service _error-reporter opts)Execute user get command using interceptor pipeline.
Execute user get command using interceptor pipeline.
(execute-user-list service _error-reporter opts)Execute user list command using interceptor pipeline.
Execute user list command using interceptor pipeline.
(execute-user-update service _error-reporter opts)Execute user update command using interceptor pipeline.
Execute user update command using interceptor pipeline.
(format-error format-type error-data)Format error message based on output format. Takes a flat error map or the
pipeline's error body, {:error {:type :message :details}}.
Format error message based on output format. Takes a flat error map or the
pipeline's error body, `{:error {:type :message :details}}`.(format-instant instant)Format an Instant as a human-readable string.
Format an Instant as a human-readable string.
(format-instant-json instant)Format Instant for JSON output.
Format Instant for JSON output.
(format-json data)Format data as pretty JSON.
Format data as pretty JSON.
(format-success format-type entity-type data)Format successful result based on output format.
Args: format-type: :table or :json entity-type: :user or :user-list data: Entity or collection to format
Format successful result based on output format. Args: format-type: :table or :json entity-type: :user or :user-list data: Entity or collection to format
(format-table-row row widths)Format a single row with column widths.
Format a single row with column widths.
(format-table-separator widths)Create a table separator line.
Create a table separator line.
(format-user-table users)Format users as a table.
Format users as a table.
(read-hidden-password label)(read-hidden-password console label)Read a password without echoing input. Piped input — bb create-admin — is read without a prompt: nobody is there to see it. Both are trimmed, and EOF reads as blank.
Read a password without echoing input. Piped input — bb create-admin — is read without a prompt: nobody is there to see it. Both are trimmed, and EOF reads as blank.
(render-table headers rows)Render data as a formatted table.
Args: headers: Vector of column header strings rows: Vector of vectors containing row data
Returns: Formatted table string
Render data as a formatted table. Args: headers: Vector of column header strings rows: Vector of vectors containing row data Returns: Formatted table string
(run-cli! service args)Main CLI entry point. Parses arguments, executes commands, and returns status.
This is module-scoped (user) CLI: we expect <command> [options] where
<command> is one of: create, list, find, update, delete.
Args: service: User 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. Parses arguments, executes commands, and returns status. This is module-scoped (user) CLI: we expect `<command> [options]` where `<command>` is one of: create, list, find, update, delete. Args: service: User 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
(truncate-string s max-length)Truncate string to max-length with ellipsis.
Truncate string to max-length with ellipsis.
(user->json user)Transform user entity for JSON output.
Transform user entity for JSON output.
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 |