feat: rebrand to Claw Code with ASCII art banner, claw binary, lobster prompt 🦞
This commit is contained in:
1
.claude/sessions/session-1775007846522.json
Normal file
1
.claude/sessions/session-1775007846522.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"messages":[{"blocks":[{"text":"Say hi in one sentence","type":"text"}],"role":"user"},{"blocks":[{"text":"Hi! I'm Claude, ready to help you with any software engineering tasks or questions you have.","type":"text"}],"role":"assistant","usage":{"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"input_tokens":11,"output_tokens":23}}],"version":1}
|
||||||
@@ -5,6 +5,10 @@ edition.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
publish.workspace = true
|
publish.workspace = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name = "claw"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
api = { path = "../api" }
|
api = { path = "../api" }
|
||||||
commands = { path = "../commands" }
|
commands = { path = "../commands" }
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ fn main() {
|
|||||||
eprintln!(
|
eprintln!(
|
||||||
"error: {error}
|
"error: {error}
|
||||||
|
|
||||||
Run `rusty-claude-cli --help` for usage."
|
Run `claw --help` for usage."
|
||||||
);
|
);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
@@ -878,7 +878,7 @@ fn run_repl(
|
|||||||
permission_mode: PermissionMode,
|
permission_mode: PermissionMode,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let mut cli = LiveCli::new(model, true, allowed_tools, permission_mode)?;
|
let mut cli = LiveCli::new(model, true, allowed_tools, permission_mode)?;
|
||||||
let mut editor = input::LineEditor::new("› ", slash_command_completion_candidates());
|
let mut editor = input::LineEditor::new("🦞 ", slash_command_completion_candidates());
|
||||||
println!("{}", cli.startup_banner());
|
println!("{}", cli.startup_banner());
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@@ -965,14 +965,26 @@ impl LiveCli {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn startup_banner(&self) -> String {
|
fn startup_banner(&self) -> String {
|
||||||
format!(
|
let cwd = env::current_dir().map_or_else(
|
||||||
"Rusty Claude CLI\n Model {}\n Permission mode {}\n Working directory {}\n Session {}\n\nType /help for commands. Shift+Enter or Ctrl+J inserts a newline.",
|
|
||||||
self.model,
|
|
||||||
self.permission_mode.as_str(),
|
|
||||||
env::current_dir().map_or_else(
|
|
||||||
|_| "<unknown>".to_string(),
|
|_| "<unknown>".to_string(),
|
||||||
|path| path.display().to_string(),
|
|path| path.display().to_string(),
|
||||||
),
|
);
|
||||||
|
format!(
|
||||||
|
"\x1b[38;5;196m\
|
||||||
|
██████╗██╗ █████╗ ██╗ ██╗\n\
|
||||||
|
██╔════╝██║ ██╔══██╗██║ ██║\n\
|
||||||
|
██║ ██║ ███████║██║ █╗ ██║\n\
|
||||||
|
██║ ██║ ██╔══██║██║███╗██║\n\
|
||||||
|
╚██████╗███████╗██║ ██║╚███╔███╔╝\n\
|
||||||
|
╚═════╝╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝\x1b[0m \x1b[38;5;208mCode\x1b[0m 🦞\n\n\
|
||||||
|
\x1b[2mModel\x1b[0m {}\n\
|
||||||
|
\x1b[2mPermissions\x1b[0m {}\n\
|
||||||
|
\x1b[2mDirectory\x1b[0m {}\n\
|
||||||
|
\x1b[2mSession\x1b[0m {}\n\n\
|
||||||
|
Type \x1b[1m/help\x1b[0m for commands · \x1b[2mShift+Enter\x1b[0m for newline",
|
||||||
|
self.model,
|
||||||
|
self.permission_mode.as_str(),
|
||||||
|
cwd,
|
||||||
self.session.id,
|
self.session.id,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -981,7 +993,7 @@ impl LiveCli {
|
|||||||
let mut spinner = Spinner::new();
|
let mut spinner = Spinner::new();
|
||||||
let mut stdout = io::stdout();
|
let mut stdout = io::stdout();
|
||||||
spinner.tick(
|
spinner.tick(
|
||||||
"Waiting for Claude",
|
"🦀 Thinking...",
|
||||||
TerminalRenderer::new().color_theme(),
|
TerminalRenderer::new().color_theme(),
|
||||||
&mut stdout,
|
&mut stdout,
|
||||||
)?;
|
)?;
|
||||||
@@ -990,7 +1002,7 @@ impl LiveCli {
|
|||||||
match result {
|
match result {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
spinner.finish(
|
spinner.finish(
|
||||||
"Claude response complete",
|
"✨ Done",
|
||||||
TerminalRenderer::new().color_theme(),
|
TerminalRenderer::new().color_theme(),
|
||||||
&mut stdout,
|
&mut stdout,
|
||||||
)?;
|
)?;
|
||||||
@@ -1000,7 +1012,7 @@ impl LiveCli {
|
|||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
spinner.fail(
|
spinner.fail(
|
||||||
"Claude request failed",
|
"❌ Request failed",
|
||||||
TerminalRenderer::new().color_theme(),
|
TerminalRenderer::new().color_theme(),
|
||||||
&mut stdout,
|
&mut stdout,
|
||||||
)?;
|
)?;
|
||||||
@@ -1742,7 +1754,7 @@ fn render_version_report() -> String {
|
|||||||
let git_sha = GIT_SHA.unwrap_or("unknown");
|
let git_sha = GIT_SHA.unwrap_or("unknown");
|
||||||
let target = BUILD_TARGET.unwrap_or("unknown");
|
let target = BUILD_TARGET.unwrap_or("unknown");
|
||||||
format!(
|
format!(
|
||||||
"Version\n Version {VERSION}\n Git SHA {git_sha}\n Target {target}\n Build date {DEFAULT_DATE}"
|
"Claw Code\n Version {VERSION}\n Git SHA {git_sha}\n Target {target}\n Build date {DEFAULT_DATE}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2267,41 +2279,41 @@ fn convert_messages(messages: &[ConversationMessage]) -> Vec<InputMessage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn print_help_to(out: &mut impl Write) -> io::Result<()> {
|
fn print_help_to(out: &mut impl Write) -> io::Result<()> {
|
||||||
writeln!(out, "rusty-claude-cli v{VERSION}")?;
|
writeln!(out, "claw v{VERSION}")?;
|
||||||
writeln!(out)?;
|
writeln!(out)?;
|
||||||
writeln!(out, "Usage:")?;
|
writeln!(out, "Usage:")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli [--model MODEL] [--allowedTools TOOL[,TOOL...]]"
|
" claw [--model MODEL] [--allowedTools TOOL[,TOOL...]]"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " Start the interactive REPL")?;
|
writeln!(out, " Start the interactive REPL")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli [--model MODEL] [--output-format text|json] prompt TEXT"
|
" claw [--model MODEL] [--output-format text|json] prompt TEXT"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " Send one prompt and exit")?;
|
writeln!(out, " Send one prompt and exit")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli [--model MODEL] [--output-format text|json] TEXT"
|
" claw [--model MODEL] [--output-format text|json] TEXT"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " Shorthand non-interactive prompt mode")?;
|
writeln!(out, " Shorthand non-interactive prompt mode")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli --resume SESSION.json [/status] [/compact] [...]"
|
" claw --resume SESSION.json [/status] [/compact] [...]"
|
||||||
)?;
|
)?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" Inspect or maintain a saved session without entering the REPL"
|
" Inspect or maintain a saved session without entering the REPL"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " rusty-claude-cli dump-manifests")?;
|
writeln!(out, " claw dump-manifests")?;
|
||||||
writeln!(out, " rusty-claude-cli bootstrap-plan")?;
|
writeln!(out, " claw bootstrap-plan")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli system-prompt [--cwd PATH] [--date YYYY-MM-DD]"
|
" claw system-prompt [--cwd PATH] [--date YYYY-MM-DD]"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " rusty-claude-cli login")?;
|
writeln!(out, " claw login")?;
|
||||||
writeln!(out, " rusty-claude-cli logout")?;
|
writeln!(out, " claw logout")?;
|
||||||
writeln!(out, " rusty-claude-cli init")?;
|
writeln!(out, " claw init")?;
|
||||||
writeln!(out)?;
|
writeln!(out)?;
|
||||||
writeln!(out, "Flags:")?;
|
writeln!(out, "Flags:")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
@@ -2337,22 +2349,22 @@ fn print_help_to(out: &mut impl Write) -> io::Result<()> {
|
|||||||
writeln!(out, "Examples:")?;
|
writeln!(out, "Examples:")?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli --model claude-opus \"summarize this repo\""
|
" claw --model claude-opus \"summarize this repo\""
|
||||||
)?;
|
)?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli --output-format json prompt \"explain src/main.rs\""
|
" claw --output-format json prompt \"explain src/main.rs\""
|
||||||
)?;
|
)?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli --allowedTools read,glob \"summarize Cargo.toml\""
|
" claw --allowedTools read,glob \"summarize Cargo.toml\""
|
||||||
)?;
|
)?;
|
||||||
writeln!(
|
writeln!(
|
||||||
out,
|
out,
|
||||||
" rusty-claude-cli --resume session.json /status /diff /export notes.txt"
|
" claw --resume session.json /status /diff /export notes.txt"
|
||||||
)?;
|
)?;
|
||||||
writeln!(out, " rusty-claude-cli login")?;
|
writeln!(out, " claw login")?;
|
||||||
writeln!(out, " rusty-claude-cli init")?;
|
writeln!(out, " claw init")?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2670,7 +2682,7 @@ mod tests {
|
|||||||
let mut help = Vec::new();
|
let mut help = Vec::new();
|
||||||
print_help_to(&mut help).expect("help should render");
|
print_help_to(&mut help).expect("help should render");
|
||||||
let help = String::from_utf8(help).expect("help should be utf8");
|
let help = String::from_utf8(help).expect("help should be utf8");
|
||||||
assert!(help.contains("rusty-claude-cli init"));
|
assert!(help.contains("claw init"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user