forked from 1b-agent/fieldcraft-upstream
Bundle the macOS CLI inside FieldCraft.app
This commit is contained in:
1 parent
991dd354cb
commit
2be6aff2f9
5 files changed
+37
-8
No files matched your search
@@ -7,7 +7,8 @@ modal problems with its own solver. AI agents can drive it over MCP (`fieldcraft
|
||||
|
||||
**Which file?**
|
||||
- **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`.
|
||||
- **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
|
||||
|
||||
+19
-2
@@ -26,6 +26,23 @@ both must run on the same computer.
|
||||
|
||||
### 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
|
||||
claude mcp add fieldcraft -- /path/to/fieldcraft-cli mcp
|
||||
# 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
|
||||
```
|
||||
|
||||
Build the binary first (`cargo build --release -p fieldcraft-cli`; it is
|
||||
`target/release/fieldcraft-cli`). The same setup as a project `.mcp.json`, or in another client's
|
||||
When building from source, run `cargo build --release -p fieldcraft-cli` first. The same setup as a
|
||||
project `.mcp.json`, or in another client's
|
||||
configuration (Claude Desktop's `claude_desktop_config.json`):
|
||||
|
||||
```json
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ are in `packaging/` and run the same way on a developer machine.
|
||||
|
||||
| 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` |
|
||||
| Windows x64 | `fieldcraft-<v>-windows-x64.zip` (`fieldcraft.exe`, `fieldcraft-cli.exe`) | `packaging/windows/package.ps1` |
|
||||
|
||||
|
||||
@@ -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
|
||||
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).
|
||||
@@ -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
|
||||
# icon for earlier versions (assets/app-icon/README.md).
|
||||
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/Assets.car" "$APP/Contents/Resources/Assets.car"
|
||||
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"
|
||||
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"
|
||||
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
|
||||
test -s "$M_APP/Contents/Resources/Licenses/$f"
|
||||
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"
|
||||
"$M_APP/Contents/MacOS/FieldCraft" --version
|
||||
"$M_APP/Contents/MacOS/fieldcraft-cli" commands >/dev/null
|
||||
hdiutil_retry detach "$MNT" >/dev/null
|
||||
trap - EXIT
|
||||
if [ "$NOTARIZE" = 1 ]; then
|
||||
|
||||
Reference in new issue
Block a user