Deploying via the CLI
In Vibe Coding scenarios, after generating a project based on Makers capabilities, the Agent can start the development environment in a sandbox through the CLI for real-time user preview, and then deploy the project to production after the result is confirmed.
Installing the CLI
If you use a self-built or third-party sandbox, you can preinstall the CLI into the sandbox image so that the Agent can directly run the
edgeone command in an isolated workspace to complete preview and deployment. If you use a sandbox from the Makers platform, you can skip this step because it already has the CLI preinstalled.Note: This CLI installation package is streamlined for Vibe Coding sandbox scenarios and primarily provides capabilities for starting development environments and deploying applications.
You can directly download the CLI installation package and install it yourself, or you can refer to the sample script to complete the installation during the image build phase:
COPY scripts/install-edgeone-cli.example.sh /tmp/install-edgeone-cli.shRUN bash /tmp/install-edgeone-cli.sh && rm /tmp/install-edgeone-cli.sh
The sample script downloads and extracts the CLI installation package from a fixed URL, installs the files to the system directory, and creates an
edgeone command entry that can be invoked directly through PATH. After the image is built, you can run edgeone --version to verify the installation.Issuing a Tenant Token
When deploying with the CLI in a sandbox environment, avoid using platform-level credentials. Instead, issue a tenant-level Token at Agent runtime for the CLI to use when starting previews and performing deployments.
import { Makers } from "@edgeone/makers-sdk";const platform = new Makers({token: process.env.MAKERS_API_TOKEN,region: "china",});const { token, tokenId, expired } = await platform.tokens.create({tenantId: "user-open-id",name: "user-open-id",expiresIn: 86400,});
import osfrom makers_sdk import Makersplatform = Makers(token=os.environ["MAKERS_API_TOKEN"],region="china",)created = platform.tokens.create(tenant_id="user-open-id",name="user-open-id",expires_in=86400,)
Starting Preview
At runtime, the Agent constructs the command string for starting the preview, passes the tenant Token as a parameter, and then invokes the EdgeOne CLI through the sandbox's commands tool to start the project preview.
export function buildMakersDevLaunchCommand(port: number, projectName: string) {return `edgeone makers dev -t ${token} --port ${port} --skip-env-sync --name ${shellQuote(projectName)}`;}
Executing Deployment
At runtime, the Agent constructs the command string for deployment, passes the tenant Token as a parameter, and then invokes the EdgeOne CLI through the sandbox's commands tool to perform the deployment.
function makersDeployLaunch(projectName: string, requestedCommand: string, area = 'global') {const previewEnvironment = /(?:^|\s)(?:-e|--environment)(?:\s+|=)preview(?:\s|$)/i.test(requestedCommand);return ['edgeone makers deploy',`-t ${token}`, // Tenant token`-n ${shellQuote(projectName)}`,'--json',`--area ${area}`,previewEnvironment ? '-e preview' : '',].filter(Boolean).join(' ');}
