diff --git a/.github/release-notes.md b/.github/release-notes.md index 684c2c3..ae74712 100644 --- a/.github/release-notes.md +++ b/.github/release-notes.md @@ -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 diff --git a/docs/mcp.md b/docs/mcp.md index 45e97a2..12d672e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -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 | `/bin/fieldcraft-cli` | +| Linux, installed `.deb` or `.rpm` | `/usr/bin/fieldcraft-cli` | +| Windows, unpacked zip | `\fieldcraft-cli.exe` | +| Built from source | `/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 diff --git a/docs/releasing.md b/docs/releasing.md index 70b0506..76d19a4 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -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--macos-universal.dmg` (FieldCraft.app on a drag-to-Applications image), `fieldcraft-cli--macos-universal.zip` | `packaging/macos/package.sh` | +| macOS 11+, universal (arm64 + x86_64) | `fieldcraft--macos-universal.dmg` (FieldCraft.app, including `Contents/MacOS/fieldcraft-cli`, on a drag-to-Applications image), `fieldcraft-cli--macos-universal.zip` | `packaging/macos/package.sh` | | Linux x86_64, glibc 2.35+ | `fieldcraft--linux-x86_64.tar.gz` (`bin/`, `share/`), `fieldcraft--linux-x86_64.AppImage`, `fieldcraft__amd64.deb` (Debian, Ubuntu 22.04+), `fieldcraft-.x86_64.rpm` (Fedora, RHEL, openSUSE) | `packaging/linux/package.sh` | | Windows x64 | `fieldcraft--windows-x64.zip` (`fieldcraft.exe`, `fieldcraft-cli.exe`) | `packaging/windows/package.ps1` | diff --git a/packaging/macos/README.txt b/packaging/macos/README.txt index f81ca8c..1b9482e 100644 --- a/packaging/macos/README.txt +++ b/packaging/macos/README.txt @@ -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). diff --git a/packaging/macos/package.sh b/packaging/macos/package.sh index 384dde9..5748074 100755 --- a/packaging/macos/package.sh +++ b/packaging/macos/package.sh @@ -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