My agentic slop goes here. Not intended for anyone else!
1(** River.Cmd - Cmdliner terms for River CLI
2
3 This module provides cmdliner terms that are thin wrappers around
4 the River library functions. All business logic resides in the
5 main River module. *)
6
7(** {1 Cmdliner Terms}
8
9 These terms can be used to build command-line interfaces using
10 Cmdliner and Eiocmd. They handle argument parsing and call into
11 the River library functions. *)
12
13open Cmdliner
14
15(** {2 User Management Commands} *)
16
17val user_list :
18 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
19(** [user_list] command term for listing all users from Sortal.
20
21 Reads from Sortal contact database.
22 Calls: [River.State.list_users] *)
23
24val user_show :
25 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
26(** [user_show] command term for showing user details.
27
28 Reads: username from command-line arguments.
29 Calls: [River.State.get_user] *)
30
31val user_cmd : int Cmd.t
32(** [user_cmd] is the user viewing command group (read-only, users managed in Sortal). *)
33
34(** {2 Feed Sync Commands} *)
35
36val sync :
37 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
38(** [sync] command term for syncing feeds.
39
40 Reads: optional username from command-line arguments.
41 Calls: [River.State.sync_user] or [River.State.sync_all] *)
42
43(** {2 Post Listing Commands} *)
44
45val list :
46 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
47(** [list] command term for listing posts with enhanced formatting.
48
49 Features:
50 - Pretty-printed output with colors using Fmt
51 - Clear ID display (never truncated) for each post
52 - Compact view (default): shows title, ID, author, and date
53 - Metadata view (--metadata/-m): shows all post metadata including summary,
54 content preview (truncated), links, and tags
55
56 Reads: optional username, optional limit, --metadata flag from command-line arguments.
57 Calls: [River.State.get_user_posts] or [River.State.get_all_posts] *)
58
59val info :
60 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
61(** [info] command term for showing detailed post information.
62
63 Reads: post ID, --full flag from command-line arguments.
64 Uses Logs for informational output (controlled by -v/--verbose from Eiocmd).
65 Calls: [River.State.get_all_posts] *)
66
67(** {2 Feed Export Commands} *)
68
69val merge :
70 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
71(** [merge] command term for exporting merged feed.
72
73 Reads: format (atom|jsonfeed), title, limit from command-line arguments.
74 Calls: [River.State.export_merged_feed] *)
75
76(** {2 Category Management Commands} *)
77
78val category_list :
79 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
80(** [category_list] command term for listing all categories.
81
82 Calls: [River.State.list_categories] *)
83
84val category_add :
85 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
86(** [category_add] command term for adding a category.
87
88 Reads: id, name, optional description from command-line arguments.
89 Calls: [River.State.add_category] *)
90
91val category_remove :
92 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
93(** [category_remove] command term for removing a category.
94
95 Reads: id from command-line arguments.
96 Calls: [River.State.remove_category] *)
97
98val category_show :
99 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
100(** [category_show] command term for showing category details.
101
102 Reads: id from command-line arguments.
103 Calls: [River.State.get_category], [River.State.get_posts_by_category] *)
104
105val category_cmd : int Cmd.t
106(** [category_cmd] is the category management command group. *)
107
108(** {2 Post Tagging Commands} *)
109
110val tag_add :
111 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
112(** [tag_add] command term for tagging a post with a category.
113
114 Reads: post_id, category_id from command-line arguments.
115 Calls: [River.State.add_post_category] *)
116
117val tag_remove :
118 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
119(** [tag_remove] command term for removing a category from a post.
120
121 Reads: post_id, category_id from command-line arguments.
122 Calls: [River.State.remove_post_category] *)
123
124val tag_list :
125 (Eio_unix.Stdenv.base -> Xdge.t -> Keyeio.Profile.t -> int) Term.t
126(** [tag_list] command term for listing categories assigned to a post.
127
128 Reads: post_id from command-line arguments.
129 Calls: [River.State.get_post_categories] *)
130
131val tag_cmd : int Cmd.t
132(** [tag_cmd] is the post tagging command group. *)
133
134(** {2 Main Command} *)
135
136val main_cmd : int Cmd.t
137(** [main_cmd] is the main command group containing all River CLI commands. *)