Packages

Generate Gleam types, JSON codecs, and a typed XRPC client from atproto lexicon files.

Current section

Files

Jump to
atproto_codegen src atproto_codegen config.gleam
Raw

src/atproto_codegen/config.gleam

//// Generation settings threaded through naming + emission, so the tool is
//// not coupled to any one project's paths or namespace.
import gleam/option.{type Option}
pub type Config {
Config(
/// Where the lexicon JSON files live.
lexicons_dir: String,
/// Directory the generated modules are written into.
out_dir: String,
/// Module prefix the generated code imports itself under (matches out_dir).
out_module: String,
/// NSID prefixes stripped from module paths (own namespace + vendored).
nsid_prefixes: List(String),
/// Opt-in xrpc-client module subpath (no `.gleam`), or `None` to skip it.
client: Option(String),
)
}