Skip to main content

claude_code_rust/
lib.rs

1// Claude Code Rust - A native Rust terminal interface for Claude Code
2// Copyright (C) 2025  Simon Peter Rothgang
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as
6// published by the Free Software Foundation, either version 3 of the
7// License, or (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12// GNU Affero General Public License for more details.
13//
14// You should have received a copy of the GNU Affero General Public License
15// along with this program.  If not, see <https://www.gnu.org/licenses/>.
16
17pub mod acp;
18pub mod app;
19pub mod perf;
20pub mod ui;
21
22use clap::Parser;
23
24#[derive(Parser, Debug)]
25#[command(name = "claude-rs", about = "Native Rust terminal for Claude Code")]
26#[allow(clippy::struct_excessive_bools)]
27pub struct Cli {
28    /// Override the model (sonnet, opus, haiku)
29    #[arg(long, short)]
30    pub model: Option<String>,
31
32    /// Resume a previous session by ID
33    #[arg(long)]
34    pub resume: Option<String>,
35
36    /// Auto-approve all tool calls (dangerous)
37    #[arg(long)]
38    pub yolo: bool,
39
40    /// Disable startup update checks.
41    #[arg(long)]
42    pub no_update_check: bool,
43
44    /// Working directory (defaults to cwd)
45    #[arg(long, short = 'C')]
46    pub dir: Option<std::path::PathBuf>,
47
48    /// Path to an ACP adapter binary (highest startup priority).
49    #[arg(long)]
50    pub adapter_bin: Option<std::path::PathBuf>,
51
52    /// Write tracing diagnostics to a file (disabled unless explicitly set).
53    #[arg(long, value_name = "PATH")]
54    pub log_file: Option<std::path::PathBuf>,
55
56    /// Tracing filter directives (example: `info,claude_code_rust::ui=trace`).
57    /// Falls back to `RUST_LOG` when omitted.
58    #[arg(long, value_name = "FILTER")]
59    pub log_filter: Option<String>,
60
61    /// Append to `--log-file` instead of truncating on startup.
62    #[arg(long)]
63    pub log_append: bool,
64
65    /// Write frame performance events to a file (requires `--features perf` build).
66    #[arg(long, value_name = "PATH")]
67    pub perf_log: Option<std::path::PathBuf>,
68
69    /// Append to `--perf-log` instead of truncating on startup.
70    #[arg(long)]
71    pub perf_append: bool,
72}