cargo_x402/
lib.rs

1#![warn(missing_docs)]
2//! # cargo-x402
3//!
4//! A fast and flexible project scaffolder for Rust applications using GitHub-hosted templates.
5//!
6//! This library provides the core functionality for discovering, validating, and rendering
7//! x402 project templates stored as GitHub repositories. It supports:
8//!
9//! - **Template Discovery**: Automatic discovery of public templates via GitHub's `x402-template` topic
10//! - **Schema Validation**: TOML-based template manifests with comprehensive validation
11//! - **Parameter Handling**: Support for string, boolean, and enum parameters with validation
12//! - **Liquid Templating**: Safe variable substitution and conditional rendering
13//! - **Interactive CLI**: User-friendly prompts and progress feedback
14//!
15//! ## Architecture
16//!
17//! The library is organized into distinct modules:
18//!
19//! - [`discovery`]: Finding and caching templates from GitHub
20//! - [`schema`]: Template manifest parsing and validation
21//! - [`template`]: Downloading and rendering templates
22//! - [`interactive`]: User interaction and prompts
23//! - [`commands`]: High-level operations (list, create)
24//! - [`error`]: Error types and handling
25//!
26//! ## Quick Example
27//!
28//! ```no_run,ignore
29//! use cargo_x402::discovery::github::GitHubDiscovery;
30//!
31//! // See integration tests and CLI for actual usage examples
32//! // The binary provides the primary interface for cargo-x402 operations
33//! ```
34
35pub mod commands;
36pub mod discovery;
37pub mod error;
38pub mod interactive;
39pub mod schema;
40pub mod template;
41
42/// The version of cargo-x402 being used
43pub const VERSION: &str = env!("CARGO_PKG_VERSION");