Skip to content

Registering an Agent

Before an agent can execute builds, it must be registered with FlightStack. This guide walks through the registration process.

Before registering, ensure you have:

  • FlightStack CLI installed (Installation Guide)
  • Logged in to FlightStack (flightstack login)
  • Required build tools installed (Flutter, Xcode, etc.)
  1. Ensure you’re logged in:

    Terminal window
    flightstack login
  2. Register your machine as an agent:

    Terminal window
    flightstack agent register
  3. You’ll be prompted for a name (defaults to your hostname):

    Agent name (My-MacBook-Pro):
  4. The CLI automatically detects your system capabilities:

    System Information:
    Platform: macOS
    OS Version: macOS 14.2
    Xcode: 15.1
    Flutter: 3.16.5
    Dart: 3.2.3
    Capabilities:
    iOS: ✓
    Android: ✓
    Web: ✓
  5. Upon success:

    ✓ Agent registered successfully!
    Agent ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
    Next step: flightstack agent start
Terminal window
flightstack agent register --name "iOS-Build-Server"

Register an agent for a specific organization (private agent):

Terminal window
flightstack agent register --org <organization-id>

Use profiles to manage separate agent configurations (e.g., for local development):

~/.flightstack/config.dev.json
# Register with a profile
flightstack-agent register --profile dev

You can also set the profile via environment variable:

Terminal window
export FLIGHTSTACK_PROFILE=dev
flightstack-agent register

For scripted/automated setup:

Terminal window
flightstack-agent register \
--name "CI-Server-01" \
--org "org-id-here"

During registration, the following information is collected and stored:

DataPurpose
Agent nameDisplay name in UI
PlatformmacOS, Linux, or Windows
OS versionFor compatibility checks
Xcode versioniOS build capability
Flutter versionBuild environment info
Dart versionBuild environment info
CapabilitiesWhat platforms can be built

After registration, configuration is stored at:

~/.flightstack/agent.json

The file contains:

{
"agentId": "a1b2c3d4-...",
"token": "eyJhbGciOiJI...",
"apiUrl": "https://api.flightstack.dev",
"agentName": "My-MacBook-Pro",
"platform": "macOS",
"organizationId": null,
"organizationName": null
}

If you need to re-register an agent (new token, different org, etc.):

Terminal window
flightstack agent register

You’ll be prompted:

This machine is already registered as an agent.
Agent: My-MacBook-Pro
ID: a1b2c3d4-...
Re-register and replace existing? (y/n)

After registration, verify the agent appears in FlightStack:

Terminal window
# List all agents
flightstack agent list
# Or check local status
flightstack agent status

Output:

Build Agents (1):
────────────────────────────────────────────────────────────
My-MacBook-Pro
ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
Status: 🔴 Offline
Scope: 🌐 Public
Platform: macOS
Capabilities: iOS, Android, Web
Builds: 0 total, 0 successful
────────────────────────────────────────────────────────────
Terminal window
# Log in first
flightstack login
# Then register
flightstack agent register

If you want to keep the existing registration:

  • Answer “n” when prompted to re-register
  • Run flightstack agent start to start the existing agent

To force re-registration:

  • Answer “y” to replace the existing registration
  • Or delete the config file: rm ~/.flightstack/agent.json

Ensure Flutter is in your PATH:

Terminal window
# Check Flutter
flutter doctor
# Add to PATH if needed
export PATH="$PATH:/path/to/flutter/bin"
Terminal window
# Install Xcode from App Store, then:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license accept

After registration:

  1. Start the Agent
  2. Configure Auto-Start
  3. Create a Pipeline