Update name to gitlore instead of gitlab-inbox

This commit is contained in:
teernisse
2026-01-28 15:49:10 -05:00
parent 9a6357c353
commit 55b895a2eb
31 changed files with 1046 additions and 373 deletions

View File

@@ -178,7 +178,7 @@ fn check_database(config: Option<&Config>) -> DatabaseCheck {
return DatabaseCheck {
result: CheckResult {
status: CheckStatus::Error,
message: Some("Database file not found. Run \"gi init\" first.".to_string()),
message: Some("Database file not found. Run \"lore init\" first.".to_string()),
},
path: Some(db_path.display().to_string()),
schema_version: None,
@@ -302,7 +302,7 @@ fn check_projects(config: Option<&Config>) -> ProjectsCheck {
return ProjectsCheck {
result: CheckResult {
status: CheckStatus::Error,
message: Some("Database not found. Run \"gi init\" first.".to_string()),
message: Some("Database not found. Run \"lore init\" first.".to_string()),
},
configured: Some(configured),
resolved: Some(0),
@@ -320,7 +320,7 @@ fn check_projects(config: Option<&Config>) -> ProjectsCheck {
result: CheckResult {
status: CheckStatus::Error,
message: Some(format!(
"{configured} configured, 0 resolved. Run \"gi init\" to resolve projects."
"{configured} configured, 0 resolved. Run \"lore init\" to resolve projects."
)),
},
configured: Some(configured),
@@ -459,7 +459,7 @@ async fn check_ollama(config: Option<&Config>) -> OllamaCheck {
/// Format and print doctor results to console.
pub fn print_doctor_results(result: &DoctorResult) {
println!("\ngi doctor\n");
println!("\nlore doctor\n");
print_check("Config", &result.checks.config.result);
print_check("Database", &result.checks.database.result);

View File

@@ -124,7 +124,7 @@ pub async fn run_ingest(
)));
}
return Err(GiError::Other(
"No projects configured. Run 'gi init' first.".to_string(),
"No projects configured. Run 'lore init' first.".to_string(),
));
}

View File

@@ -143,7 +143,7 @@ pub async fn run_init(inputs: InitInputs, options: InitOptions) -> Result<InitRe
// 7. Create data directory and initialize database
fs::create_dir_all(&data_dir)?;
let db_path = data_dir.join("gi.db");
let db_path = data_dir.join("lore.db");
let conn = create_connection(&db_path)?;
// Run embedded migrations

View File

@@ -298,7 +298,7 @@ pub fn print_sync_status(result: &SyncStatusResult) {
println!(" {}", style("No sync runs recorded yet.").dim());
println!(
" {}",
style("Run 'gi ingest --type=issues' to start.").dim()
style("Run 'lore ingest --type=issues' to start.").dim()
);
}
}

View File

@@ -5,9 +5,9 @@ pub mod commands;
use clap::{Parser, Subcommand};
use std::io::IsTerminal;
/// GitLab Inbox - Unified notification management
/// Gitlore - Local GitLab data management with semantic search
#[derive(Parser)]
#[command(name = "gi")]
#[command(name = "lore")]
#[command(version, about, long_about = None)]
pub struct Cli {
/// Path to config file
@@ -15,7 +15,7 @@ pub struct Cli {
pub config: Option<String>,
/// Machine-readable JSON output (auto-enabled when piped)
#[arg(long, global = true, env = "GI_ROBOT")]
#[arg(long, global = true, env = "LORE_ROBOT")]
pub robot: bool,
#[command(subcommand)]

View File

@@ -159,7 +159,7 @@ pub fn run_migrations_from_dir(conn: &Connection, migrations_dir: &Path) -> Resu
}
/// Verify database pragmas are set correctly.
/// Used by gi doctor command.
/// Used by lore doctor command.
pub fn verify_pragmas(conn: &Connection) -> (bool, Vec<String>) {
let mut issues = Vec::new();

View File

@@ -1,4 +1,4 @@
//! Custom error types for gitlab-inbox.
//! Custom error types for gitlore.
//!
//! Uses thiserror for ergonomic error definitions with structured error codes.
@@ -65,10 +65,10 @@ impl ErrorCode {
}
}
/// Main error type for gitlab-inbox.
/// Main error type for gitlore.
#[derive(Error, Debug)]
pub enum GiError {
#[error("Config file not found at {path}. Run \"gi init\" first.")]
#[error("Config file not found at {path}. Run \"lore init\" first.")]
ConfigNotFound { path: String },
#[error("Invalid config: {details}")]
@@ -158,18 +158,18 @@ impl GiError {
/// Get a suggestion for how to fix this error.
pub fn suggestion(&self) -> Option<&'static str> {
match self {
Self::ConfigNotFound { .. } => Some("Run 'gi init' to create configuration"),
Self::ConfigInvalid { .. } => Some("Check config file syntax or run 'gi init' to recreate"),
Self::ConfigNotFound { .. } => Some("Run 'lore init' to create configuration"),
Self::ConfigInvalid { .. } => Some("Check config file syntax or run 'lore init' to recreate"),
Self::GitLabAuthFailed => Some("Verify token has read_api scope and is not expired"),
Self::GitLabNotFound { .. } => Some("Check the resource path exists and you have access"),
Self::GitLabRateLimited { .. } => Some("Wait and retry, or reduce request frequency"),
Self::GitLabNetworkError { .. } => Some("Check network connection and GitLab URL"),
Self::DatabaseLocked { .. } => Some("Wait for other sync to complete or use --force"),
Self::MigrationFailed { .. } => Some("Check database file permissions or reset with 'gi reset'"),
Self::MigrationFailed { .. } => Some("Check database file permissions or reset with 'lore reset'"),
Self::TokenNotSet { .. } => Some("Export the token environment variable"),
Self::Database(_) => Some("Check database file permissions or reset with 'gi reset'"),
Self::Database(_) => Some("Check database file permissions or reset with 'lore reset'"),
Self::Http(_) => Some("Check network connection"),
Self::NotFound(_) => Some("Verify the entity exists using 'gi list'"),
Self::NotFound(_) => Some("Verify the entity exists using 'lore list'"),
Self::Ambiguous(_) => Some("Use --project flag to disambiguate"),
_ => None,
}

View File

@@ -6,9 +6,9 @@ use std::path::PathBuf;
///
/// Resolution order:
/// 1. CLI flag override (if provided)
/// 2. GI_CONFIG_PATH environment variable
/// 3. XDG default (~/.config/gi/config.json)
/// 4. Local fallback (./gi.config.json) if exists
/// 2. LORE_CONFIG_PATH environment variable
/// 3. XDG default (~/.config/lore/config.json)
/// 4. Local fallback (./lore.config.json) if exists
/// 5. Returns XDG default even if not exists
pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
// 1. CLI flag override
@@ -17,18 +17,18 @@ pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
}
// 2. Environment variable
if let Ok(path) = std::env::var("GI_CONFIG_PATH") {
if let Ok(path) = std::env::var("LORE_CONFIG_PATH") {
return PathBuf::from(path);
}
// 3. XDG default
let xdg_path = get_xdg_config_dir().join("gi").join("config.json");
let xdg_path = get_xdg_config_dir().join("lore").join("config.json");
if xdg_path.exists() {
return xdg_path;
}
// 4. Local fallback (for development)
let local_path = PathBuf::from("gi.config.json");
let local_path = PathBuf::from("lore.config.json");
if local_path.exists() {
return local_path;
}
@@ -38,9 +38,9 @@ pub fn get_config_path(cli_override: Option<&str>) -> PathBuf {
}
/// Get the data directory path.
/// Uses XDG_DATA_HOME or defaults to ~/.local/share/gi
/// Uses XDG_DATA_HOME or defaults to ~/.local/share/lore
pub fn get_data_dir() -> PathBuf {
get_xdg_data_dir().join("gi")
get_xdg_data_dir().join("lore")
}
/// Get the database file path.
@@ -49,7 +49,7 @@ pub fn get_db_path(config_override: Option<&str>) -> PathBuf {
if let Some(path) = config_override {
return PathBuf::from(path);
}
get_data_dir().join("gi.db")
get_data_dir().join("lore.db")
}
/// Get the backup directory path.

View File

@@ -1,7 +1,7 @@
//! GitLab Inbox - Semantic search for GitLab issues, MRs, and discussions.
//! Gitlore - Semantic search for GitLab issues, MRs, and discussions.
//!
//! A self-hosted CLI tool that consolidates GitLab notifications into a unified inbox
//! with semantic search capabilities.
//! A self-hosted CLI tool that syncs GitLab data to a local SQLite database
//! with fast querying and semantic search capabilities.
pub mod cli;
pub mod core;

View File

@@ -1,4 +1,4 @@
//! GitLab Inbox CLI entry point.
//! Gitlore CLI entry point.
use clap::Parser;
use console::style;
@@ -8,8 +8,8 @@ use tracing_subscriber::EnvFilter;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
use gi::Config;
use gi::cli::commands::{
use lore::Config;
use lore::cli::commands::{
InitInputs, InitOptions, ListFilters, MrListFilters, open_issue_in_browser, open_mr_in_browser,
print_count, print_count_json, print_doctor_results, print_ingest_summary,
print_ingest_summary_json, print_list_issues, print_list_issues_json, print_list_mrs,
@@ -18,11 +18,11 @@ use gi::cli::commands::{
run_doctor, run_ingest, run_init, run_list_issues, run_list_mrs, run_show_issue, run_show_mr,
run_sync_status,
};
use gi::cli::{Cli, Commands};
use gi::core::db::{create_connection, get_schema_version, run_migrations};
use gi::core::error::{GiError, RobotErrorOutput};
use gi::core::paths::get_config_path;
use gi::core::paths::get_db_path;
use lore::cli::{Cli, Commands};
use lore::core::db::{create_connection, get_schema_version, run_migrations};
use lore::core::error::{GiError, RobotErrorOutput};
use lore::core::paths::get_config_path;
use lore::core::paths::get_db_path;
#[tokio::main]
async fn main() {
@@ -37,7 +37,7 @@ async fn main() {
)
.with(
EnvFilter::from_default_env()
.add_directive("gi=info".parse().unwrap())
.add_directive("lore=info".parse().unwrap())
.add_directive("warn".parse().unwrap()),
)
.with(indicatif_layer)
@@ -326,7 +326,7 @@ async fn handle_init(
);
println!(
"{}",
style("\nSetup complete! Run 'gi doctor' to verify.").blue()
style("\nSetup complete! Run 'lore doctor' to verify.").blue()
);
Ok(())
@@ -612,7 +612,7 @@ fn handle_version(robot_mode: bool) -> Result<(), Box<dyn std::error::Error>> {
};
println!("{}", serde_json::to_string(&output)?);
} else {
println!("gi version {}", version);
println!("lore version {}", version);
}
Ok(())
}
@@ -641,7 +641,7 @@ fn handle_backup(robot_mode: bool) -> Result<(), Box<dyn std::error::Error>> {
};
println!("{}", serde_json::to_string(&output)?);
} else {
println!("gi backup - not yet implemented");
println!("lore backup - not yet implemented");
}
Ok(())
}
@@ -657,7 +657,7 @@ fn handle_reset(robot_mode: bool) -> Result<(), Box<dyn std::error::Error>> {
};
println!("{}", serde_json::to_string(&output)?);
} else {
println!("gi reset - not yet implemented");
println!("lore reset - not yet implemented");
}
Ok(())
}
@@ -702,7 +702,7 @@ async fn handle_migrate(
error: RobotErrorSuggestionData {
code: "DB_ERROR".to_string(),
message: format!("Database not found at {}", db_path.display()),
suggestion: "Run 'gi init' first".to_string(),
suggestion: "Run 'lore init' first".to_string(),
},
};
eprintln!("{}", serde_json::to_string(&output)?);
@@ -713,7 +713,7 @@ async fn handle_migrate(
);
eprintln!(
"{}",
style("Run 'gi init' first to create the database.").yellow()
style("Run 'lore init' first to create the database.").yellow()
);
}
std::process::exit(10); // DB_ERROR exit code