1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// SPDX-License-Identifier: Apache-2.0
// Copyright (C) 2025 Michael Dippery <michael@monkey-robot.com>
//! usaidwat is a command-line tool for quickly listing Redditor's comments
//! and posts in the terminal. It finds the last 100 comments or posts a user
//! has made and presents them as pageable text. It can also tally a user's
//! comments or posts, showing a breakdown of the user's last 100 comments or
//! posts by subreddit.
//!
//! # Examples
//!
//! (In all examples, replace `reddit_user` with the actual username of a
//! Redditor.)
//!
//! Display a user's last 100 comments:
//!
//! ```bash
//! usaidwat log reddit_user
//! ```
//!
//! Summarize a user's last 100 comments and provide a tone and sentiment analysis
//! using AI:
//!
//! ```bash
//! usaidwat summary reddit_user
//! ```
//!
//! Show a count of the user's last 100 comments by subreddit:
//!
//! ```bash
//! usaidwat tally reddit_user
//! ```
//!
//! Display a user's last 100 submissions:
//!
//! ```bash
//! usaidwat posts log reddit_user
//! ```
//!
//! Show a count of a user's last 100 submissions by subreddit:
//!
//! ```bash
//! usaidwat posts tally reddit_user
//! ```
//!
//! Show information about a Redditor, such as the age of their account and
//! total karma breakdown:
//!
//! ```bash
//! usaidwat info reddit_user
//! ```
//!
//! Show a breakdown of which hours and days of the week a Redditor has
//! commented:
//!
//! ```bash
//! usaidwat timeline reddit_user
//! ```
//!
//! Get usage and help for the tool:
//!
//! ```bash
//! usaidwat --help
//! ```
//!
//! # OpenAI API Setup
//!
//! To use the summarization feature provided by `usaidwat summary` and the
//! [`Summarizer`](summary::Summarizer), you must set up access to OpenAI.
//! To enable access:
//!
//! 1. Set up an [OpenAI API account].
//! 2. Generate an [API key].
//! 3. Copy and paste the generated key.
//! 4. Store the generated key in your shell's `$OPENAI_API_KEY` environment
//! variable. Follow your shell's procedure for configuring environment
//! variables, but generally this involves running
//!
//! ```bash
//! $ export OPENAI_API_KEY='copied api key'
//! ```
//!
//! In your shell session or in your shell's configuration ("rc") file
//! (e.g., `~/.bashrc` or `~/.zshrc`).
//!
//! **You are solely responsible for the cost of your use of the OpenAI API!**
//! See the [openai module documentation] for more information on the cost of
//! using the OpenAI API.
//!
//! By default, `usaidwat summary` will use the [cheapest model]; see
//! `usaidwat summary -h` for other options.
//!
//! Currently only OpenAI's API is supported by usaidwat, but support for additional
//! providers may be added in the future.
//!
//! # License
//!
//! usaidwat is licensed under the terms of the [Apache License 2.0]. Please
//! see the LICENSE file accompanying this source code or visit the previous
//! link for more information on licensing.
//!
//! [Apache License 2.0]: https://www.apache.org/licenses/LICENSE-2.0
//! [API key]: https://platform.openai.com/settings/organization/api-keys
//! [OpenAI API account]: https://platform.openai.com/docs/overview
//! [cheapest model]: https://docs.rs/cogito/latest/cogito/trait.AIModel.html#tymethod.cheapest
//! [openai module documentation]: https://docs.rs/cogito-openai