DocsForLoop CLIAll docs

DEVELOPER

ForLoop CLI

Command-line interface for managing spaces, stories, files, and AI agents from your terminal.

ForLoop CLI

Overview

The ForLoop CLI (forloop) is a command-line tool that lets you interact with the ForLoop AI development platform directly from your terminal. Manage sprints, stories, files, AI agents, organizations, and more — without switching to the web browser.


Installation

Prerequisites

  • Node.js 18 or later
  • npm (comes with Node.js)
  • A ForLoop API token with scopes: sprint:read, sprint:write, story:read, story:write, agent:query, profile:read

Install via npm

npm install -g @forloop-cc/forloop-cli

Install via curl

curl -fsSL https://raw.githubusercontent.com/forloop-cc/forloop-cli/main/install.sh | bash

Verify the installation:

forloop --version

Authentication

Create an API token

  1. Go to Profile → API Tokens
  2. Click Create Token and select the required scopes
  3. Copy the token (starts with floop_)

Login

forloop auth login --api-key floop_xxxxxxxxxxxx

The token is saved to ~/.config/forloop/tokens.json with secure permissions (600).

Check status

forloop auth status

Logout

forloop auth logout

Environment variable (CI/CD)

export FORLOOP_API_KEY=floop_xxxxxxxxxxxx
forloop space-sprint list

Command Reference

All commands follow the pattern forloop <resource> <action> [options].

Sprint Management

CommandDescription
forloop space-sprint listList all accessible sprints
forloop space-sprint getGet sprint details with stories and files
forloop space-sprint createCreate a new sprint
forloop space-sprint updateUpdate sprint details
forloop space-sprint deleteDelete a sprint

Options:

  • --id <number> — Sprint ID
  • --title <text> — Sprint title
  • --start-date <YYYY-MM-DD> — Start date
  • --end-date <YYYY-MM-DD> — End date
  • --description <text> — Description
  • --private — Make sprint private
  • --org-id <number> — Filter by organization
  • --no-stories — Exclude stories from result
  • --no-files — Exclude files from result
  • --output json — Output as JSON

Examples:

# List all sprints
forloop space-sprint list

# Get details of a specific sprint
forloop space-sprint get --id 42

# Create a new sprint
forloop space-sprint create \
  --title "Q3 Feature Release" \
  --start-date 2026-07-01 \
  --end-date 2026-09-30 \
  --description "Building the new analytics dashboard"

# Update a sprint
forloop space-sprint update --id 42 --title "Updated Title"

# Delete a sprint (requires confirmation)
forloop space-sprint delete --id 42 --confirm "DELETE: Q3 Feature Release"

Story Management

CommandDescription
forloop story createCreate a story (task or note)
forloop story getGet story details with comments
forloop story updateUpdate story fields
forloop story deleteDelete a story

Options:

  • --title <text> — Story title (required)
  • --sprint <number> — Sprint ID (required)
  • --type basic-task|basic-note — Story type
  • --description <text> — Description
  • --priority low|medium|high|critical — Priority level
  • --points <number> — Story points estimate
  • --assignee-agent <key> — Assign to an AI agent
  • --status todo|in_progress|done — Update status

Examples:

# Create a task
forloop story create \
  --title "Implement user login" \
  --sprint 42 \
  --type basic-task \
  --priority high \
  --points 8

# Create a note
forloop story create \
  --title "Architecture decision: database choice" \
  --sprint 42 \
  --type basic-note \
  --description "Weighing PostgreSQL vs DynamoDB for the analytics pipeline"

# Update story status
forloop story update --id 99 --status in_progress

AI Agent Commands

CommandDescription
forloop agent historyView conversation history with AI agents
forloop agent developer-sprintTrigger AI developer agent to implement sprint stories
forloop agent developer-statusCheck status of a running developer task

Examples:

# Trigger developer agent to build sprint stories
forloop agent developer-sprint \
  --sprint 42 \
  --message "Build all in_progress stories for this sprint"

# Check developer task status
forloop agent developer-status --sprint 42

# View AI agent conversation history
forloop agent history --sprint 42

File Management

CommandDescription
forloop file uploadUpload a file to sprint S3 storage
forloop file listList files in a sprint
forloop file downloadGet a download URL for a file
forloop file deleteDelete a file

Examples:

# Upload a file
forloop file upload \
  --path ./design-mockup.png \
  --sprint 42 \
  --description "Updated homepage design"

# List all files in a sprint
forloop file list --sprint 42

# Get a download URL
forloop file download --id 15

Sync Commands

Sync files between your local machine and sprint S3 storage.

CommandDescription
forloop sync s3-to-localDownload sprint files to ~/.forloop/
forloop sync local-to-s3Upload a local file to sprint S3
forloop sync aivy-folderEnsure a document folder exists for file sync
forloop sync aivy-doc-getGet the document folder story ID

Directory structure after sync:

~/.forloop/sprint-{id}/
├── knowledge/    # Sprint context files
├── plan/         # Planning documents
└── task/         # Task-specific files

Examples:

# Download all sprint files to local
forloop sync s3-to-local --sprint 42

# Upload a local file to sprint storage
forloop sync local-to-s3 \
  --path ~/.forloop/sprint-42/plan/roadmap.md \
  --sprint 42 \
  --folder plan

Organization & User Management

CommandDescription
forloop user profileView your profile
forloop user quotasCheck your quota limits and usage
forloop org listList organizations
forloop org getGet organization details
forloop org createCreate a new organization
forloop org quotasGet organization quota usage

Examples:

# View your profile
forloop user profile

# Check quotas
forloop user quotas

# List your organizations
forloop org list --owned-only

File Sync Workflow

A typical workflow combining local editing with sprint storage:

# 1. Download everything from the sprint
forloop sync s3-to-local --sprint 42

# 2. Edit files locally in ~/.forloop/sprint-42/
vim ~/.forloop/sprint-42/plan/roadmap.md

# 3. Upload changes back to sprint
forloop sync local-to-s3 \
  --path ~/.forloop/sprint-42/plan/roadmap.md \
  --sprint 42 \
  --folder plan

CI/CD Automation

Use the CLI in shell scripts and CI pipelines:

#!/bin/bash
export FORLOOP_API_KEY="$FORLOOP_TOKEN"

# Check if developer agent is still running
STATUS=$(forloop agent developer-status --sprint 42 --output json | jq -r '.status')

if [ "$STATUS" = "completed" ]; then
  echo "Sprint 42 build completed!"

  # Download build artifacts
  forloop sync s3-to-local --sprint 42

  # Trigger next stage
  npm run deploy
fi

Error Codes

CodeMeaning
0Success
1General error
2Invalid usage / missing arguments
3Authentication failure
4Quota exceeded
5Request timeout
6Network error
7API error
10Content filtered
130Interrupted (Ctrl+C)

Configuration

Config resolution priority

  1. Environment variables (FORLOOP_API_KEY, FORLOOP_API_URL)
  2. Project-level ./opencode.json (under "forloop" key)
  3. Global ~/.config/opencode/config.json
  4. Default: https://api.forloop.cc

Project config example (./opencode.json)

{
  "forloop": {
    "apiUrl": "https://api.forloop.cc",
    "debug": true
  }
}

Updating

npm update -g @forloop-cc/forloop-cli

Or use the update script:

curl -fsSL https://raw.githubusercontent.com/forloop-cc/forloop-cli/main/install.sh | bash

Next Steps