This file provides guidance to AI coding assistants when working with code in this repository.
ULS is a Rust CLI tool for querying FCC Universal Licensing System public data. It downloads FCC license data, stores it in a local SQLite database, and provides fast offline queries for amateur radio and GMRS licenses.
uls-cli CLI entry point (lookup, search, frn, update, db, stats, serve, auto_update)
↓
uls-query Query engine with filtering and output formatting (json, csv, yaml, table)
↓
uls-db SQLite layer (schema, bulk import, queries, r2d2 connection pooling)
↓
uls-parser Parser for FCC's pipe-delimited DAT files from ZIP archives
↓
uls-core Core types: 89 ULS record types, radio service codes, error types
uls-download Async HTTP client for FCC data (weekly/daily downloads, ETag caching)
uls-api REST API server (axum-based)
Dependency flow: cli → query → db → parser → core. Download crate is used by cli for updates.
# Build
cargo build # Development build
cargo build --release # Release build (LTO enabled)
# Test (uses cargo-nextest)
cargo nextest run --workspace --all-features # All tests
cargo nextest run -p uls-core # Single crate
cargo test --doc --workspace # Doctests only
# Code quality (CI runs these with -D warnings)
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Run from source
cargo run -p uls-cli -- lookup W1AW| Command | Description |
|---|---|
uls <CALLSIGN> |
Quick callsign lookup |
uls search |
Advanced search (name, location, FRN, etc.) |
uls frn <FRN> |
Look up licenses by FCC Registration Number |
uls update |
Download and update local database |
uls stats |
Database statistics |
uls serve |
Start REST API server |
uls db |
Database management (init, info, vacuum) |
- Download →
uls-downloadfetches ZIP files from FCC servers (weekly full + daily deltas) - Parse →
uls-parserreads pipe-delimited DAT files - Ingest →
uls-dbinserts records into SQLite - Query →
uls-queryconstructs SQL from user input - Output → Results formatted as table, JSON, CSV, or YAML
crates/*/src/- Source code for each cratecrates/*/tests/- Integration teststests/fixtures/fcc-sample/- Sample FCC data (l_amat, l_gmrs)scripts/- Utility scripts (includingextract_test_fixture.pyfor regenerating fixtures)fcc-docs/- FCC reference documentation
ULS_DB_PATH- Database location (default:~/.uls/uls.db)ULS_CACHE_DIR- Download cache (default:~/.uls/cache)
Records are pipe-delimited in DAT files. Common types:
- HD - Header
- EN - Entity
- AM - Amateur
- LA - Location/Antenna
- CO - Control Point
- HS - History
- SC - Special Conditions
All 89 record types are defined in uls-core/src/records/.
- Rust 2021 edition, MSRV 1.88
cargo fmtfor formatting (4-space indentation)snake_casefor modules/functions/files,CamelCasefor types/traits,SCREAMING_SNAKE_CASEfor constants- Shared record models in
uls-core, output formatting inuls-query - Error handling:
anyhowfor applications,thiserrorfor libraries - Logging:
tracingwith-vflags for verbosity - Async:
tokiofor I/O operations
Follow Conventional Commits format seen in history:
feat(cli): add new search flagfix(db): handle null values in importtest(cli): add integration coveragechore: cargo fmt
Keep summaries short and scoped.