Bundle the macOS CLI inside FieldCraft.app

This commit is contained in:
Preetinder Kalsi authored and Irakli Kourtis committed 2026-10-15 15:43:32 -04:00
1 parent 991dd354cb
commit 2be6aff2f9
5 files changed
+37 -8

No files matched your search

+2 -1
View File
@@ -7,7 +7,8 @@ modal problems with its own solver. AI agents can drive it over MCP (`fieldcraft
**Which file?** **Which file?**
- **macOS 11+** (Apple silicon and Intel): open `fieldcraft-{version}-macos-universal.dmg` and - **macOS 11+** (Apple silicon and Intel): open `fieldcraft-{version}-macos-universal.dmg` and
drag `FieldCraft.app` onto Applications. The command-line tool is in drag `FieldCraft.app` onto Applications. The command-line tool is included at
`/Applications/FieldCraft.app/Contents/MacOS/fieldcraft-cli` and also available separately in
`fieldcraft-cli-{version}-macos-universal.zip`. `fieldcraft-cli-{version}-macos-universal.zip`.
- **Linux** (x86_64, glibc 2.35+: Ubuntu 22.04, Debian 12, Fedora 36 or newer): - **Linux** (x86_64, glibc 2.35+: Ubuntu 22.04, Debian 12, Fedora 36 or newer):
`fieldcraft-{version}-linux-x86_64.AppImage` (`chmod +x`, then run it), or unpack `fieldcraft-{version}-linux-x86_64.AppImage` (`chmod +x`, then run it), or unpack
+19 -2
View File
@@ -26,6 +26,23 @@ both must run on the same computer.
### Claude Code ### Claude Code
Use the CLI from your installation:
| Platform | CLI path |
|---|---|
| macOS, app installed in Applications | `/Applications/FieldCraft.app/Contents/MacOS/fieldcraft-cli` |
| Linux, unpacked tar.gz | `<unpacked-folder>/bin/fieldcraft-cli` |
| Linux, installed `.deb` or `.rpm` | `/usr/bin/fieldcraft-cli` |
| Windows, unpacked zip | `<unpacked-folder>\fieldcraft-cli.exe` |
| Built from source | `<repository>/target/release/fieldcraft-cli` (`fieldcraft-cli.exe` on Windows) |
The separate macOS CLI zip also contains `fieldcraft-cli` in its unpacked folder. Use an absolute
path in your MCP configuration; quote it if it contains spaces. For the installed macOS app:
```sh
claude mcp add fieldcraft -- /Applications/FieldCraft.app/Contents/MacOS/fieldcraft-cli mcp
```
```sh ```sh
claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp
# bridged to a running app: # bridged to a running app:
@@ -34,8 +51,8 @@ claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp --connect 127.0.0.1:707
claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp --automation-read-root /work/bracket --automation-write-root /work/bracket/out claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp --automation-read-root /work/bracket --automation-write-root /work/bracket/out
``` ```
Build the binary first (`cargo build --release -p fieldcraft-cli`; it is When building from source, run `cargo build --release -p fieldcraft-cli` first. The same setup as a
`target/release/fieldcraft-cli`). The same setup as a project `.mcp.json`, or in another client's project `.mcp.json`, or in another client's
configuration (Claude Desktop's `claude_desktop_config.json`): configuration (Claude Desktop's `claude_desktop_config.json`):
```json ```json
+1 -1
View File
@@ -10,7 +10,7 @@ are in `packaging/` and run the same way on a developer machine.
| Platform | Files | Script | | Platform | Files | Script |
|---|---|---| |---|---|---|
| macOS 11+, universal (arm64 + x86_64) | `fieldcraft-<v>-macos-universal.dmg` (FieldCraft.app on a drag-to-Applications image), `fieldcraft-cli-<v>-macos-universal.zip` | `packaging/macos/package.sh` | | macOS 11+, universal (arm64 + x86_64) | `fieldcraft-<v>-macos-universal.dmg` (FieldCraft.app, including `Contents/MacOS/fieldcraft-cli`, on a drag-to-Applications image), `fieldcraft-cli-<v>-macos-universal.zip` | `packaging/macos/package.sh` |
| Linux x86_64, glibc 2.35+ | `fieldcraft-<v>-linux-x86_64.tar.gz` (`bin/`, `share/`), `fieldcraft-<v>-linux-x86_64.AppImage`, `fieldcraft_<v>_amd64.deb` (Debian, Ubuntu 22.04+), `fieldcraft-<v>.x86_64.rpm` (Fedora, RHEL, openSUSE) | `packaging/linux/package.sh` | | Linux x86_64, glibc 2.35+ | `fieldcraft-<v>-linux-x86_64.tar.gz` (`bin/`, `share/`), `fieldcraft-<v>-linux-x86_64.AppImage`, `fieldcraft_<v>_amd64.deb` (Debian, Ubuntu 22.04+), `fieldcraft-<v>.x86_64.rpm` (Fedora, RHEL, openSUSE) | `packaging/linux/package.sh` |
| Windows x64 | `fieldcraft-<v>-windows-x64.zip` (`fieldcraft.exe`, `fieldcraft-cli.exe`) | `packaging/windows/package.ps1` | | Windows x64 | `fieldcraft-<v>-windows-x64.zip` (`fieldcraft.exe`, `fieldcraft-cli.exe`) | `packaging/windows/package.ps1` |
+5 -1
View File
@@ -10,4 +10,8 @@ right-click FieldCraft.app in Applications and choose Open, then Open again. Or
Updating: quit FieldCraft, drag FieldCraft.app from this disk image onto Applications and Updating: quit FieldCraft, drag FieldCraft.app from this disk image onto Applications and
choose Replace. choose Replace.
The command-line tool, fieldcraft-cli, is a separate download (fieldcraft-cli-*-macos-*.zip). The command-line tool is included at
/Applications/FieldCraft.app/Contents/MacOS/fieldcraft-cli
It is also available separately (fieldcraft-cli-*-macos-*.zip).
+10 -3
View File
@@ -125,6 +125,7 @@ mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources/Licenses"
# CFBundleIconName). Assets.car holds the layered icon for macOS 26 and later, the .icns the # CFBundleIconName). Assets.car holds the layered icon for macOS 26 and later, the .icns the
# icon for earlier versions (assets/app-icon/README.md). # icon for earlier versions (assets/app-icon/README.md).
cp "$WORK/bin/fieldcraft" "$APP/Contents/MacOS/FieldCraft" cp "$WORK/bin/fieldcraft" "$APP/Contents/MacOS/FieldCraft"
cp "$WORK/bin/fieldcraft-cli" "$APP/Contents/MacOS/fieldcraft-cli"
cp "$ICONS/icon.icns" "$APP/Contents/Resources/FieldCraft.icns" cp "$ICONS/icon.icns" "$APP/Contents/Resources/FieldCraft.icns"
cp "$ICONS/Assets.car" "$APP/Contents/Resources/Assets.car" cp "$ICONS/Assets.car" "$APP/Contents/Resources/Assets.car"
copy_docs "$APP/Contents/Resources/Licenses" copy_docs "$APP/Contents/Resources/Licenses"
@@ -133,7 +134,8 @@ sed -e "s/@APP_ID@/$APP_ID/g" -e "s/@VERSION@/$VERSION/g" -e "s/@SHORT_VERSION@/
plutil -lint "$APP/Contents/Info.plist" plutil -lint "$APP/Contents/Info.plist"
printf 'APPL????' >"$APP/Contents/PkgInfo" printf 'APPL????' >"$APP/Contents/PkgInfo"
# Sign inside-out: the executable, then the bundle (no --deep on the bundle's own signature). # Sign inside-out: both executables, then the bundle (no --deep on the bundle's own signature).
sign --options runtime --identifier "$APP_ID.cli" "$APP/Contents/MacOS/fieldcraft-cli"
sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP/Contents/MacOS/FieldCraft" sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP/Contents/MacOS/FieldCraft"
sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP" sign --options runtime --entitlements "$HERE/entitlements.plist" "$APP"
codesign --verify --strict --deep --verbose=2 "$APP" codesign --verify --strict --deep --verbose=2 "$APP"
@@ -185,9 +187,14 @@ cmp "$ICONS/Assets.car" "$M_APP/Contents/Resources/Assets.car"
for f in "${DOC_FILES[@]}"; do for f in "${DOC_FILES[@]}"; do
test -s "$M_APP/Contents/Resources/Licenses/$f" test -s "$M_APP/Contents/Resources/Licenses/$f"
done done
for arch in "${WANT[@]}"; do lipo "$M_APP/Contents/MacOS/FieldCraft" -verify_arch "$arch"; done for bin in FieldCraft fieldcraft-cli; do
test -x "$M_APP/Contents/MacOS/$bin"
for arch in "${WANT[@]}"; do lipo "$M_APP/Contents/MacOS/$bin" -verify_arch "$arch"; done
codesign --verify --strict --verbose=2 "$M_APP/Contents/MacOS/$bin"
"$M_APP/Contents/MacOS/$bin" --version
done
codesign --verify --strict --deep --verbose=2 "$M_APP" codesign --verify --strict --deep --verbose=2 "$M_APP"
"$M_APP/Contents/MacOS/FieldCraft" --version "$M_APP/Contents/MacOS/fieldcraft-cli" commands >/dev/null
hdiutil_retry detach "$MNT" >/dev/null hdiutil_retry detach "$MNT" >/dev/null
trap - EXIT trap - EXIT
if [ "$NOTARIZE" = 1 ]; then if [ "$NOTARIZE" = 1 ]; then