Liking cljdoc? Tell your friends :D

wagoe.user.shell.cli

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.

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.
raw docstring

create-cli-interceptor-contextclj

(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.
sourceraw docstring

default-datetime-formatterclj

source

dispatch-commandclj

(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.
sourceraw docstring

execute-user-createclj

(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.
sourceraw docstring

execute-user-deleteclj

(execute-user-delete service _error-reporter opts)

Execute user delete command using interceptor pipeline.

Execute user delete command using interceptor pipeline.
sourceraw docstring

execute-user-getclj

(execute-user-get service _error-reporter opts)

Execute user get command using interceptor pipeline.

Execute user get command using interceptor pipeline.
sourceraw docstring

execute-user-listclj

(execute-user-list service _error-reporter opts)

Execute user list command using interceptor pipeline.

Execute user list command using interceptor pipeline.
sourceraw docstring

execute-user-updateclj

(execute-user-update service _error-reporter opts)

Execute user update command using interceptor pipeline.

Execute user update command using interceptor pipeline.
sourceraw docstring

format-errorclj

(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}}`.
sourceraw docstring

format-instantclj

(format-instant instant)

Format an Instant as a human-readable string.

Format an Instant as a human-readable string.
sourceraw docstring

format-instant-jsonclj

(format-instant-json instant)

Format Instant for JSON output.

Format Instant for JSON output.
sourceraw docstring

format-jsonclj

(format-json data)

Format data as pretty JSON.

Format data as pretty JSON.
sourceraw docstring

format-successclj

(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
sourceraw docstring

format-table-rowclj

(format-table-row row widths)

Format a single row with column widths.

Format a single row with column widths.
sourceraw docstring

format-table-separatorclj

(format-table-separator widths)

Create a table separator line.

Create a table separator line.
sourceraw docstring

format-user-tableclj

(format-user-table users)

Format users as a table.

Format users as a table.
sourceraw docstring

global-optionsclj

source

read-hidden-passwordclj

(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.
sourceraw docstring

render-tableclj

(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
sourceraw docstring

run-cli!clj

(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
sourceraw docstring

truncate-stringclj

(truncate-string s max-length)

Truncate string to max-length with ellipsis.

Truncate string to max-length with ellipsis.
sourceraw docstring

user->jsonclj

(user->json user)

Transform user entity for JSON output.

Transform user entity for JSON output.
sourceraw docstring

user-create-optionsclj

source

user-delete-optionsclj

source

user-find-optionsclj

source

user-helpclj

source

user-list-optionsclj

source

user-update-optionsclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close