flora deploy command packages your TypeScript project and deploys it to a specific Discord guild. The deployment process includes bundling, building, and activating the script on the runtime.
Basic Usage
Deploy a script to a guild:Replace
123456789012345678 with your actual Discord guild ID.Command Options
Required
--guild <guild_id>- Discord guild ID to deploy to<entry_file>- Entry point file (e.g.,src/main.ts)
Optional
--root <directory>- Project root directory to package (defaults to.)--api-url <url>(or-a) - API URL override
Deployment Process
The CLI performs the following steps:- Package Project - Creates a zip archive of your project files
- Upload - Sends the archive to the build service
- Build - Bundles and compiles your TypeScript code
- Deploy - Activates the new deployment for the guild
Example Output
Custom Root Directory
By default, the CLI packages the current directory (.). Specify a custom root to package a subdirectory:
packages/bot while using src/main.ts as the entry point.
Project Configuration
Avoid repeating options by creating aflora.config.ts file:
flora.config.ts
Build Streaming
The CLI streams build logs in real-time via Server-Sent Events (SSE). If the build takes longer than 60 seconds, the CLI will timeout and provide instructions to follow the build separately.Listing Deployments
View all deployments:Getting Deployment Info
View details for a specific guild deployment:File Packaging
The CLI automatically packages your project files, excluding:node_modules/.git/- Common build artifacts and cache directories
- Files matching patterns in
.gitignore
The packaged zip includes all TypeScript source files and dependencies needed for the runtime to execute your script.
Troubleshooting
Build Failures
If a build fails, the CLI displays the error message:Authentication Errors
If you see authentication errors, ensure you’ve logged in:Connection Issues
Verify the API URL is correct:Health Check
Verify the runtime API is accessible:Next Steps
View Logs
Monitor runtime logs for your deployments
KV Operations
Store and retrieve data for your bot