Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

refactor(cli): stop bundling the jan agent CLI with the app

Akarshan Biswas872218a37c57
diff --git a/Makefile b/Makefile
index 7e57633f9..7d2eb9d28 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,6 @@ install-ios-rust-targets:
dev: install-and-build
yarn download:bin
$(MAKE) build-mlx-server-if-exists
- $(MAKE) build-cli-dev
$(MAKE) build-engine-dev-if-possible
yarn dev
@@ -174,7 +173,7 @@ test: test-prepare install-rust-targets
# sh.exe is on PATH, so it takes the script.
stub-resources:
ifeq ($(RECIPE_SHELL_IS_CMD),yes)
- -powershell -Command "New-Item -ItemType Directory -Force -Path src-tauri/resources/bin | Out-Null; foreach ($$f in @('jan-cli.exe','jan-llama-worker.exe','ggml-base.dll')) { $$p = Join-Path 'src-tauri/resources/bin' $$f; if (-not (Test-Path $$p)) { New-Item -ItemType File -Path $$p | Out-Null } }"
+ -powershell -Command "New-Item -ItemType Directory -Force -Path src-tauri/resources/bin | Out-Null; foreach ($$f in @('jan-llama-worker.exe','ggml-base.dll')) { $$p = Join-Path 'src-tauri/resources/bin' $$f; if (-not (Test-Path $$p)) { New-Item -ItemType File -Path $$p | Out-Null } }"
else
@./scripts/stub-tauri-resources.sh
endif
@@ -182,8 +181,8 @@ endif
test-ci: test-prepare
$(MAKE) test-rust
-# Cheap compile guard for the CLI feature set, covering what test-ci no longer
-# builds. `make build` still builds the real binary on every platform.
+# Cheap compile guard for the CLI feature set. The `jan` CLI is no longer
+# bundled with the app; `make test` still builds the real binary via build-cli.
check-cli:
cd src-tauri && cargo check --locked --no-default-features --features cli --bin jan
@@ -524,16 +523,6 @@ else
bash src-tauri/build-utils/stage-engine.sh debug
endif
-# Debug build for local dev (faster, native arch only)
-build-cli-dev:
- $(call MKDIR,'src-tauri/resources/bin')
- cd src-tauri && cargo build --no-default-features --features cli --bin jan
-ifeq ($(DETECTED_OS),Windows)
- copy src-tauri\target\debug\jan.exe src-tauri\resources\bin\jan.exe
-else
- install -m755 src-tauri/target/debug/jan src-tauri/resources/bin/jan
-endif
-
# Build the Jan agent CLI (the `jan` binary with the `cli` feature)
# The compiled binary lives at two locations after build:
# 1. src-tauri/resources/bin/jan[.exe] (bundled copy)
diff --git a/package.json b/package.json
index 2a9fa071b..9b5b4890e 100644
--- a/package.json
+++ b/package.json
@@ -36,10 +36,9 @@
"download:lib": "node ./scripts/download-lib.mjs",
"download:bin": "node ./scripts/download-bin.mjs",
"build:mlx-server": "make build-mlx-server",
- "build:cli": "make build-cli",
- "build:tauri:win32": "yarn download:bin && yarn build:cli && yarn tauri build",
- "build:tauri:linux": "yarn download:bin && yarn build:cli && NO_STRIP=1 ./src-tauri/build-utils/shim-linuxdeploy.sh yarn tauri build && ./src-tauri/build-utils/buildAppImage.sh",
- "build:tauri:darwin": "yarn download:bin && yarn build:mlx-server && yarn build:cli && yarn tauri build --target universal-apple-darwin",
+ "build:tauri:win32": "yarn download:bin && yarn tauri build",
+ "build:tauri:linux": "yarn download:bin && NO_STRIP=1 ./src-tauri/build-utils/shim-linuxdeploy.sh yarn tauri build && ./src-tauri/build-utils/buildAppImage.sh",
+ "build:tauri:darwin": "yarn download:bin && yarn build:mlx-server && yarn tauri build --target universal-apple-darwin",
"build:tauri": "yarn build:icon && yarn copy:assets:tauri && run-script-os",
"build:tauri:plugin:api": "cd src-tauri/plugins && yarn install && cd ../.. && run-script-os",
"build:tauri:plugin:api:darwin": "cd src-tauri/plugins && yarn workspaces foreach -Apt run build",
diff --git a/scripts/stub-tauri-resources.sh b/scripts/stub-tauri-resources.sh
index 31bab1d33..181a37c9c 100755
--- a/scripts/stub-tauri-resources.sh
+++ b/scripts/stub-tauri-resources.sh
@@ -15,9 +15,7 @@ for bin in uv bun; do
done
# The engine worker and the ggml runtime beside it. `libggml*` is a glob in the
# bundle config, and a glob that matches nothing is an error (GlobPathNotFound),
-# not an empty set -- so one stub library is required, not optional. The CLI is
-# `jan-cli` on some branches and `jan` on others; the Tauri config only asks for
-# one, and stubbing the other costs nothing.
+# not an empty set -- so one stub library is required, not optional.
case "$(uname -s)" in
Darwin)
EXE=""; LIB="libggml-base.dylib"
@@ -28,7 +26,7 @@ case "$(uname -s)" in
MINGW* | MSYS* | CYGWIN*) EXE=".exe"; LIB="ggml-base.dll" ;;
*) EXE=""; LIB="libggml-base.so" ;;
esac
-for bin in jan jan-cli jan-llama-worker; do
+for bin in jan-llama-worker; do
[ -f "src-tauri/resources/bin/${bin}${EXE}" ] || touch "src-tauri/resources/bin/${bin}${EXE}"
done
ls src-tauri/resources/bin/*ggml*."${LIB##*.}"* >/dev/null 2>&1 || touch "src-tauri/resources/bin/$LIB"
diff --git a/src-tauri/src/core/setup.rs b/src-tauri/src/core/setup.rs
index 841d44c83..627095d2e 100644
--- a/src-tauri/src/core/setup.rs
+++ b/src-tauri/src/core/setup.rs
@@ -155,51 +155,6 @@ fn remove_exa_server(app_handle: tauri::AppHandle) -> Result<(), String> {
Ok(())
}
-/// Install/update the bundled `jan` CLI binary.
-///
-/// - `version_changed`: pass `true` whenever the app version has changed (i.e. after an update).
-/// When `true` the binary is always overwritten so the CLI stays in sync with the new app.
-/// When `false` only installs if the binary is not yet present on PATH.
-///
-/// Runs in a background task — never blocks startup.
-/// Errors are logged as warnings and never prevent the app from starting.
-pub fn setup_jan_cli<R: Runtime>(app_handle: tauri::AppHandle<R>, version_changed: bool) {
- tauri::async_runtime::spawn(async move {
- // On a normal launch where the version hasn't changed, skip reinstall if already on PATH.
- if !version_changed {
- let which_cmd = if cfg!(windows) { "where" } else { "which" };
- let mut cmd = std::process::Command::new(which_cmd);
- cmd.arg("jan");
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
- if cmd.output().map(|o| o.status.success()).unwrap_or(false) {
- log::debug!("jan CLI already on PATH — skipping reinstall");
- return;
- }
- }
-
- match crate::core::system::commands::install_jan_cli_sync(&app_handle) {
- Ok(status) => {
- log::info!(
- "jan CLI {} to {}",
- if version_changed {
- "updated"
- } else {
- "installed"
- },
- status.path.as_deref().unwrap_or("<unknown>")
- );
- }
- Err(e) => {
- log::warn!("jan CLI auto-install skipped: {e}");
- }
- }
- });
-}
-
/// Resolve when the frontend emits `app-ready`, or after `timeout` (so a window
/// that never signals still proceeds).
async fn wait_for_app_ready<R: Runtime>(app: &AppHandle<R>, timeout: Duration) {
diff --git a/src-tauri/src/core/system/commands.rs b/src-tauri/src/core/system/commands.rs
index aeb66d490..0a4482cd1 100644
--- a/src-tauri/src/core/system/commands.rs
+++ b/src-tauri/src/core/system/commands.rs
@@ -567,181 +567,6 @@ fn write_claude_code_env_vars(
}
}
-#[derive(serde::Serialize)]
-pub struct CliInstallStatus {
- pub installed: bool,
- pub path: Option<String>,
-}
-
-/// Check if the `jan` CLI binary is accessible on PATH, or — failing that —
-/// at one of the known install destinations.
-///
-/// `which`/`where` only sees what the Tauri process's PATH sees. Linux GUI
-/// launches typically inherit a minimal PATH (no `~/.local/bin`), and on
-/// Windows the registry PATH update from `add_to_path_windows` doesn't apply
-/// to the already-running process. Without the fallback probe, a successful
-/// install reports `installed: false` after the next remount of Settings.
-#[tauri::command]
-pub async fn check_jan_cli_installed() -> CliInstallStatus {
- let which_cmd = if cfg!(windows) { "where" } else { "which" };
- let mut cmd = std::process::Command::new(which_cmd);
- cmd.arg("jan");
-
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
-
- let path_from_which = match tokio::task::spawn_blocking(move || cmd.output()).await {
- Ok(Ok(out)) if out.status.success() => {
- let raw = String::from_utf8_lossy(&out.stdout);
- #[cfg(windows)]
- let path = {
- raw.lines()
- .map(str::trim)
- .filter(|p| !p.is_empty() && !p.to_ascii_lowercase().contains("\\target\\"))
- .next()
- .map(str::to_string)
- .or_else(|| {
- raw.lines()
- .map(str::trim)
- .find(|p| !p.is_empty())
- .map(str::to_string)
- })
- };
- #[cfg(not(windows))]
- let path = {
- let trimmed = raw.trim();
- if trimmed.is_empty() {
- None
- } else {
- Some(trimmed.to_string())
- }
- };
- path
- }
- _ => None,
- };
-
- if let Some(p) = path_from_which {
- return CliInstallStatus {
- installed: true,
- path: Some(p),
- };
- }
-
- // Fall back to probing the destinations `install_jan_cli_sync` writes to.
- for candidate in jan_cli_install_candidates() {
- if candidate.exists() {
- return CliInstallStatus {
- installed: true,
- path: Some(candidate.to_string_lossy().into_owned()),
- };
- }
- }
-
- CliInstallStatus {
- installed: false,
- path: None,
- }
-}
-
-/// Paths where `install_jan_cli_sync` may have placed the `jan` binary.
-fn jan_cli_install_candidates() -> Vec<PathBuf> {
- let bin = if cfg!(windows) { "jan.exe" } else { "jan" };
- let mut out: Vec<PathBuf> = Vec::new();
-
- #[cfg(unix)]
- {
- out.push(PathBuf::from("/usr/local/bin").join(bin));
- if let Ok(home) = std::env::var("HOME") {
- out.push(PathBuf::from(home).join(".local").join("bin").join(bin));
- }
- }
- #[cfg(windows)]
- {
- if let Ok(dir) = jan_cli_bin_dir_windows() {
- out.push(dir.join(bin));
- }
- }
- out
-}
-
-/// Core install logic — synchronous, no Tauri command overhead.
-pub fn install_jan_cli_sync<R: Runtime>(
- app_handle: &AppHandle<R>,
-) -> Result<CliInstallStatus, String> {
- let bin_name = if cfg!(windows) { "jan.exe" } else { "jan" };
- let resource_bin_dir = app_handle
- .path()
- .resource_dir()
- .map_err(|e| e.to_string())?
- .join("resources/bin");
- let bundled = resource_bin_dir.join(bin_name);
-
- if !bundled.exists() {
- return Err("Jan CLI binary not bundled with this version of Jan.".to_string());
- }
-
- #[cfg(windows)]
- {
- add_to_path_windows(&resource_bin_dir)?;
- return Ok(CliInstallStatus {
- installed: true,
- path: Some(bundled.to_string_lossy().into_owned()),
- });
- }
-
- #[cfg(unix)]
- {
- let install_dir = jan_cli_install_dir()?;
- std::fs::create_dir_all(&install_dir).map_err(|e| e.to_string())?;
- let dest = install_dir.join("jan");
-
- std::fs::copy(&bundled, &dest)
- .map_err(|e| format!("Failed to copy jan to {}: {}", dest.display(), e))?;
-
- use std::os::unix::fs::PermissionsExt;
- std::fs::set_permissions(&dest, std::fs::Permissions::from_mode(0o755))
- .map_err(|e| e.to_string())?;
-
- Ok(CliInstallStatus {
- installed: true,
- path: Some(dest.to_string_lossy().into_owned()),
- })
- }
-}
-
-/// Copy the bundled `jan` binary to the system PATH (Tauri command wrapper).
-#[tauri::command]
-pub async fn install_jan_cli<R: Runtime>(
- app_handle: AppHandle<R>,
-) -> Result<CliInstallStatus, String> {
- install_jan_cli_sync(&app_handle)
-}
-
-/// Remove the installed `jan` CLI binary.
-#[tauri::command]
-pub fn uninstall_jan_cli() -> Result<(), String> {
- #[cfg(windows)]
- {
- let bin_dir = jan_cli_bin_dir_windows()?;
- remove_from_path_windows(&bin_dir)?;
- return Ok(());
- }
-
- #[cfg(unix)]
- {
- let dest = jan_cli_install_dir()?.join("jan");
- if dest.exists() {
- std::fs::remove_file(&dest)
- .map_err(|e| format!("Failed to remove Jan CLI from {}: {}", dest.display(), e))?;
- }
- Ok(())
- }
-}
-
/// Build the cleaned shell-file content with all Jan CC env vars stripped out.
fn build_cleaned_env_content(env_file_path: &str) -> String {
let existing_content = std::fs::read_to_string(env_file_path).unwrap_or_default();
@@ -847,185 +672,6 @@ pub fn clear_claude_code_env() -> Result<(), String> {
}
}
-/// Determine the best writable directory for the Jan CLI install (Unix only).
-#[cfg(unix)]
-fn jan_cli_install_dir() -> Result<PathBuf, String> {
- let usr_local_bin = PathBuf::from("/usr/local/bin");
- if usr_local_bin.exists() {
- let probe = usr_local_bin.join(".jan_write_probe");
- if std::fs::write(&probe, b"").is_ok() {
- let _ = std::fs::remove_file(&probe);
- return Ok(usr_local_bin);
- }
- }
- let home = std::env::var("HOME").map_err(|_| "Cannot determine home directory".to_string())?;
- Ok(PathBuf::from(home).join(".local").join("bin"))
-}
-
-/// Return the directory containing the bundled CLI binary on Windows.
-#[cfg(windows)]
-fn jan_cli_bin_dir_windows() -> Result<PathBuf, String> {
- let local_app_data =
- std::env::var("LOCALAPPDATA").map_err(|_| "Cannot determine LOCALAPPDATA".to_string())?;
- Ok(PathBuf::from(local_app_data)
- .join("Programs")
- .join("Jan")
- .join("resources")
- .join("bin"))
-}
-
-/// Add a directory to the Windows user PATH.
-#[cfg(windows)]
-fn add_to_path_windows(install_dir: &PathBuf) -> Result<(), String> {
- use std::process::Command;
-
- let install_dir_str = install_dir.to_string_lossy().to_string();
-
- let mut cmd = Command::new("powershell");
- cmd.args([
- "-NoProfile",
- "-Command",
- "[Environment]::GetEnvironmentVariable('Path', 'User')",
- ]);
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
- let read_output = cmd
- .output()
- .map_err(|e| format!("Failed to read user PATH: {}", e))?;
-
- let existing_user_path = String::from_utf8_lossy(&read_output.stdout)
- .trim()
- .to_string();
-
- // Remove stale old-style PATH entry (..\\Programs\\Jan without \\resources\\bin)
- // left by previous versions that placed jan.exe next to the GUI binary.
- let old_jan_dir = install_dir
- .parent()
- .and_then(|p| p.parent())
- .map(|p| p.to_string_lossy().to_string());
-
- let parts: Vec<&str> = existing_user_path
- .split(';')
- .filter(|p| !p.is_empty())
- .filter(|p| {
- if let Some(ref old) = old_jan_dir {
- !p.eq_ignore_ascii_case(old)
- } else {
- true
- }
- })
- .collect();
-
- if parts
- .iter()
- .any(|p| p.eq_ignore_ascii_case(&install_dir_str))
- {
- return Ok(());
- }
-
- let mut new_parts = vec![install_dir_str.as_str()];
- new_parts.extend(parts);
- let new_path = new_parts.join(";");
-
- let mut cmd_write = Command::new("powershell");
- cmd_write.args([
- "-NoProfile",
- "-Command",
- &format!(
- "[Environment]::SetEnvironmentVariable('Path', '{}', 'User')",
- new_path.replace('\'', "''")
- ),
- ]);
-
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd_write.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
-
- let write_output = cmd_write
- .output()
- .map_err(|e| format!("Failed to update user PATH: {}", e))?;
-
- if !write_output.status.success() {
- return Err(format!(
- "Failed to update PATH: {}",
- String::from_utf8_lossy(&write_output.stderr)
- ));
- }
-
- log::info!("Added {} to Windows user PATH", install_dir_str);
- Ok(())
-}
-
-/// Remove a directory from the Windows user PATH.
-#[cfg(windows)]
-fn remove_from_path_windows(dir: &PathBuf) -> Result<(), String> {
- use std::process::Command;
-
- let dir_str = dir.to_string_lossy().to_string();
-
- let mut cmd = Command::new("powershell");
- cmd.args([
- "-NoProfile",
- "-Command",
- "[Environment]::GetEnvironmentVariable('Path', 'User')",
- ]);
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
- let read_output = cmd
- .output()
- .map_err(|e| format!("Failed to read user PATH: {}", e))?;
-
- let existing_user_path = String::from_utf8_lossy(&read_output.stdout)
- .trim()
- .to_string();
-
- let new_path: String = existing_user_path
- .split(';')
- .filter(|p| !p.is_empty() && !p.eq_ignore_ascii_case(&dir_str))
- .collect::<Vec<_>>()
- .join(";");
-
- if new_path.len() != existing_user_path.len() {
- let mut cmd_write = Command::new("powershell");
- cmd_write.args([
- "-NoProfile",
- "-Command",
- &format!(
- "[Environment]::SetEnvironmentVariable('Path', '{}', 'User')",
- new_path.replace('\'', "''")
- ),
- ]);
-
- #[cfg(windows)]
- {
- use std::os::windows::process::CommandExt;
- cmd_write.creation_flags(0x08000000); // CREATE_NO_WINDOW
- }
-
- let write_output = cmd_write
- .output()
- .map_err(|e| format!("Failed to update user PATH: {}", e))?;
-
- if !write_output.status.success() {
- return Err(format!(
- "Failed to update PATH: {}",
- String::from_utf8_lossy(&write_output.stderr)
- ));
- }
-
- log::info!("Removed {} from Windows user PATH", dir_str);
- }
- Ok(())
-}
-
#[cfg(test)]
mod tests {
use super::*;
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index ec9037151..f2cb7c1a9 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -75,9 +75,6 @@ macro_rules! invoke_commands_with_extras {
core::system::commands::read_logs,
core::system::commands::is_library_available,
core::system::commands::launch_claude_code_with_config,
- core::system::commands::check_jan_cli_installed,
- core::system::commands::install_jan_cli,
- core::system::commands::uninstall_jan_cli,
core::system::commands::clear_claude_code_env,
// Server commands
core::server::commands::start_server,
@@ -355,10 +352,6 @@ pub fn run() {
.handle()
.store(store_path)
.expect("Store not initialized");
- let stored_version = store
- .get("version")
- .and_then(|v| v.as_str().map(String::from))
- .unwrap_or_default();
let app_version = app.config().version.clone().unwrap_or_default();
// Migrate MCP servers
@@ -395,8 +388,6 @@ pub fn run() {
}
setup_mcp(app);
- #[cfg(desktop)]
- setup::setup_jan_cli(app.handle().clone(), stored_version != app_version);
setup::setup_theme_listener(app)?;
Ok(())
})
diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json
index 201dfecf1..b79bafdef 100644
--- a/src-tauri/tauri.linux.conf.json
+++ b/src-tauri/tauri.linux.conf.json
@@ -25,7 +25,6 @@
],
"resources": [
"resources/LICENSE",
- "resources/bin/jan",
"resources/bin/jan-llama-worker",
"resources/bin/lib*.so*"
],
diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json
index 35e239361..07b875dbd 100644
--- a/src-tauri/tauri.macos.conf.json
+++ b/src-tauri/tauri.macos.conf.json
@@ -43,7 +43,6 @@
"resources/LICENSE",
"resources/bin/mlx-server",
"resources/bin/mlx-swift_Cmlx.bundle",
- "resources/bin/jan",
"resources/bin/jan-llama-worker",
"resources/bin/libggml*"
],
diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json
index 22eda38fc..579e79a0c 100644
--- a/src-tauri/tauri.windows.conf.json
+++ b/src-tauri/tauri.windows.conf.json
@@ -41,7 +41,6 @@
],
"resources": [
"resources/LICENSE",
- "resources/bin/jan.exe",
"resources/bin/jan-llama-worker.exe",
"resources/bin/*.dll"
],
diff --git a/web-app/src/locales/en/settings.json b/web-app/src/locales/en/settings.json
index 99070cff2..e43b32bf7 100644
--- a/web-app/src/locales/en/settings.json
+++ b/web-app/src/locales/en/settings.json
@@ -317,6 +317,9 @@
"reset": "Reset",
"huggingfaceToken": "HuggingFace Token",
"huggingfaceTokenDesc": "Your HuggingFace API token for accessing models.",
+ "janCli": "Jan CLI",
+ "janCliDesc": "Run Jan's agent from your terminal. Follow the guide to install and get started.",
+ "janCliSetupGuide": "Setup guide",
"resources": "Resources",
"documentation": "Documentation",
"documentationDesc": "Learn how to use Jan and explore its features.",
diff --git a/web-app/src/routes/settings/general.tsx b/web-app/src/routes/settings/general.tsx
index 62399d56b..9014b780f 100644
--- a/web-app/src/routes/settings/general.tsx
+++ b/web-app/src/routes/settings/general.tsx
@@ -1,5 +1,4 @@
import { createFileRoute } from '@tanstack/react-router'
-import { invoke } from '@tauri-apps/api/core'
import { route } from '@/constants/routes'
import SettingsMenu from '@/containers/SettingsMenu'
import HeaderPage from '@/containers/HeaderPage'
@@ -66,9 +65,6 @@ function General() {
const [isDialogOpen, setIsDialogOpen] = useState(false)
const [isCheckingUpdate, setIsCheckingUpdate] = useState(false)
const [isValidatingToken, setIsValidatingToken] = useState(false)
- const [cliInstalled, setCliInstalled] = useState<boolean | null>(null)
- const [cliPath, setCliPath] = useState<string | null>(null)
- const [isCliLoading, setIsCliLoading] = useState(false)
useEffect(() => {
const fetchDataFolder = async () => {
@@ -79,41 +75,6 @@ function General() {
fetchDataFolder()
}, [serviceHub])
- useEffect(() => {
- if (!IS_TAURI) return
- invoke<{ installed: boolean; path: string | null }>('check_jan_cli_installed')
- .then((s) => { setCliInstalled(s.installed); setCliPath(s.path) })
- .catch(() => setCliInstalled(false))
- }, [])
-
- const handleInstallCli = async () => {
- setIsCliLoading(true)
- try {
- const s = await invoke<{ installed: boolean; path: string | null }>('install_jan_cli')
- setCliInstalled(s.installed)
- setCliPath(s.path)
- toast.success(`Jan CLI installed to ${s.path}`)
- } catch (e) {
- toast.error('Install failed', { description: String(e) })
- } finally {
- setIsCliLoading(false)
- }
- }
-
- const handleUninstallCli = async () => {
- setIsCliLoading(true)
- try {
- await invoke('uninstall_jan_cli')
- setCliInstalled(false)
- setCliPath(null)
- toast.success('Jan CLI uninstalled')
- } catch (e) {
- toast.error('Uninstall failed', { description: String(e) })
- } finally {
- setIsCliLoading(false)
- }
- }
-
const resetApp = async (options: FactoryResetOptions) => {
if (isRootDir(janDataFolder ?? '/')) {
toast.error(t('settings:general.couldNotResetRootDirectory'))
@@ -408,32 +369,19 @@ function General() {
<Card title="Advanced">
{IS_TAURI && (
<CardItem
- title="Jan CLI"
- description={
- cliInstalled && cliPath
- ? `Installed at ${cliPath} — use jan from your terminal to serve models.`
- : 'Use jan from your terminal to serve models without opening the app.'
- }
+ title={t('settings:general.janCli')}
+ description={t('settings:general.janCliDesc')}
actions={
- cliInstalled ? (
- <Button
- variant="outline"
- size="sm"
- onClick={handleUninstallCli}
- disabled={isCliLoading || cliInstalled === null}
- >
- {isCliLoading ? 'Uninstalling…' : 'Uninstall'}
- </Button>
- ) : (
- <Button
- variant="secondary"
- size="sm"
- onClick={handleInstallCli}
- disabled={isCliLoading || cliInstalled === null}
- >
- {isCliLoading ? 'Installing…' : 'Install'}
- </Button>
- )
+ <a
+ href="https://www.jan.ai/docs/agent/quickstart"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <div className="flex items-center gap-1">
+ <span>{t('settings:general.janCliSetupGuide')}</span>
+ <IconExternalLink size={14} />
+ </div>
+ </a>
}
/>
)}