Chapter 8: Bundling Your Pack
TL;DR
- Stop the dev server (
Ctrl+C
in the terminal). - Run the bundle command:
worka bundle
- For Apple Silicon users (with a Rust backend):
worka bundle --with-zigbuild
- Find your distributable
.aip
file(s) in your pack's root directory.
Throughout this tutorial, you've been using worka dev
for a fast, iterative development experience. Now it's time to create a final, production-ready version of your pack that you can share with others.
Step 1: From Development to Production
The worka dev
server is optimized for speed and hot-reloading, not for creating a final asset. For that, we use the bundle
command.
First, stop the development server by pressing Ctrl+C
in the terminal where it is running.
Step 2: The worka bundle
Command
This command is designed to create an optimized, portable, and distributable version of your pack. In your pack's root directory, run:
worka bundle
This command performs several actions:
- It builds all your frontend views with production optimizations (like minification).
- It compiles your backend MCP server(s) in release mode for maximum performance.
- It packages all of these assets into a single, compressed
.aip
archive.
Step 3: A Note on Cross-Compilation
Worka runs backend MCP servers in Linux-based containers for security and consistency. If you are developing on an Apple Silicon Mac (M1/M2/etc.) and your pack includes a Rust backend, you need to cross-compile your Rust code so it can run in the Linux environment.
The Worka CLI makes this easy with a special flag. If this applies to you, run this command instead:
worka bundle --with-zigbuild
This uses a tool called cargo-zigbuild
under the hood to handle the complexities of cross-compilation for you.
Step 4: The .aip
File
After the command finishes, you will find one or more new files in your pack's directory with the .aip
extension. The file name follows a clear convention:
pack.<tenant>-<name>-<version>.<architecture>.aip
If you cross-compiled, you will see multiple files, one for each target architecture (e.g., x86_64-unknown-linux-musl
and aarch64-unknown-linux-musl
).
This .aip
file is your finished product. It's a self-contained, portable archive that you can send to another Worka user to install, or that you could upload to a future marketplace.
Congratulations! You have now completed the entire end-to-end development cycle of a basic Worka AI Pack. You have learned how to:
- Set up your environment.
- Scaffold, run, and view a pack in development.
- Build a UI with React and the
worka-sdk
. - Implement a backend tool in Rust.
- Create a final, distributable bundle.
In the following parts of this guide, we will move from this tutorial format to a more detailed exploration of specific topics, diving deeper into the powerful features of the Worka platform.