Skip to main content

git_same/
lib.rs

1//! # Git-Same - Mirror GitHub org/repo structure locally
2//!
3//! Git-Same is a CLI tool that discovers all GitHub organizations
4//! and repositories you have access to, then clones them to your local filesystem
5//! maintaining the org/repo directory structure.
6//!
7//! ## Features
8//!
9//! - **Multi-Provider Support**: Works with GitHub (more providers coming soon)
10//! - **Parallel Operations**: Clones and syncs repositories concurrently
11//! - **Smart Filtering**: Filter by archived status, forks, organizations
12//! - **Incremental Sync**: Only fetches/pulls what has changed
13//! - **Progress Reporting**: Beautiful progress bars and status updates
14//!
15//! ## Available Commands
16//!
17//! The tool can be invoked using any of these names (all installed by default):
18//! - `git-same` - Main command
19//! - `gitsame` - No hyphen variant
20//! - `gitsa` - Short form
21//! - `gisa` - Shortest variant
22//! - `git same` - Git subcommand (requires git-same in PATH)
23//!
24//! ## Example
25//!
26//! ```bash
27//! # Initialize configuration
28//! git-same init
29//!
30//! # Set up a workspace
31//! git-same setup
32//!
33//! # Sync repositories (clone new + fetch existing)
34//! git-same sync --dry-run
35//! git-same sync
36//!
37//! # Show status
38//! git-same status
39//!
40//! # Also works as git subcommand
41//! git same sync
42//! ```
43
44pub mod app;
45pub mod auth;
46pub mod banner;
47pub mod cache;
48pub mod checks;
49pub mod cli;
50pub mod commands;
51pub mod config;
52pub mod discovery;
53pub mod domain;
54pub mod errors;
55pub mod git;
56pub mod infra;
57pub mod operations;
58pub mod output;
59pub mod provider;
60#[cfg(feature = "tui")]
61pub mod setup;
62#[cfg(feature = "tui")]
63pub mod tui;
64pub mod types;
65pub mod workflows;
66
67/// Re-export commonly used types for convenience.
68pub mod prelude {
69    pub use crate::auth::{get_auth, get_auth_for_provider, AuthResult};
70    pub use crate::cache::{CacheManager, DiscoveryCache, CACHE_VERSION};
71    pub use crate::cli::{Cli, Command, InitArgs, ResetArgs, StatusArgs, SyncCmdArgs};
72    pub use crate::config::{
73        Config, ConfigCloneOptions, FilterOptions, SyncMode as ConfigSyncMode, WorkspaceConfig,
74        WorkspaceProvider,
75    };
76    pub use crate::discovery::DiscoveryOrchestrator;
77    pub use crate::domain::RepoPathTemplate;
78    pub use crate::errors::{AppError, GitError, ProviderError, Result};
79    pub use crate::git::{
80        CloneOptions, FetchResult, GitOperations, PullResult, RepoStatus, ShellGit,
81    };
82    pub use crate::operations::clone::{
83        CloneManager, CloneManagerOptions, CloneProgress, CloneResult,
84    };
85    pub use crate::operations::sync::{
86        LocalRepo, SyncManager, SyncManagerOptions, SyncMode, SyncResult,
87    };
88    pub use crate::output::{
89        CloneProgressBar, DiscoveryProgressBar, Output, SyncProgressBar, Verbosity,
90    };
91    pub use crate::provider::{
92        create_provider, Credentials, DiscoveryOptions, DiscoveryProgress, NoProgress, Provider,
93        RateLimitInfo,
94    };
95    pub use crate::types::{ActionPlan, OpResult, OpSummary, Org, OwnedRepo, ProviderKind, Repo};
96}
97
98#[cfg(test)]
99#[path = "lib_tests.rs"]
100mod tests;