Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ stack_export_prod/
*.profraw
tilekit/target
tiles/target
.DS_Store
30 changes: 21 additions & 9 deletions tiles/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ mod commands;
#[command(version, about = "Your private and secure AI assistant for everyday use.", long_about = None, after_help = "Documentation: https://tiles.run/book\nReport issues: https://github.com/tilesprivacy/tiles/issues")]
struct Cli {
#[command(subcommand)]
command: Commands,
command: Option<Commands>,

#[command(flatten)]
flags: RunFlags,
Comment thread
madclaws marked this conversation as resolved.
}

#[derive(Subcommand, Debug)]
Expand Down Expand Up @@ -114,38 +117,47 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
let cli = Cli::parse();
let runtime = build_runtime();
match cli.command {
Commands::Run {
None => {
// Running tiles without subcommand - launch default model with flags
let run_args = RunArgs {
modelfile_path: None,
relay_count: cli.flags.relay_count,
memory: cli.flags.memory,
};
commands::run(&runtime, run_args).await;
}
Comment on lines +120 to +128
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

None branch runs the REPL directly — diverges from the stated launcher/overview goal

The PR discussion describes showing a concise overview ("launcher") screen when tiles is invoked with no arguments, similar to Ollama's CLI. The implementation instead drops directly into the default model REPL (commands::run), which is the UX concern madclaws raised. If this branch is revisited in the follow-up TUI PR, consider emitting a structured overview before entering interactive mode, or routing to a dedicated launcher command.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tiles/src/main.rs` around lines 120 - 128, The None branch currently jumps
straight into the default model REPL by constructing RunArgs and calling
commands::run(&runtime, run_args); instead, update this branch to present the
concise launcher/overview UI first (or route to a dedicated launcher command)
before entering interactive mode: either call a new or existing launcher
function (e.g., commands::launcher(&runtime, launcher_args)) or emit a
structured overview (title, available models, flags summary) and only after user
selection call commands::run with the constructed RunArgs; modify the None arm
to invoke that launcher/overview flow rather than directly calling
commands::run.

Some(Commands::Run {
modelfile_path,
flags,
} => {
}) => {
let run_args = RunArgs {
modelfile_path,
relay_count: flags.relay_count,
memory: flags.memory,
};
commands::run(&runtime, run_args).await;
}
Commands::Health => {
Some(Commands::Health) => {
commands::check_health().await;
}
Commands::Server(server) => match server.command {
Some(Commands::Server(server)) => match server.command {
Some(ServerCommands::Start) => commands::start_server(&runtime).await,
Some(ServerCommands::Stop) => commands::stop_server(&runtime).await,
_ => println!("Expected start or stop"),
},
Commands::Memory(memory) => match memory.command {
Some(Commands::Memory(memory)) => match memory.command {
MemoryCommands::SetPath { path } => commands::set_memory(path.as_str()),
},
Commands::Optimize {
Some(Commands::Optimize {
modelfile_path,
data,
model,
} => {
}) => {
let modelfile = commands::optimize(modelfile_path.clone(), data, model).await?;
std::fs::write(&modelfile_path, modelfile.to_string())?;
println!("Successfully updated {}", modelfile_path);
}
Commands::Account(account_args) => {
Some(Commands::Account(account_args)) => {
commands::run_account_commands(account_args)?;
}
}
Expand Down