fix(FN-000): backup routine uses npx runfusion.ai; alias exposes fn/fusion

Backup automation now emits `npx runfusion.ai backup --create` so scheduled
backups work for users on the zero-install path where `fn` is not on PATH.

`runfusion.ai` also exposes `fn` and `fusion` bins, so `npm i -g runfusion.ai`
puts them on PATH (npm does not link dep bins globally). Alias only defaults
to the dashboard when invoked as `runfusion.ai` / `runfusion`; `fn` / `fusion`
forward args verbatim so bare `fn` still prints help.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-22 19:19:07 -07:00
parent 0ab465a9d1
commit 9ca6b9174b
6 changed files with 31 additions and 20 deletions

View File

@@ -473,7 +473,7 @@ describe("syncBackupRoutine", () => {
expect(routine).toBeDefined();
expect(routine?.name).toBe("Database Backup");
expect(routine?.trigger).toEqual({ type: "cron", cronExpression: "0 3 * * *" });
expect(routine?.command).toBe("fn backup --create");
expect(routine?.command).toBe("npx runfusion.ai backup --create");
expect(routine?.agentId).toBe("");
expect(routine?.scope).toBe("project");
});
@@ -494,7 +494,7 @@ describe("syncBackupRoutine", () => {
expect(routines).toHaveLength(1);
expect(updated?.trigger).toEqual({ type: "cron", cronExpression: "30 4 * * *" });
expect(updated?.command).toBe("fn backup --create");
expect(updated?.command).toBe("npx runfusion.ai backup --create");
expect(updated?.enabled).toBe(true);
});

View File

@@ -420,11 +420,11 @@ export async function syncBackupAutomation(
throw new Error(`Invalid backup schedule: ${schedule}`);
}
// Build the backup command
// The CLI command will be: fn backup --auto
// The --auto flag indicates this is an automated run (can add special handling if needed)
const command = "fn backup --create";
// Build the backup command.
// Uses `npx runfusion.ai` so backups work even when only the zero-install
// path (`npx runfusion.ai`) has been used and `fn` is not on PATH.
const command = "npx runfusion.ai backup --create";
if (existingSchedule) {
// Update existing schedule
return await automationStore.updateSchedule(existingSchedule.id, {
@@ -474,7 +474,7 @@ export async function syncBackupRoutine(
throw new Error(`Invalid backup schedule: ${schedule}`);
}
const command = "fn backup --create";
const command = "npx runfusion.ai backup --create";
const input = {
name: BACKUP_SCHEDULE_NAME,
description: "Automatic database backup based on project settings",