aigne deploy

Reference

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#

--path
string
required
Specifies the path to the AIGNE project directory that contains the aigne.yaml file.

--endpoint
string
required
The URL of the Blocklet Server endpoint where the application will be deployed.

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:

  1. Environment Preparation: A temporary .deploy directory 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.
  2. Dependency Installation: If a package.json file is present, it runs npm install within the temporary directory to fetch all necessary dependencies.
  3. Blocklet CLI Check: The command verifies that the @blocklet/cli is installed globally. If it's missing, you will be prompted to install it automatically, as it is required for packaging and deploying Blocklets.
  4. 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 name field in your aigne.yaml or 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.
  5. Bundling: The CLI executes blocklet bundle --create-release to package all your application files into a single, deployable artifact.
  6. Deployment: The final bundle is uploaded to the --endpoint you specified using blocklet deploy.
  7. Cleanup: After a successful deployment, the temporary .deploy directory 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.com

If 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.com

For a more detailed walkthrough on setting up a deployment target and managing your deployed agents, refer to the Deploying Agents guide.