Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,56 @@ hex = "0.4"
# Optional Tauri support
tauri = { version = "2", optional = true }

# CLI dependencies (optional)
clap = { version = "4.5", features = ["derive", "cargo", "env"], optional = true }
tokio = { version = "1.40", features = ["full"], optional = true }
toml = { version = "0.8", optional = true }
dirs = { version = "5.0", optional = true }
env_logger = { version = "0.11", optional = true }
log = { version = "0.4", optional = true }
colored = { version = "2.1", optional = true }
indicatif = { version = "0.17", optional = true }
prettytable-rs = { version = "0.10", optional = true }
daemonize = { version = "0.5", optional = true }
sysinfo = { version = "0.30", optional = true }
qr2term = { version = "0.3", optional = true }
anyhow = { version = "1.0", optional = true }
signal-hook = { version = "0.3", optional = true }
hostname = { version = "0.4", optional = true }
rpassword = { version = "7.3", optional = true }
ctrlc = { version = "3.4", optional = true }

# System dependencies
libc = "0.2"

[features]
default = []
cli = [
"clap",
"tokio",
"toml",
"dirs",
"env_logger",
"log",
"colored",
"indicatif",
"prettytable-rs",
"daemonize",
"sysinfo",
"qr2term",
"anyhow",
"signal-hook",
"hostname",
"rpassword",
"ctrlc",
]
tauri-api = ["tauri"]

[[bin]]
name = "nexus-cli"
path = "src/bin/nexus-cli.rs"
required-features = ["cli"]

[profile.release]
opt-level = "z" # Optimize for size
lto = true # Enable link-time optimization
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
[![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue)](#license)
[![Crates.io](https://img.shields.io/crates/v/nexus-core)](https://crates.io/crates/nexus-core)

> Core Rust library for the FocusSuite ecosystem - providing database operations, business logic, and peer-to-peer synchronization capabilities.
> Core Rust library for the FocusSuite ecosystem - providing database operations, business logic, and peer-to-peer synchronization capabilities. Now available as a CLI tool for developers!

## Overview

`nexus-core` is a cross-platform Rust library that powers FocusSuite's productivity applications. It provides:
`nexus-core` is a cross-platform Rust library and CLI tool that powers FocusSuite's productivity applications. It provides:

- **SQLite database** with automatic schema migrations
- **User authentication** with Argon2 password hashing
Expand All @@ -35,15 +35,32 @@ rustup default nightly

### Installation

#### As a Library

Add to your `Cargo.toml`:

```toml
[dependencies]
nexus-core = { path = "../nexus-core" }
```

#### As a CLI Tool

```bash
# Build and install
cargo install --path . --features cli

# Or build from source
cargo build --release --features cli

# Verify installation
nexus-cli --version
```

### Basic Usage

#### Library Usage

```rust
use nexus_core::{initialize_database, register_user, login_user};

Expand All @@ -64,6 +81,25 @@ let authenticated_user = login_user(&conn, "alice", "secure_password")?;
println!("Welcome, {}!", authenticated_user.user_name);
```

#### CLI Usage

```bash
# Initialize with user
nexus-cli init --user alice --email [email protected]

# Start sync daemon
nexus-cli start --daemon

# Check status
nexus-cli status

# View logs
nexus-cli logs --follow

# For complete CLI documentation:
# See docs/CLI_USAGE.md
```

## Features

### Database & Migrations
Expand Down Expand Up @@ -201,6 +237,7 @@ cargo test -- --nocapture

| Document | Description |
|----------|-------------|
| [CLI_USAGE.md](docs/CLI_USAGE.md) | **Complete CLI tool guide** |
| [DATABASE_MIGRATIONS.md](docs/DATABASE_MIGRATIONS.md) | Complete migration system guide |
| [MIGRATION_QUICK_START.md](docs/MIGRATION_QUICK_START.md) | Quick reference for migrations |
| [MIGRATION_SYSTEM_SUMMARY.md](MIGRATION_SYSTEM_SUMMARY.md) | Implementation summary |
Expand Down
Loading
Loading