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
//! # Herald 📢
//!
//! Automated viral tweet generation and scheduling for developer releases.
//!
//! Herald helps developers and teams automatically announce their work on Twitter/X
//! by detecting events (releases, commits, PRs) and generating engaging tweets
//! using LLMs.
//!
//! ## Features
//!
//! - **Event Detection**: Automatically detect releases from GitHub, crates.io, npm
//! - **LLM-Powered Generation**: Generate viral tweets using Claude, GPT, or local models
//! - **Twitter Integration**: Post directly to Twitter/X using the v2 API
//! - **Scheduling**: Queue tweets for optimal posting times
//! - **Templates**: Pre-built templates for common announcement types
//!
//! ## Quick Start
//!
//! ```bash
//! # Install
//! cargo install herald
//!
//! # Configure (creates ~/.config/herald/config.toml)
//! herald init
//!
//! # Generate a tweet for a release
//! herald generate --project myproject --event release
//!
//! # Post immediately
//! herald post "just shipped something cool 🚀"
//!
//! # Schedule for later
//! herald schedule "coming soon..." --time "2024-01-15 09:00"
//! ```
//!
//! ## Configuration
//!
//! Herald uses a TOML configuration file:
//!
//! ```toml
//! [twitter]
//! api_key = "your-api-key"
//! api_secret = "your-api-secret"
//! access_token = "your-access-token"
//! access_token_secret = "your-access-token-secret"
//!
//! [llm]
//! provider = "anthropic" # or "openai", "ollama"
//! api_key = "your-api-key"
//! model = "claude-sonnet-4-20250514"
//!
//! [defaults]
//! emojis = true
//! hashtags = false
//! tone = "casual" # casual, professional, hype, technical
//! max_length = 280
//!
//! [[projects]]
//! name = "myproject"
//! github = "user/myproject"
//! crates_io = "myproject"
//! events = ["release", "major_feature"]
//! ```
//!
//! ## Environment Variables
//!
//! Credentials can also be set via environment variables:
//!
//! - `TWITTER_API_KEY`
//! - `TWITTER_API_SECRET`
//! - `TWITTER_ACCESS_TOKEN`
//! - `TWITTER_ACCESS_TOKEN_SECRET`
//! - `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`
//! - `GITHUB_TOKEN` (for private repos)
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
/// Herald version
pub const VERSION: &str = env!;
/// Default user agent for API requests
pub const USER_AGENT: &str = concat!;