Skip to content
Open
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
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
rustup toolchain install stable --profile minimal
rustup component add rustfmt clippy

- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Formatting
run: cargo fmt -- --check

- name: Clippy
run: cargo clippy --all-targets -- -D warnings

test:
needs: lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
run: rustup toolchain install stable --profile minimal

- name: Cache cargo registry & build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Build
run: cargo build --all-targets

- name: Test
run: cargo test
9 changes: 6 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ claudini/
src/
main.rs # CLI entry point (clap derive), subcommand enums, output formatting
config.rs # Path helpers, Config struct, directory layout
keychain.rs # macOS Keychain read/write/delete via keyring crate
keychain.rs # macOS Keychain read/write/delete via security CLI
profile.rs # Profile operations: init, add, add --login, use, list, remove, rename, current
backup.rs # Backup operations: create, restore, list
backup.rs # Backup operations: create, restore, delete, list
sync.rs # Shared field sync between profiles
update.rs # Version update checking via GitHub releases API
```

## CLI
Expand Down Expand Up @@ -53,6 +54,7 @@ claudini backup list
- Two output modes: human (colored, spinners, tables) and JSON (`--json` flag)
- Claude home directory overridable via `--claude-home` flag or `CLAUDINI_CLAUDE_HOME` env var
- Account-specific fields listed in `sync.rs::ACCOUNT_SPECIFIC_FIELDS`
- When stdout is not a terminal (piped/redirected), colors should be stripped from table output and `console::Style` is skipped entirely. Redirecting command output to a file should produce clean text.

## Git & PR conventions

Expand All @@ -65,6 +67,7 @@ claudini backup list
- Try to keep branch names short but readable
- Always remove previously added but now unused code
- Do not include test plans in PR descriptions or commit messages
- Before committing, always run `cargo fmt` and `cargo clippy --all-targets -- -D warnings` and fix any issues

## Build & run

Expand All @@ -79,7 +82,7 @@ cargo run -- <command>
- `serde` + `serde_json` — JSON handling
- `dirs` — home directory resolution
- `anyhow` — error handling
- `keyring` (apple-native)macOS Keychain access
- macOS `security` CLI — Keychain access (via `std::process::Command`)
- `console` — terminal colors/styling
- `indicatif` — progress spinners
- `comfy-table` — formatted table output
147 changes: 147 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ dirs = "6"
indicatif = "0.17"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[dev-dependencies]
assert_cmd = "2"
predicates = "3"
Loading