Once listeners are deployed and hosted on Flatfileβs secure cloud, they are
called Agents.
Installation
Configuration
Authentication
The CLI requires your Flatfile API key and Environment ID, provided either in Environment variables (ideally in a.env file) or as command flags. You can find your API key and Environment ID in your Flatfile dashboard under βAPI Keys and Secretsβ.
Recommended approach: Use a
.env file in your project root for secure,
convenient, and consistent authentication. If youβre using Git, make sure to
add .env to your .gitignore file..env file
Create a .env file in your project root:
Regional Servers
For improved performance and compliance, Flatfile supports regional deployments:
Set your regional URL in
.env:
Development Workflow
1
Develop Locally
Use
develop to run your listener locally with live reloading2
Deploy to Production
Use
deploy to push your listener to Flatfileβs cloud as an Agent3
Manage Agents
Use
agents commands to list, download, or delete deployed agentsCommands
develop
Run your listener locally with automatic file watching and live reloading.
Features
- Live reloading on file changes
- Real-time HTTP request logging
- Low-latency event streaming (10-50ms)
- Event handler visibility
deploy
Deploy your listener as a Flatfile Agent.
File detection order
./index.js./index.ts./src/index.js./src/index.ts
Without a slug, the CLI updates your existing agent or creates one with slug
default.agents list
Display all deployed agents in your environment.- Agent ID
- Slug
- Deployment status
- Last activity
agents download
Download a deployed agentβs source code.- Examine deployed code
- Modify existing agents
- Back up source code
- Debug deployment issues

