aigne deploy
The aigne deploy command packages and deploys your AIGNE application as a Blocklet to a specified Blocklet Server endpoint. This is the standard way to publish your agent for production use, making it accessible as a self-contained, executable service.
Usage#
Basic Usage
aigne deploy --path <path-to-project> --endpoint <deploy-endpoint>Options#
Deployment Process#
The deploy command automates several steps to package your agent correctly and deploy it to the target environment. The process is interactive on the first run for a given project and non-interactive for subsequent updates.
Here is a step-by-step breakdown of what happens when you run the command:
- Environment Preparation: A temporary
.deploydirectory is created in your project root. The command copies your agent's source files and a standard Blocklet template into this directory to prepare for packaging. - Dependency Installation: If a
package.jsonfile is present, it runsnpm installwithin the temporary directory to fetch all necessary dependencies. - Blocklet CLI Check: The command verifies that the
@blocklet/cliis installed globally. If it's missing, you will be prompted to install it automatically, as it is required for packaging and deploying Blocklets. - Configuration (First-Time Deploy): On the first deployment of a project, the CLI will guide you through a brief interactive setup:
- Blocklet Name: You will be asked to provide a name for your Blocklet. It suggests a default based on the
namefield in youraigne.yamlor the project's directory name. - DID Generation: A new Decentralized Identifier (DID) is automatically generated for your Blocklet using
blocklet create --did-only, giving it a unique, verifiable identity. - This configuration (name and DID) is saved locally in
~/.aigne/deployed.yaml. For subsequent deployments of the same project, these saved values are used automatically, making the process non-interactive.
- Blocklet Name: You will be asked to provide a name for your Blocklet. It suggests a default based on the
- Bundling: The CLI executes
blocklet bundle --create-releaseto package all your application files into a single, deployable artifact. - Deployment: The final bundle is uploaded to the
--endpointyou specified usingblocklet deploy. - Cleanup: After a successful deployment, the temporary
.deploydirectory is automatically removed.
Example#
To deploy an AIGNE project located in the current directory to your Blocklet Server:
Deploying a project
aigne deploy --path . --endpoint https://my-node.abtnode.comIf this is the first time you are deploying this project, you will see a prompt to name your agent Blocklet:
First-time deployment prompt
✔ Prepare deploy environment
✔ Check Blocklet CLI
ℹ Configure Blocklet
? Please input agent blocklet name: › my-awesome-agent
✔ Bundle Blocklet
...
✅ Deploy completed: /path/to/your/project -> https://my-node.abtnode.comFor a more detailed walkthrough on setting up a deployment target and managing your deployed agents, refer to the Deploying Agents guide.