static INIT_SCHEMA_URL: &str = "https://raw.githubusercontent.com/ffimnsr/mk-rs/main/docs/schema.json";
long_about = "mk is a powerful and flexible task runner designed to help you automate and manage your tasks efficiently. It supports running commands both locally and inside containers, making it versatile for various environments and use cases. Running tasks in containers is a first-class citizen, ensuring seamless integration with containerized workflows.",
#[command(visible_aliases = ["s"], arg_required_else_help = true, about = "Access stored secrets")]
serde_json::Value::Array(items.into_iter().map(Self::canonicalize_json).collect::<Vec<_>>())
let client = Self::build_update_client(Self::update_connect_timeout(), Self::update_request_timeout())?;
let latest_version = Self::fetch_latest_version(&client, &Self::update_latest_release_url())?;
.unwrap_or_else(|_| String::from("https://api.github.com/repos/ffimnsr/mk-rs/releases/latest"))
fn build_update_client(connect_timeout: Duration, request_timeout: Duration) -> anyhow::Result<Client> {
let release: GitHubRelease = serde_json::from_str(&body).context("Invalid update response payload")?;
fn format_update_error(url: &str, status: StatusCode, headers: &HeaderMap, body: &str) -> String {
let script = String::from_utf8(output).context("Generated completion script was not valid UTF-8")?;
case init list ls completion comp completions validate secrets s update clean-cache schema help
MK_COMPLETE_TASKS=1 MK_COMPLETE_PREFIX="$cur" "${{words[1]}}" "${{config_args[@]}}" 2>/dev/null
"Unsupported `mk init` output extension .{}. Supported formats: .yaml, .yml, .toml, .json, .lua",
let err = CliEntry::fetch_latest_version(&client, &format!("http://{}/latest", address)).unwrap_err();
"{\"message\":\"API rate limit exceeded\",\"documentation_url\":\"https://docs.github.com\"}";
let err = CliEntry::fetch_latest_version(&client, &format!("http://{}/latest", address)).unwrap_err();