P2 slice 8: the viewer's menu, setup, no confinement (D-32)
No Landlock, no seccomp, no helper: isolation is "same_user (advisory)". The lease socket keeps two intents (close, format-upgrade consent). The viewer holds the books open while it runs and gains a Books menu: New books, Back up now, Restore (preview, then confirm), Close, Connect Claude Code / Codex. New commands `wanderbooks books back-up` and `wanderbooks connect claude|codex`. The scaffold (`new`/`init` and its templates) is gone; install.sh needs no sudo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
1 parent
019d8d76a3
commit
3cf359a0cd
28 files changed
+1976
-1931
No files matched your search
+30
-23
@@ -1,14 +1,16 @@
|
||||
#!/bin/sh
|
||||
# wanderbooks installer. One line on a new machine:
|
||||
#
|
||||
# curl -fsSL https://wanderbooks.ai/install.sh | sh -s -- ~/Books/Acme
|
||||
# curl -fsSL https://wanderbooks.ai/install.sh | sh -s -- acme
|
||||
#
|
||||
# Linux and macOS. On Windows, run it inside WSL2 (Ubuntu): the GUI opens as
|
||||
# a normal window on Windows 11.
|
||||
# Linux and macOS. On Windows, run it inside WSL2 (Ubuntu): the viewer opens
|
||||
# as a normal window on Windows 11.
|
||||
#
|
||||
# Installs Rust if needed, then the wanderbooks CLI, MCP server, and GUI
|
||||
# (into ~/.cargo/bin), then — given a directory — makes your books there and
|
||||
# starts the agent. Without a directory it just installs.
|
||||
# Installs Rust if needed, then the one `wanderbooks` program (into
|
||||
# ~/.cargo/bin), then makes the books' private folder (`wanderbooks setup`).
|
||||
# Given a name (lowercase letters, digits, hyphens), it also starts books of
|
||||
# that name and lets Claude Code reach them. Nothing runs as root; the
|
||||
# books close on their own a few seconds after the last command.
|
||||
#
|
||||
# WANDERBOOKS_REPO overrides where it installs from (a git URL).
|
||||
set -eu
|
||||
@@ -54,27 +56,32 @@ if ! command -v cargo >/dev/null 2>&1; then
|
||||
fi
|
||||
|
||||
say "Installing wanderbooks from $REPO (a few minutes, once)…"
|
||||
cargo install --locked --git "$REPO" ledger-cli ledger-mcp ledger-gui
|
||||
|
||||
if ! command -v just >/dev/null 2>&1; then
|
||||
say "Installing just (for the books dir's shortcuts)…"
|
||||
cargo install --locked just
|
||||
fi
|
||||
|
||||
if ! command -v claude >/dev/null 2>&1; then
|
||||
say "Claude Code isn't installed yet: https://claude.com/claude-code"
|
||||
fi
|
||||
cargo install --locked --git "$REPO" ledger-cli
|
||||
|
||||
case ":$PATH:" in
|
||||
*":$HOME/.cargo/bin:"*) ;;
|
||||
*) say "Add ~/.cargo/bin to your PATH (rustup's installer usually does; open a new terminal)." ;;
|
||||
esac
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
# Hand the terminal to the agent when there is one.
|
||||
if [ -t 1 ] && [ -e /dev/tty ]; then
|
||||
exec "$HOME/.cargo/bin/wanderbooks" new "$@" </dev/tty
|
||||
fi
|
||||
exec "$HOME/.cargo/bin/wanderbooks" new "$@" --no-start
|
||||
wb="$HOME/.cargo/bin/wanderbooks"
|
||||
# The books' private folder, and (at a terminal) the owner passphrase.
|
||||
if [ -t 1 ] && [ -e /dev/tty ]; then
|
||||
"$wb" setup </dev/tty
|
||||
else
|
||||
"$wb" setup
|
||||
fi
|
||||
say "Done. Make your books with: wanderbooks new ~/Books/YourCompany"
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
# Books of that name already (the line run again): connected, not made.
|
||||
if ! "$wb" books list | cut -d' ' -f1 | grep -qx "$1"; then
|
||||
"$wb" books create "$1"
|
||||
fi
|
||||
if command -v claude >/dev/null 2>&1; then
|
||||
"$wb" connect claude --book "$1"
|
||||
say "Done. Start Claude Code and say hello: your books \"$1\" are ready."
|
||||
else
|
||||
say "Done. Install Claude Code (https://claude.com/claude-code), then: wanderbooks connect claude --book $1"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
say "Done. Start books with: wanderbooks books create acme then: wanderbooks connect claude --book acme"
|
||||
Reference in new issue
Block a user