Skip to main content

Crate sc

Crate sc 

Source
Expand description

SaveContext CLI - The OS for AI coding agents

This crate provides the core functionality for the sc CLI tool.

§Architecture

  • cli - Command-line interface using clap
  • model - Data types (Session, Issue, ContextItem, Checkpoint, Plan)
  • storage - SQLite database layer
  • sync - JSONL import/export operations
  • config - Configuration management
  • embeddings - Embedding providers (Ollama, HuggingFace)
  • error - Error types and handling

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

cli
CLI definitions using clap.
config
Configuration management.
embeddings
Embedding module for semantic search.
error
Error types for SaveContext CLI.
model
Data models for SaveContext.
storage
SQLite storage layer for SaveContext.
sync
JSONL sync operations.
validate
Input validation and intent detection for agent ergonomics.

Statics§

CSV_OUTPUT
Global CSV output flag (set when --format csv).
DRY_RUN
Global dry-run flag for --dry-run.
SILENT
Global silent mode flag for --silent output.

Functions§

csv_escape
Escape a value for CSV output (wrap in quotes if it contains commas, quotes, or newlines).
is_csv
Check if CSV output is requested.
is_dry_run
Check if dry-run mode is active.
is_silent
Check if silent mode is active.