Expand description
§Projects Indexer
projets-indexer
is a powerful command-line tool for indexing and organizing your projects
with AI-powered tag generation. It helps developers maintain a clear overview of their project
collection by scanning directories, detecting project types, and providing detailed statistics.
§Features
- 🔍 Recursive directory scanning with configurable depth
- 📊 Project status detection (active/archived) based on git history
- 🏷️ AI-powered tag generation using Ollama
- 📁 Smart project categorization based on directory structure
- 🔎 Search functionality across projects, tags, and categories
- 📈 Detailed project statistics and insights
§Usage
# Index projects with default settings
projets-indexer index
# Index projects with custom directory and output
projets-indexer index -d ~/my-projects -o my-index.json
# Search projects
projets-indexer search "machine learning"
# Show project statistics
projets-indexer stats
# Generate tags for a specific project
projets-indexer generate-tags -p ~/projects/my-project
§Modules
cli
: Command-line interface implementation using clapconfig
: Configuration structures and handlingindexer
: Core project indexing functionalitymodels
: Data structures for projects and related entitiesollama
: Integration with Ollama for AI-powered tag generationui
: Terminal UI components and progress indicatorserror
: Error types and handling
§Examples
Basic usage of the library:
use projets_indexer::{
config::IndexerConfig,
indexer::ProjectIndexer,
};
use std::path::PathBuf;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create indexer configuration
let config = IndexerConfig::new(
PathBuf::from("~/projects"),
PathBuf::from("index.json"),
true, // enable Ollama
);
// Initialize project indexer
let indexer = ProjectIndexer::new(config)?;
// Index projects with a progress callback
let projects = indexer.index_projects(|project_name| {
println!("Indexing: {}", project_name);
}).await?;
println!("Found {} projects", projects.len());
Ok(())
}
§Re-exports
The following types are re-exported for convenience:
IndexerConfig
: Configuration for the project indexerProjectIndexer
: Main indexer implementationProject
: Project metadata structureProjectStatus
: Project status enumerationOllamaClient
: Client for interacting with Ollama API
§Error Handling
The library uses a custom error type OllamaError
and a type alias Result
for consistent error handling across all modules.
§Dependencies
tokio
: Async runtimeserde
: Serialization/deserializationwalkdir
: Directory traversaltracing
: Logging and diagnosticsreqwest
: HTTP client for Ollama API
Re-exports§
pub use cli::Cli;
pub use cli::Commands;
pub use config::indexer_config::IndexerConfig;
pub use error::OllamaError;
pub use error::Result;
pub use indexer::project_indexer::ProjectIndexer;
pub use models::project::Project;
pub use models::project::ProjectStatus;
pub use ollama::ClientConfig;
pub use ollama::GenerateRequest;
pub use ollama::GenerateResponse;
pub use ollama::OllamaClient;