feat: add si command line interface (#37)
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

Reviewed-on: #37
This commit was merged in pull request #37.
This commit is contained in:
2026-11-30 00:34:44 +00:00
parent 6dfa3a2335
commit b7e1ca7c86
20 changed files with 1252 additions and 75 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ icons = [
[dependencies]
metadata = { path = "../crates/metadata" }
paths = { path = "../crates/paths" }
settings = { path = "../crates/settings" }
signed_app = { path = "../crates/signed_app" }
settings.workspace = true
signed_app.workspace = true
signed_state = { path = "../crates/signed_state" }
gpui.workspace = true
+9 -24
View File
@@ -3,6 +3,7 @@ use std::sync::Arc;
use gpui::*;
use gpui_platform::application;
use settings::SettingsStore;
use signed_app::AppRoot;
use ui::theme::{ActiveTheme as _, Theme};
actions!(signed, [Quit]);
@@ -44,43 +45,27 @@ fn main() {
.with_assets(AppAssets)
.with_http_client(Arc::new(reqwest_client::ReqwestClient::new()))
.run(move |cx| {
ui::init(cx);
cx.bind_keys([
KeyBinding::new("cmd-q", Quit, None),
KeyBinding::new("ctrl-q", Quit, None),
]);
cx.on_action(|_: &Quit, cx| cx.quit());
cx.set_app_identity("build.signed.signed", "Signed");
cx.set_app_identity(paths::APP_ID, paths::APP_NAME);
let store = cx.new(|_| SettingsStore::new(paths::settings_file()));
SettingsStore::set_global(store.clone(), cx);
ui::init(cx);
let settings = store.read(cx).settings().clone();
signed_app::AppRoot::apply_appearance_mode(settings.appearance, cx);
if let Err(error) = std::fs::create_dir_all(paths::nostr_dir()) {
tracing::warn!("failed to create nostr dir: {error}");
}
if let Err(error) = std::fs::create_dir_all(paths::repos_dir()) {
tracing::warn!("failed to create repos dir: {error}");
}
if let Err(error) = signed_state::init(
paths::nostr_dir(),
paths::repos_dir().to_path_buf(),
settings.local_repos.scan_paths.clone(),
cx,
) {
if let Err(error) = signed_state::init(cx) {
tracing::error!("failed to initialize application state: {error:#}");
cx.quit();
return;
}
metadata::init(cx);
let settings = SettingsStore::global(cx);
let appearance = settings.read(cx).settings().appearance;
AppRoot::apply_appearance_mode(appearance, cx);
let theme = cx.theme();
let bounds = Bounds::centered(None, size(px(1120.0), px(750.0)), cx);
@@ -113,7 +98,7 @@ fn main() {
})
.detach();
signed_app::AppRoot::mount(window, cx)
AppRoot::mount(window, cx)
}) {
tracing::error!("failed to open window: {error}");
cx.quit();