toak-rs 6.0.3

A high-performance library and CLI tool for tokenizing git repositories, cleaning code, and generating embeddings
Documentation
//! Command line arguments backing the `toak` binary.
use clap::{Parser, Subcommand};
use std::path::PathBuf;

#[derive(Parser, Debug)]
#[command(
  name = "toak",
  about = "A CLI tool for tokenizing git repositories and performing semantic search",
  version
)]
pub struct Args {
  #[command(subcommand)]
  pub command: Commands,
}

#[derive(Subcommand, Debug)]
pub enum Commands {
  /// Print version information
  Version,
  /// Generate markdown documentation
  Generate {
    /// Project directory to process
    #[arg(long, short = 'd')]
    dir: Option<PathBuf>,

    /// Output file path for the generated markdown
    #[arg(long, short = 'o')]
    output_file_path: Option<PathBuf>,

    /// Disable verbose output
    #[arg(long)]
    quiet: bool,

    /// Preset prompt template to use
    #[arg(long, short = 'p')]
    prompt: Option<String>,

    /// Also generate the embeddings database
    #[arg(long)]
    embeddings: bool,
  },
  /// Search the embeddings database using semantic similarity
  #[cfg(feature = "embeddings")]
  Search {
    /// Query string to search for
    query: String,

    /// Path to the embeddings.json file
    #[arg(long, short = 'f', default_value = "embeddings.json")]
    embeddings_file: PathBuf,

    /// Number of top results to return
    #[arg(long, short = 'n', default_value = "5")]
    top_n: usize,

    /// Show full content of results (not just preview)
    #[arg(long)]
    full: bool,
  },
}