A local-first private AI assistant for everyday use. Runs on-device models with encrypted P2P sync, and supports sharing chats publicly on ATProto.
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #85 from tilesprivacy/tiles-command

feat: update CLI to add default tiles command

authored by

Anandu Pavanan and committed by
GitHub
b9944ad4 ef274d2e

+22 -9
+1
.gitignore
··· 5 5 *.profraw 6 6 tilekit/target 7 7 tiles/target 8 + .DS_Store
+21 -9
tiles/src/main.rs
··· 8 8 #[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")] 9 9 struct Cli { 10 10 #[command(subcommand)] 11 - command: Commands, 11 + command: Option<Commands>, 12 + 13 + #[command(flatten)] 14 + flags: RunFlags, 12 15 } 13 16 14 17 #[derive(Subcommand, Debug)] ··· 114 117 let cli = Cli::parse(); 115 118 let runtime = build_runtime(); 116 119 match cli.command { 117 - Commands::Run { 120 + None => { 121 + // Running tiles without subcommand - launch default model with flags 122 + let run_args = RunArgs { 123 + modelfile_path: None, 124 + relay_count: cli.flags.relay_count, 125 + memory: cli.flags.memory, 126 + }; 127 + commands::run(&runtime, run_args).await; 128 + } 129 + Some(Commands::Run { 118 130 modelfile_path, 119 131 flags, 120 - } => { 132 + }) => { 121 133 let run_args = RunArgs { 122 134 modelfile_path, 123 135 relay_count: flags.relay_count, ··· 125 137 }; 126 138 commands::run(&runtime, run_args).await; 127 139 } 128 - Commands::Health => { 140 + Some(Commands::Health) => { 129 141 commands::check_health().await; 130 142 } 131 - Commands::Server(server) => match server.command { 143 + Some(Commands::Server(server)) => match server.command { 132 144 Some(ServerCommands::Start) => commands::start_server(&runtime).await, 133 145 Some(ServerCommands::Stop) => commands::stop_server(&runtime).await, 134 146 _ => println!("Expected start or stop"), 135 147 }, 136 - Commands::Memory(memory) => match memory.command { 148 + Some(Commands::Memory(memory)) => match memory.command { 137 149 MemoryCommands::SetPath { path } => commands::set_memory(path.as_str()), 138 150 }, 139 - Commands::Optimize { 151 + Some(Commands::Optimize { 140 152 modelfile_path, 141 153 data, 142 154 model, 143 - } => { 155 + }) => { 144 156 let modelfile = commands::optimize(modelfile_path.clone(), data, model).await?; 145 157 std::fs::write(&modelfile_path, modelfile.to_string())?; 146 158 println!("Successfully updated {}", modelfile_path); 147 159 } 148 - Commands::Account(account_args) => { 160 + Some(Commands::Account(account_args)) => { 149 161 commands::run_account_commands(account_args)?; 150 162 } 151 163 }