Skip to main content

Crate gitcore

Crate gitcore 

Source
Expand description

§Gitcore: The Programmatic Engine for Git Identity Management

Gitcore is a high-assurance Rust library designed to solve the complexity of managing multiple Git identities on a single machine. It provides a deterministic, secure, and automated way to isolate SSH keys, commit authorship, and cryptographic signing across different environments.

§Core Philosophy

Traditional Git workflows rely on global configurations that lead to “identity leakage” (e.g., using a personal email for a corporate commit). Gitcore eliminates this by providing:

  • Cryptographic Isolation: Every account is backed by its own unique Ed25519 keypair.
  • Automated Orchestration: Seamless management of ~/.ssh/config without touching existing manual entries.
  • Contextual Awareness: Automatic detection and injection of identity metadata during clone or remote operations.

§Library vs. CLI

This crate serves as the underlying engine for the gitcore CLI. By exposing this engine programmatically, Gitcore enables developers to:

  • Build custom Git automation and CI/CD pipelines.
  • Integrate identity management into IDEs or developer portals.
  • Extend the core logic for specialized hosting providers.

§Getting Started

use gitcore::{Gitcore, AddAccountRequest, Platform};

// Initialize the service with standard user paths
let service = Gitcore::new();

// Provision and register a new identity
let request = AddAccountRequest {
    name: "work".to_string(),
    platform: Platform::Github,
    username: "octocat".to_string(),
    email: "octocat@example.com".to_string(),
    ..Default::default()
};

service.register_account(request)?;

Structs§

Account
A persisted identity record for a Git hosting platform.
AddAccountRequest
Input required to register a new Gitcore account.
AuditReport
Security audit report for a Gitcore installation.
BackupReport
Summary of a created encrypted backup.
CloneReport
Outcome of an identity-aware clone operation.
CloneRequest
Input required to clone or attach a repository for an account.
FileAudit
Permission status for an audited file.
Gitcore
High-level service facade for Gitcore operations.
GitcoreConfig
Root configuration object containing all managed accounts.
GitcorePaths
Filesystem locations used by the Gitcore library.
GpgKey
KeyAudit
Audit result for a managed SSH keypair.
KeyDeletionReport
Outcome of deleting managed SSH key files for an account.
KeyProvisionReport
Outcome of generating a managed SSH key before account registration.
RegisteredAccount
Normalized account details produced during registration.
RemoteAddRequest
Input required to add or replace the origin remote for a repository.
RemoteReport
Outcome of a remote add or switch operation.
RemoteSwitchRequest
Input required to switch an existing repository to a different account.
RestoreReport
Outcome of restoring persisted state from a vault or JSON file.
RotationReport
Outcome of rotating an account SSH key.
SshTestReport
Outcome of testing SSH connectivity for an account.
UpdateAccountRequest
Input required to update an existing Gitcore account.

Enums§

GitcoreError
Typed error surface for library consumers.
HostKeyStatus
Platform
Supported Git hosting platforms.

Functions§

delete_account_keys
generate_ssh_key
get_ssh_dir
list_gpg_keys

Type Aliases§

Result
Standard result type for Gitcore library operations.