CLI Tools (Internal)
Reference for the monorepo build and publish shell scripts — internal tools for built-in apps.
Note: These scripts are internal convenience tools used within the AssistMe monorepo for building and publishing built-in apps. External developers do not need these scripts — you can build your Agent App with any tooling and publish via the API.
Build Script
agent-app-build.sh
Builds a built-in sub-app (from agent-apps/native-{slug}/ in the monorepo) as a web bundle for dynamic loading.
./scripts/agent-app-build.sh <app-slug>Example:
./scripts/agent-app-build.sh noteProcess:
- Validates the
agent-apps/native-{slug}/directory exists in the monorepo - Reads the version from
package.json - Installs dependencies if
node_modules/is missing - Runs
npx expo export --platform web - Packages all JS and CSS into a single self-contained
index.html(all assets inlined) - Cleans up intermediate build artifacts
- Reports output size and SHA256 hash
Output:
agent-apps/native-{slug}/dist-bundle/index.htmlAdapting for Your Own Project
The core bundling logic is straightforward and can be replicated in any CI/CD pipeline:
# 1. Export as web
npx expo export --platform web --output-dir .expo-web-build
# 2. Find JS/CSS files
JS_FILES=$(find .expo-web-build -name "*.js" -path "*/static/js/*" | sort)
CSS_FILES=$(find .expo-web-build -name "*.css" | sort)
# 3. Inline into a single index.html
# (write HTML head, inline CSS with <style> tags, write body, inline JS with <script> tags)
# 4. Compute hash
sha256sum dist/index.htmlPublish Script
agent-app-publish.sh
Publishes a built-in sub-app version to the Agent App registry. This is a convenience wrapper around the agent-app-publish edge function.
./scripts/agent-app-publish.sh <app-slug> [--build-bundle]Required environment variables:
| Variable | Description |
|---|---|
SUPABASE_URL | Your Supabase project URL |
AUTH_TOKEN | A valid authentication token for the developer |
Process (with --build-bundle):
- Validates the
agent-apps/native-{slug}/directory in the monorepo - Reads the version from
package.json - Builds the web bundle via
agent-app-build.sh - Uploads the bundle to Supabase Storage
- Calls the
agent-app-publishedge function
For external developers, you can skip this script entirely and call the API directly:
curl -X POST "${SUPABASE_URL}/functions/v1/agent-app-publish" \
-H "Authorization: Bearer ${AUTH_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"slug": "my-app",
"version": "1.0.0",
"changelog": "Initial release",
"bundle_url": "https://your-cdn.com/bundle.html",
"bundle_hash": "<sha256>",
"bundle_size": 12345
}'See Submitting for Review for the full API reference.