diff --git a/Cargo.lock b/Cargo.lock index aa348f3..49cd808 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,6 +284,23 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "empeve" +version = "0.1.0" +dependencies = [ + "clap", + "colored", + "crossterm", + "dirs", + "git2", + "indicatif", + "ratatui", + "serde", + "thiserror", + "toml", + "walkdir", +] + [[package]] name = "encode_unicode" version = "1.0.0" @@ -704,23 +721,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "mpv-mgr" -version = "0.1.0" -dependencies = [ - "clap", - "colored", - "crossterm", - "dirs", - "git2", - "indicatif", - "ratatui", - "serde", - "thiserror", - "toml", - "walkdir", -] - [[package]] name = "number_prefix" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index d8d6620..ae6dc40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "mpv-mgr" +name = "empeve" version = "0.1.0" edition = "2021" -description = "Package manager for mpv scripts" +description = "Plugin manager for mpv" authors = ["vikingowl"] license = "MIT" -repository = "https://somegit.dev/vikingowl/mpv-mgr" +repository = "https://somegit.dev/vikingowl/empeve" keywords = ["mpv", "scripts", "package-manager", "cli"] categories = ["command-line-utilities", "multimedia"] @@ -33,5 +33,5 @@ version = "0.28" optional = true [[bin]] -name = "mpv-mgr" +name = "empeve" path = "src/main.rs" diff --git a/README.md b/README.md index 54f5ace..fb6d4a4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# mpv-mgr +# empeve - plugin manager for mpv [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Rust](https://img.shields.io/badge/Rust-1.70%2B-orange.svg)](https://www.rust-lang.org/) -A package manager for [mpv](https://mpv.io/) scripts. Manage your mpv scripts declaratively with simple commands - add repos, install, update, and keep everything in sync. +A plugin manager for [mpv](https://mpv.io/) scripts. Manage your mpv scripts declaratively with simple commands - add repos, install, update, and keep everything in sync. ## Features @@ -21,8 +21,8 @@ A package manager for [mpv](https://mpv.io/) scripts. Manage your mpv scripts de ```bash # Clone the repository -git clone https://somegit.dev/vikingowl/mpv-mgr.git -cd mpv-mgr +git clone https://somegit.dev/vikingowl/empeve.git +cd empeve # Build and install cargo install --path . @@ -37,19 +37,19 @@ cargo install --path . ```bash # First run - detects mpv configs and prompts for setup -mpv-mgr status +empeve status # Browse popular scripts and add interactively -mpv-mgr browse -i +empeve browse -i # Or add a specific repo -mpv-mgr add tomasklaen/uosc +empeve add tomasklaen/uosc # Install all configured repos -mpv-mgr install +empeve install # Update all repos to latest -mpv-mgr update +empeve update ``` ## Usage @@ -58,80 +58,80 @@ mpv-mgr update ```bash # Add from GitHub (user/repo shorthand) -mpv-mgr add tomasklaen/uosc +empeve add tomasklaen/uosc # Add with specific branch/tag -mpv-mgr add tomasklaen/uosc --rev v5.0.0 +empeve add tomasklaen/uosc --rev v5.0.0 # Add only specific scripts from a multi-script repo -mpv-mgr add po5/mpv_sponsorblock --scripts sponsorblock.lua +empeve add po5/mpv_sponsorblock --scripts sponsorblock.lua ``` ### Installing & Updating ```bash # Install all configured repos -mpv-mgr install +empeve install # Force reinstall -mpv-mgr install --force +empeve install --force # Install specific repo only -mpv-mgr install uosc +empeve install uosc # Update all repos -mpv-mgr update +empeve update # Update specific repo -mpv-mgr update uosc +empeve update uosc ``` ### Managing Scripts ```bash # Show status of all repos and targets -mpv-mgr status +empeve status # List installed scripts -mpv-mgr list +empeve list # List with details -mpv-mgr list --detailed +empeve list --detailed # Remove a repo from config -mpv-mgr remove tomasklaen/uosc +empeve remove tomasklaen/uosc # Remove and uninstall scripts -mpv-mgr remove tomasklaen/uosc --purge +empeve remove tomasklaen/uosc --purge # Clean orphaned scripts and repos -mpv-mgr clean +empeve clean ``` ### Browsing Popular Scripts ```bash # Browse all curated scripts -mpv-mgr browse +empeve browse # Filter by category -mpv-mgr browse ui -mpv-mgr browse playback -mpv-mgr browse subtitles +empeve browse ui +empeve browse playback +empeve browse subtitles # Interactive mode - select and add repos -mpv-mgr browse -i +empeve browse -i ``` ### Multi-Target Support -mpv-mgr can manage multiple mpv configurations simultaneously: +empeve can manage multiple mpv configurations simultaneously: ```bash # Filter operations to specific target -mpv-mgr --target mpv install -mpv-mgr --target jellyfin-mpv-shim list -mpv-mgr -t mpv status +empeve --target mpv install +empeve --target jellyfin-mpv-shim list +empeve -t mpv status ``` Supported targets (auto-detected on first run): @@ -142,7 +142,7 @@ Supported targets (auto-detected on first run): ## Configuration -Config file location: `~/.config/mpv-mgr/config.toml` +Config file location: `~/.config/empeve/config.toml` ```toml [settings] @@ -207,21 +207,21 @@ scripts = ["playlistmanager.lua"] # Only this script ## How It Works -1. **Repos are cloned** to `~/.config/mpv-mgr/repos/` +1. **Repos are cloned** to `~/.config/empeve/repos/` 2. **Scripts are symlinked** to your mpv scripts directory 3. **Assets** (fonts, shaders, script-opts) are also symlinked 4. **Updates** pull latest changes, symlinks stay valid ``` -~/.config/mpv-mgr/ +~/.config/empeve/ ├── config.toml └── repos/ ├── tomasklaen_uosc/ └── po5_mpv_sponsorblock/ ~/.config/mpv/scripts/ -├── uosc -> ~/.config/mpv-mgr/repos/tomasklaen_uosc/src/uosc/ -└── sponsorblock.lua -> ~/.config/mpv-mgr/repos/po5_mpv_sponsorblock/sponsorblock.lua +├── uosc -> ~/.config/empeve/repos/tomasklaen_uosc/src/uosc/ +└── sponsorblock.lua -> ~/.config/empeve/repos/po5_mpv_sponsorblock/sponsorblock.lua ``` ## License diff --git a/src/cli.rs b/src/cli.rs index 7839a1d..6416eae 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -4,11 +4,11 @@ use std::path::PathBuf; use crate::commands::Commands; #[derive(Parser)] -#[command(name = "mpv-mgr")] -#[command(author, version, about = "Package manager for mpv scripts")] +#[command(name = "empeve")] +#[command(author, version, about = "Plugin manager for mpv")] #[command(propagate_version = true)] pub struct Cli { - /// Path to config file (default: ~/.config/mpv-mgr/config.toml) + /// Path to config file (default: ~/.config/empeve/config.toml) #[arg(short, long, global = true)] pub config: Option, diff --git a/src/commands/add.rs b/src/commands/add.rs index 56d702b..f2e2072 100644 --- a/src/commands/add.rs +++ b/src/commands/add.rs @@ -33,7 +33,7 @@ pub fn execute(repo: &str, rev: Option, scripts: Option>) -> ); println!( "Run {} to install scripts from this repository.", - "mpv-mgr install".yellow() + "empeve install".yellow() ); Ok(()) diff --git a/src/commands/browse.rs b/src/commands/browse.rs index f6bc100..6d6ffd6 100644 --- a/src/commands/browse.rs +++ b/src/commands/browse.rs @@ -97,8 +97,8 @@ pub fn execute(category_filter: Option, interactive: bool) -> Result<()> if !interactive { // Non-interactive mode: just show the list with hint println!("{}", "Tip:".bold()); - println!(" {} - Interactive selection mode", "mpv-mgr browse -i".cyan()); - println!(" {} - Add a specific repo", "mpv-mgr add ".cyan()); + println!(" {} - Interactive selection mode", "empeve browse -i".cyan()); + println!(" {} - Add a specific repo", "empeve add ".cyan()); return Ok(()); } @@ -152,7 +152,7 @@ pub fn execute(category_filter: Option, interactive: bool) -> Result<()> ); println!( "Run {} to install scripts", - "mpv-mgr install".cyan() + "empeve install".cyan() ); } diff --git a/src/commands/import.rs b/src/commands/import.rs index fb35767..f9099a7 100644 --- a/src/commands/import.rs +++ b/src/commands/import.rs @@ -25,7 +25,7 @@ pub fn execute() -> Result<()> { if importable.is_empty() { println!("{}", "No importable scripts found.".green()); - println!("All scripts are either managed by mpv-mgr or are local files."); + println!("All scripts are either managed by empeve or are local files."); return Ok(()); } @@ -105,7 +105,7 @@ pub fn execute() -> Result<()> { } print!( - "\nImport {} repository(ies) to mpv-mgr config? [Y/n] ", + "\nImport {} repository(ies) to empeve config? [Y/n] ", repos_to_import.len() ); io::stdout().flush()?; @@ -149,7 +149,7 @@ pub fn execute() -> Result<()> { println!( "{} Run {} to clone the repositories.", "Done!".green().bold(), - "mpv-mgr install".cyan() + "empeve install".cyan() ); Ok(()) diff --git a/src/commands/install.rs b/src/commands/install.rs index f1429a4..3d698b9 100644 --- a/src/commands/install.rs +++ b/src/commands/install.rs @@ -18,7 +18,7 @@ pub fn execute(force: bool, repos_filter: Option>, target_filter: Op println!("{}", "No repositories configured.".yellow()); println!( "Add a repository with: {}", - "mpv-mgr add ".cyan() + "empeve add ".cyan() ); return Ok(()); } @@ -44,7 +44,7 @@ pub fn execute(force: bool, repos_filter: Option>, target_filter: Op println!("{}", "No targets configured.".yellow()); println!( "Run {} to set up targets, or delete {} to reconfigure.", - "mpv-mgr".cyan(), + "empeve".cyan(), paths.config_file.display().to_string().dimmed() ); } @@ -201,7 +201,7 @@ pub fn execute(force: bool, repos_filter: Option>, target_filter: Op println!( "{} Remove failed repos with: {}", "Tip:".bold(), - "mpv-mgr remove ".cyan() + "empeve remove ".cyan() ); println!("{}", "─".repeat(50).dimmed()); println!(); @@ -233,7 +233,7 @@ pub fn execute(force: bool, repos_filter: Option>, target_filter: Op } /// Format clone errors with helpful hints -fn format_clone_error(error: &crate::error::MpvMgrError) -> String { +fn format_clone_error(error: &crate::error::EmpveError) -> String { let error_str = error.to_string(); if error_str.contains("authentication required") || error_str.contains("Auth") { diff --git a/src/commands/list.rs b/src/commands/list.rs index 07ded3b..6f4b47f 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -131,7 +131,7 @@ pub fn execute(detailed: bool, target_filter: Option>) -> Result<()> ); } else { println!( - "{} {} total ({} managed by mpv-mgr, {} external)", + "{} {} total ({} managed by empeve, {} external)", "Summary:".bold(), total_scripts.to_string().cyan(), total_managed.to_string().green(), @@ -144,7 +144,7 @@ pub fn execute(detailed: bool, target_filter: Option>) -> Result<()> println!( "{} Run {} to import existing scripts.", "Tip:".yellow(), - "mpv-mgr import".cyan() + "empeve import".cyan() ); } diff --git a/src/commands/remove.rs b/src/commands/remove.rs index 5449007..6b210fc 100644 --- a/src/commands/remove.rs +++ b/src/commands/remove.rs @@ -84,7 +84,7 @@ pub fn execute(repo: &str, purge: bool) -> Result<()> { if !purge { println!( "Run {} to clean up orphaned scripts and repos.", - "mpv-mgr clean".yellow() + "empeve clean".yellow() ); } diff --git a/src/commands/status.rs b/src/commands/status.rs index ace4508..05443a4 100644 --- a/src/commands/status.rs +++ b/src/commands/status.rs @@ -47,7 +47,7 @@ pub fn execute() -> Result<()> { println!("{}", "No repositories configured.".yellow()); println!( "Add a repository with: {}", - "mpv-mgr add ".cyan() + "empeve add ".cyan() ); return Ok(()); } diff --git a/src/config.rs b/src/config.rs index d7ac19c..a31b483 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use std::path::{Path, PathBuf}; -use crate::error::{MpvMgrError, Result}; +use crate::error::{EmpveError, Result}; /// Target mpv configuration (e.g., mpv, jellyfin-mpv-shim) #[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] @@ -220,7 +220,7 @@ impl Config { pub fn add_repo(&mut self, entry: RepoEntry) -> Result<()> { // Check if repo already exists if self.repos.iter().any(|r| r.repo == entry.repo) { - return Err(MpvMgrError::RepoExists(entry.repo)); + return Err(EmpveError::RepoExists(entry.repo)); } self.repos.push(entry); @@ -233,7 +233,7 @@ impl Config { .repos .iter() .position(|r| r.repo == identifier) - .ok_or_else(|| MpvMgrError::RepoNotFound(identifier.into()))?; + .ok_or_else(|| EmpveError::RepoNotFound(identifier.into()))?; Ok(self.repos.remove(position)) } diff --git a/src/error.rs b/src/error.rs index bf13bfa..77daf93 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,7 +1,7 @@ use thiserror::Error; #[derive(Error, Debug)] -pub enum MpvMgrError { +pub enum EmpveError { #[error("Config error: {0}")] Config(String), @@ -30,4 +30,4 @@ pub enum MpvMgrError { InvalidRepo(String), } -pub type Result = std::result::Result; +pub type Result = std::result::Result; diff --git a/src/main.rs b/src/main.rs index de84210..a197ae0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use clap::Parser; use colored::Colorize; -use mpv_mgr::{cli::Cli, commands, config::Config, error::Result, paths::{detect_mpv_configs, Paths}}; +use empeve::{cli::Cli, commands, config::Config, error::Result, paths::{detect_mpv_configs, Paths}}; use std::io::{self, Write}; fn main() { @@ -76,7 +76,7 @@ fn check_first_run(command: &commands::Commands) -> Result<()> { if detected.is_empty() { // No mpv configs found - create default config - println!("{}", "Welcome to mpv-mgr!".green().bold()); + println!("{}", "Welcome to empeve!".green().bold()); println!(); println!("{}", "No mpv configuration folders detected.".yellow()); println!("Creating default configuration..."); @@ -152,7 +152,7 @@ fn check_first_run(command: &commands::Commands) -> Result<()> { println!( "{} Configuration saved. Run {} to browse and add scripts.", "Done!".green().bold(), - "mpv-mgr browse -i".cyan() + "empeve browse -i".cyan() ); println!(); diff --git a/src/paths.rs b/src/paths.rs index f40f570..89cb474 100644 --- a/src/paths.rs +++ b/src/paths.rs @@ -1,18 +1,18 @@ use std::path::PathBuf; use crate::config::TargetConfig; -use crate::error::{MpvMgrError, Result}; +use crate::error::{EmpveError, Result}; -/// Manages all paths used by mpv-mgr following XDG conventions +/// Manages all paths used by empeve following XDG conventions #[derive(Debug, Clone)] pub struct Paths { - /// Base config directory (~/.config/mpv-mgr) + /// Base config directory (~/.config/empeve) pub config_dir: PathBuf, - /// Config file path (~/.config/mpv-mgr/config.toml) + /// Config file path (~/.config/empeve/config.toml) pub config_file: PathBuf, - /// Directory for cloned repos (~/.config/mpv-mgr/repos) + /// Directory for cloned repos (~/.config/empeve/repos) pub repos_dir: PathBuf, /// mpv scripts directory (~/.config/mpv/scripts) @@ -32,9 +32,9 @@ impl Paths { /// Create a new Paths instance using XDG conventions pub fn new() -> Result { let config_base = dirs::config_dir() - .ok_or_else(|| MpvMgrError::Config("Could not determine config directory".into()))?; + .ok_or_else(|| EmpveError::Config("Could not determine config directory".into()))?; - let config_dir = config_base.join("mpv-mgr"); + let config_dir = config_base.join("empeve"); let mpv_dir = config_base.join("mpv"); Ok(Self { diff --git a/src/script/installer.rs b/src/script/installer.rs index 1aa6415..e231479 100644 --- a/src/script/installer.rs +++ b/src/script/installer.rs @@ -35,7 +35,7 @@ pub struct ScriptInstaller { /// Target directory for shaders (~/.config/mpv/shaders) mpv_shaders_dir: PathBuf, - /// Source repos directory (~/.config/mpv-mgr/repos) + /// Source repos directory (~/.config/empeve/repos) repos_dir: PathBuf, /// Whether to use symlinks (true) or copy (false) @@ -150,7 +150,7 @@ impl ScriptInstaller { } // Check if directory is writable - let test_file = dest_dir.join(".mpv-mgr-test"); + let test_file = dest_dir.join(".empeve-test"); if std::fs::write(&test_file, "").is_err() { return None; } @@ -193,7 +193,7 @@ impl ScriptInstaller { Ok(()) } - /// Find all installed scripts that are managed by mpv-mgr + /// Find all installed scripts that are managed by empeve pub fn find_installed(&self) -> Result> { let mut installed = Vec::new();