@@ -16,6 +16,7 @@ See through all Border Gateway Protocol (BGP) data with a monocle.
1616 - [ Using ` homebrew ` on macOS] ( #using-homebrew-on-macos )
1717 - [ Using ` cargo-binstall ` ] ( #using-cargo-binstall )
1818- [ Library Usage] ( #library-usage )
19+ - [ Documentation] ( #documentation )
1920- [ Usage] ( #usage )
2021 - [ ` monocle parse ` ] ( #monocle-parse )
2122 - [ Output Format] ( #output-format )
@@ -98,52 +99,63 @@ Monocle can also be used as a library in your Rust projects. Add it to your `Car
9899
99100``` toml
100101[dependencies ]
101- # Full library with CLI argument support (default)
102+ # Default: full CLI binary with all features
102103monocle = " 1.0"
103104
104- # Minimal database access only
105- monocle = { version = " 1.0" , default-features = false , features = [" database " ] }
105+ # Library only - all lenses and database operations
106+ monocle = { version = " 1.0" , default-features = false , features = [" lib " ] }
106107
107- # BGP operations without CLI overhead
108- monocle = { version = " 1.0" , default-features = false , features = [" lens-bgpkit" ] }
109-
110- # Full functionality without CLI
111- monocle = { version = " 1.0" , default-features = false , features = [" lens-full" ] }
108+ # Library + WebSocket server
109+ monocle = { version = " 1.0" , default-features = false , features = [" server" ] }
112110```
113111
114112### Feature Tiers
115113
116- Monocle's features are organized in tiers for minimal dependency footprint:
114+ Monocle uses a simplified feature system with three options:
115+
116+ | Feature | Description | Implies |
117+ | ---------| -------------| ---------|
118+ | ` lib ` | Complete library (database + all lenses + display) | - |
119+ | ` server ` | WebSocket server for programmatic API access | ` lib ` |
120+ | ` cli ` (default) | Full CLI binary with all functionality | ` lib ` , ` server ` |
121+
122+ ### Documentation
123+
124+ The following documentation files are available in the repository:
117125
118- | Feature | Description | Key Dependencies |
119- | ---------| -------------| ------------------|
120- | ` database ` | SQLite operations only | rusqlite, oneio, ipnet, chrono |
121- | ` lens-core ` | Standalone lenses (TimeLens) | chrono-humanize, dateparser |
122- | ` lens-bgpkit ` | BGP-related lenses | bgpkit-* , rayon, tabled |
123- | ` lens-full ` | All lenses including InspectLens | All above |
124- | ` cli ` (default) | Full CLI binary with server | axum, tokio, tower-http |
126+ | File | Description |
127+ | ------| -------------|
128+ | [ ` README.md ` ] ( README.md ) (this file) | User-facing CLI and library overview |
129+ | [ ` ARCHITECTURE.md ` ] ( ARCHITECTURE.md ) | Overall project structure and design principles |
130+ | [ ` DEVELOPMENT.md ` ] ( DEVELOPMENT.md ) | Contributor guide for adding lenses and fixing bugs |
131+ | [ ` AGENTS.md ` ] ( AGENTS.md ) | AI coding agent guidelines and code style |
132+ | [ ` CHANGELOG.md ` ] ( CHANGELOG.md ) | Version history and breaking changes |
133+ | [ ` src/server/README.md ` ] ( src/server/README.md ) | WebSocket API specification |
134+ | [ ` src/lens/README.md ` ] ( src/lens/README.md ) | Lens module patterns and conventions |
135+ | [ ` src/database/README.md ` ] ( src/database/README.md ) | Database module overview |
136+ | [ ` examples/README.md ` ] ( examples/README.md ) | Usage examples by feature tier |
125137
126138### Architecture
127139
128140The library is organized into the following core modules:
129141
130- - ** ` database ` ** : All database functionality
142+ - ** ` database ` ** : All database functionality (requires ` lib ` feature)
131143 - ` core ` : Connection management and schema definitions
132144 - ` session ` : One-time storage for search results
133145 - ` monocle ` : Main monocle database with ASInfo, AS2Rel, RPKI, and Pfx2as caching
134146
135- - ** ` lens ` ** : High-level business logic (reusable across CLI, API, GUI )
136- - ` time ` : Time parsing and formatting lens (lens-core)
137- - ` country ` : Country code/name lookup lens (lens-bgpkit)
138- - ` ip ` : IP information lookup lens (lens-bgpkit)
139- - ` parse ` : MRT file parsing lens with progress tracking (lens-bgpkit)
140- - ` search ` : BGP message search lens with progress tracking (lens-bgpkit)
141- - ` rpki ` : RPKI validation and data lens (lens-bgpkit)
142- - ` pfx2as ` : Prefix-to-AS mapping types (lens-bgpkit)
143- - ` as2rel ` : AS-level relationships lens (lens-bgpkit)
144- - ` inspect ` : Unified AS/prefix inspection lens (lens-full)
145-
146- - ** ` server ` ** : WebSocket API server (cli feature)
147+ - ** ` lens ` ** : High-level business logic (requires ` lib ` feature )
148+ - ` time ` : Time parsing and formatting lens
149+ - ` country ` : Country code/name lookup lens
150+ - ` ip ` : IP information lookup lens
151+ - ` parse ` : MRT file parsing lens with progress tracking
152+ - ` search ` : BGP message search lens with progress tracking
153+ - ` rpki ` : RPKI validation and data lens
154+ - ` pfx2as ` : Prefix-to-AS mapping types
155+ - ` as2rel ` : AS-level relationships lens
156+ - ` inspect ` : Unified AS/prefix inspection lens
157+
158+ - ** ` server ` ** : WebSocket API server (requires ` server ` feature)
147159
148160For detailed architecture documentation, see [ ` ARCHITECTURE.md ` ] ( ARCHITECTURE.md ) .
149161
0 commit comments