My agentic slop goes here. Not intended for anyone else!
1(** Batteries-included CLI runner for Eio applications
2
3 Eiocmd provides a convenient wrapper for building command-line applications
4 with Eio. It automatically handles common setup tasks and provides a clean
5 interface for building CLIs with minimal boilerplate. *)
6
7(** {1 Running Applications} *)
8
9(** [run ~info ~app_name ~service main_term] creates a batteries-included CLI command.
10
11 This is a comprehensive runner that sets up everything a typical CLI application needs:
12 - Random number generator initialization (Mirage_crypto_rng)
13 - Logging (via Logs_cli with standard flags)
14 - Cmdliner argument parsing
15 - XDG directory structure (all directories created)
16 - API key management via keyeio (optional)
17
18 @param use_keyeio
19 Controls whether to initialize keyeio for API key management.
20 - [true] (default): Load keyeio service and profile, add --profile and --key-file flags
21 - [false]: Skip keyeio, provide empty profile, no keyeio-related flags
22
23 Use [~use_keyeio:false] for commands that don't need API keys to avoid
24 creating unnecessary config directories and service files.
25
26 @param info Command info for Cmdliner
27 @param app_name Application name for XDG directories
28 @param service Service name for keyeio profile lookup (ignored if use_keyeio=false)
29 @param main_term The main command term that receives (env, xdg, profile) parameters
30 ]} *)
31val run :
32 ?use_keyeio:bool ->
33 info:Cmdliner.Cmd.info ->
34 app_name:string ->
35 service:string ->
36 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Cmdliner.Term.t ->
37 Cmdliner.Cmd.Exit.code Cmdliner.Cmd.t