Crate clarence

Crate clarence 

Source
Expand description

Clarence - A powerful Rust framework for building CLIs that translate commands into HTTP requests

§Example

use clarence::{Clarence, Handler, Method};

Clarence::builder()
    .name("mycli")
    .base_url("https://api.example.com")
    .header("X-App", "cli")
    .help("My CLI tool")
    .version(env!("CARGO_PKG_VERSION"))
    .run();

Re-exports§

pub use builder::Clarence;
pub use builder::ClarenceBuilder;
pub use builder::HeaderSource;
pub use builder::HelpSource;
pub use builder::HelpValue;
pub use builder::StorageRef;
pub use context::Args;
pub use context::Context;
pub use context::HandlerResponse;
pub use environment::EnvironmentConfig;
pub use environment::EnvironmentConfigBuilder;
pub use environment::EnvironmentDef;
pub use error::ClarenceError;
pub use error::Result;
pub use git::GitInfo;
pub use handler::Handler;
pub use handler::HandlerHelpSource;
pub use handler::HandlerHelpValue;
pub use http::HttpClient;
pub use http::Method;
pub use http::Response;
pub use parser::DefaultParser;
pub use parser::JsonCliActionsParser;
pub use parser::Parser;
pub use router::Router;
pub use storage::FileStore;
pub use storage::Storage;
pub use environment::EnvironmentConfig as Environment;

Modules§

builder
Clarence builder and main application
context
Execution context passed to handlers
environment
Environment configuration for multi-environment CLIs
error
Error types for Clarence
git
Git context utilities for extracting repository information
handler
Handler types and execution logic
http
HTTP client and method types
parser
Response parsers for handling HTTP responses
router
Command routing using a trie structure for longest-prefix matching
storage
Storage system for key-value pairs backed by filesystem