summaryrefslogtreecommitdiffstats
path: root/src/repl/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/repl/mod.rs')
-rw-r--r--src/repl/mod.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs
index 2111c48..0100cb0 100644
--- a/src/repl/mod.rs
+++ b/src/repl/mod.rs
@@ -33,7 +33,7 @@ lazy_static! {
const MENU_NAME: &str = "completion_menu";
lazy_static! {
- static ref REPL_COMMANDS: [ReplCommand; 27] = [
+ static ref REPL_COMMANDS: [ReplCommand; 28] = [
ReplCommand::new(".help", "Show this help message", AssertState::pass()),
ReplCommand::new(".info", "View system info", AssertState::pass()),
ReplCommand::new(".model", "Change the current LLM", AssertState::pass()),
@@ -119,6 +119,11 @@ lazy_static! {
AssertState::True(StateFlags::AGENT)
),
ReplCommand::new(
+ ".variable",
+ "Set agent variable",
+ AssertState::True(StateFlags::AGENT)
+ ),
+ ReplCommand::new(
".exit agent",
"Leave the agent",
AssertState::True(StateFlags::AGENT)
@@ -293,6 +298,14 @@ Tips: use <tab> to autocomplete conversation starter text.
println!("{output}");
}
},
+ ".variable" => match args {
+ Some(args) => {
+ self.config.write().set_agent_variable(args)?;
+ }
+ _ => {
+ println!("Usage: .variable <key> <value>")
+ }
+ },
".save" => {
match args.map(|v| match v.split_once(' ') {
Some((subcmd, args)) => (subcmd, Some(args.trim())),