# Using the graphical wizard

The GUI is a local web page served by the kurama executable. No webview, browser
extension, or internet connection is involved. The server listens only on
`127.0.0.1` and opens a random port with a one-time access token.

## Launching

- **Windows release:** double-click `kurama.exe`. No console window appears.
- **Console build:** run `kurama` or `kurama gui`.
- **Server only:** `kurama serve` prints the loopback address and launcher URL.
  Add `--json` to get `{"baseUrl":…,"launcherUrl":…}` for automation.
- **Do not open the page manually.** Always use the launcher URL printed by
  kurama; the clean base URL has no session cookie until the token is exchanged.
  The token is removed from the address bar immediately after the exchange.

If the browser does not open, copy the launcher URL from the terminal. If you
close the page, the server keeps running until you close it or press
**Quit kurama** in the footer.

## The eight steps

| Step | What it asks |
| --- | --- |
| **Browser** | Which installed Firefox or Firefox fork to configure. |
| **Profile** | Create a fresh profile (recommended) or modify an existing one. |
| **Starting point** | Balanced, maximum privacy, compatibility, or custom. |
| **Preferences** | Toggle optional bundles such as Ghost Mode and DRM. |
| **Add-ons** | Pick extras. uBlock Origin is always available from the bundle. |
| **Bookmarks** | Choose interests, individual suggestions, or import an HTML export. |
| **Finishing touches** | Bundle or custom wallpaper, desktop shortcut, launch. |
| **Review** | Read the summary and warnings, then apply. |

The stepper on the left can jump back to any step. Leaving and returning does
not change a selection.

## The one-click path

On the Browser step, a callout offers **Skip to recommended setup**. It loads:

- a fresh profile named `kurama`,
- the Balanced preset (baseline plus blocked built-in AI),
- uBlock Origin,
- suggested add-ons and bookmarks for a general audience,
- the bundled wallpaper,
- a desktop shortcut and a launch at the end.

It then goes straight to **Review**. This is still not a blind action: the
summary is shown, and nothing is written until **Apply configuration** is
pressed. The defaults are deliberately non-breaking: Ghost Mode, DRM disabling,
WebRTC disabling, and reduced graphics stay off.

Running the shortcut again is safe. kurama keeps a draft of the last selection,
creates another timestamped backup, and rewrites the managed files. Re-running
with the same choices is idempotent for the profile.

## Review and apply

The review screen lists the browser, profile, preference bundles, add-ons,
bookmark count, wallpaper, shortcut, and launch choice. It also shows a
plain-language warning for every risky selection, including:

- Ghost Mode may break sites that rely on canvas or exact screen details.
- DRM off stops Netflix, Disney+, and similar services.
- WebRTC off breaks browser calls such as Discord and Meet.
- Reduced graphics slows games and design tools.
- Ghost Mode and CanvasBlocker should not be combined.
- Missing uBlock Origin means no bundled content blocker.
- A browser-specific note, for example Mullvad Browser's own hardening.

Press **Apply configuration**. The progress screen shows one row per pipeline
stage and streams live status. You can cancel; a cancelled job stops before its
next stage and reports what completed. Closing the tab does not cancel a running
job, so a long add-on install still finishes.

When the job ends, the result screen shows the profile folder, `user.js` path,
backup folder, installed add-ons, store pages that will open, and any warnings.
If a store page opens, finish that add-on's installation with its own **Add to
Firefox** button; kurama could not install it automatically.

## Profiles

### New profile (recommended)

kurama creates a profile named `kurama` (or the name you choose) and marks it as
the default for that browser. Existing profiles are not touched. Firefox opens
the new profile with the new settings while the old profile remains available
from `about:profiles`.

### Existing profile

Choosing an existing profile enables the same pipeline, but kurama first writes
a complete backup and shows an explicit warning. Use this when you want the
settings in your everyday profile. Close the browser first: kurama refuses to
modify a running profile because Firefox rewrites its files on exit.

The GUI does not copy a profile. If you want a trial run, create a fresh profile
first and use that.

## Bookmarks

There are three bookmark sources:

1. **Suggested** — essentials plus sites matching your interests.
2. **Individual** — search and tick specific suggestions.
3. **Import** — upload a Netscape-format HTML export from Firefox, Chrome, or
   another browser. kurama reads it locally and merges it into the generated
   `bookmarks.html`.

Firefox imports the file on its next launch. kurama sets
`browser.bookmarks.file` and `browser.places.importBookmarksHTML`; Firefox turns
the import flag off again after a successful import. Existing bookmarks are not
deleted.

Uploads are limited and validated. A file stays in the server's session upload
folder until the process exits.

## Wallpaper

The bundled wallpaper is shown as a live preview from `GET /api/wallpaper`, so
the preview is exactly the embedded image. A custom image may be JPEG, PNG,
WebP, GIF, or AVIF. kurama writes the image and a `userContent.css` that applies
it only to `about:home` and `about:newtab`.

The baseline enables
`toolkit.legacyUserProfileCustomizations.stylesheets`, which Firefox requires
for `userContent.css` to load.

## Theme and accessibility

- Dark purple and amber are the default; the header button switches to light.
  The choice is remembered in `config.json`.
- The layout is responsive down to phone widths and avoids horizontal scrolling.
- Focus outlines, a skip link, labelled controls, and reduced-motion handling are
  included.
- The UI uses external CSS and ES modules only. CSP forbids inline style and
  script attributes, so dynamic widths are set through the CSS object model.

## Where settings live

| Data | Location |
| --- | --- |
| GUI theme and last draft | `<user config>/kurama/config.json` |
| Per-profile state | `<profile>/.kurama/state.json` |
| Backups | `<profile>/.kurama/backups/<timestamp>/` |
| Logs | `<user cache>/kurama/logs/` |

On Windows, the user config directory is normally
`%APPDATA%\kurama`. Set `KURAMA_CONFIG_DIR` to isolate a run, which is what the
Selenium tests do.

## Keyboard and quitting

`Tab`/`Shift+Tab` move through controls, `Enter` activates a focused button,
and `Escape` closes a confirmation dialog. The footer's **Quit kurama** stops the
local server. Closing the browser tab alone leaves the server running in the
background until the process is closed.
