Repository navigation
Expand file tree
/
Copy pathformat
More file actions
executable file
·75 lines (73 loc) · 3.53 KB
/
Copy pathformat
File metadata and controls
executable file
·75 lines (73 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
usage() {
printf 'format %s · A.T, the Agentic Terminal\n' "$(sed -n "s/^export const VERSION = '\(.*\)';$/\1/p" frontend/src/version.ts 2>/dev/null)"
cat << 'EOF'
usage: ./format [command] [options]
(none) | boot boot the engine (8490) and the frontend (5490) together
install install the engine and the frontend
install-voice install local speech to text for the microphone (optional)
install-browser install the built-in browser Claude can use (optional)
install-desktop install PyInstaller, the browser and dictation packages, and check the Rust and Tauri toolchain
freeze freeze the engine into the desktop app's sidecar binary
desktop dev|build run the desktop app, or build it start to finish (same as ./build_app)
backend boot the engine only
frontend boot the frontend only
build production build of the frontend into frontend/dist
serve serve the built frontend from the engine on 127.0.0.1:8490
cli <command> ... run any engine command from the terminal (./format cli list)
mcp Format as an MCP server over stdio, for coding agents (needs the engine running)
native [build|info|window] the optional wgpu renderer: build it, show its GPU, or open its demo window
agents [sync [--check]|install [--user]] regenerate agents/manifest.json, the agent tool reference and the .agents/skills mirror (--check only reports what is out of date); install also registers Format
doctor check the toolchain, installs and ports
clean [--all] remove build output (--all also venv and node_modules)
help this text
EOF
}
cmd="${1:-boot}"
[ $# -gt 0 ] && shift
case "$cmd" in
boot|dev) exec setup/boot_all "$@" ;;
install) exec setup/install_all "$@" ;;
install-voice) exec setup/install_voice "$@" ;;
install-browser) exec setup/install_browser "$@" ;;
install-desktop) exec setup/install_desktop "$@" ;;
freeze) exec setup/freeze_backend "$@" ;;
desktop)
sub="${1:-dev}"
[ $# -gt 0 ] && shift
case "$sub" in
dev) exec setup/desktop_dev "$@" ;;
build) exec ./build_app "$@" ;;
*) echo "usage: ./format desktop dev|build" >&2; exit 2 ;;
esac ;;
backend) exec setup/boot_backend "$@" ;;
frontend) exec setup/boot_frontend "$@" ;;
build) exec setup/build_frontend "$@" ;;
serve) exec setup/serve "$@" ;;
cli)
py=python3
[ -x backend/venv/bin/python ] && py=backend/venv/bin/python
exec "$py" setup/cli.py "$@" ;;
mcp)
cd backend
[ -x venv/bin/python ] || { printf '[format] run ./format install first\n' >&2; exit 1; }
exec venv/bin/python -m app.mcp_stdio "$@" ;;
agents)
[ -x backend/venv/bin/python ] || { printf '[format] run ./format install first\n' >&2; exit 1; }
exec backend/venv/bin/python setup/agents.py "$@" ;;
native)
command -v cargo >/dev/null || { printf '[format] the native renderer needs Rust (rustup.rs)\n' >&2; exit 1; }
cd native/format-render
case "${1:-build}" in
build) exec cargo build --release ;;
info) cargo build --release -q && exec target/release/format-render info ;;
window) shift; exec cargo run --release -q --features window --example window -- "$@" ;;
*) printf 'usage: ./format native [build|info|window]\n' >&2; exit 2 ;;
esac ;;
doctor) exec setup/doctor "$@" ;;
clean) exec setup/clean "$@" ;;
help|-h|--help) usage ;;
*) printf '[format] unknown command: %s\n\n' "$cmd"; usage; exit 2 ;;
esac