Skip to main content

CLI Reference

The MeetLoyd CLI provides command-line access to all platform features for automation, scripting, and quick operations.

Installation

# npm
npm install -g @meetloyd/cli

# yarn
yarn global add @meetloyd/cli

# homebrew
brew install meetloyd/tap/loyd

Authentication

Login

# Interactive login (opens browser)
loyd login

# With API key
loyd login --api-key sk_live_xxxxx

# With environment variable
export MEETLOYD_API_KEY=sk_live_xxxxx
loyd agents list

Logout

loyd logout

Check Status

loyd whoami
# Output:
# Logged in as: user@example.com
# Organization: My Company
# API Key: sk_live_xxxx...xxxx

Agents

List Agents

loyd agents list

# With filters
loyd agents list --status active --limit 10

# JSON output
loyd agents list --json

Get Agent

loyd agents get agent-123

# JSON output
loyd agents get agent-123 --json

Create Agent

# Interactive
loyd agents create

# With flags
loyd agents create \
--name "Customer Support" \
--model claude-sonnet-4-20250514 \
--system-prompt "You are a helpful customer support agent." \
--tools memory,http_request

# From file
loyd agents create --from agent-config.yaml

Update Agent

loyd agents update agent-123 \
--name "Updated Name" \
--system-prompt "Updated prompt..."

# From file
loyd agents update agent-123 --from agent-config.yaml

Delete Agent

loyd agents delete agent-123

# Force without confirmation
loyd agents delete agent-123 --force

Chat with Agent

# Interactive chat
loyd agents chat agent-123

# Single message
loyd agents chat agent-123 --message "Hello, how are you?"

# With streaming
loyd agents chat agent-123 --message "Write a story" --stream

Conversations

List Conversations

loyd conversations list --agent-id agent-123

# JSON output
loyd conversations list --json

Get Conversation

loyd conversations get conv-123

# Show messages
loyd conversations get conv-123 --messages

Create Conversation

loyd conversations create --agent-id agent-123

Delete Conversation

loyd conversations delete conv-123

Avatars

List Avatars

loyd avatars list

Get Avatar

loyd avatars get avatar-123

Create Avatar

# Interactive
loyd avatars create

# With options
loyd avatars create \
--name "Support Avatar" \
--voice-id voice-123 \
--agent-id agent-456

Update Avatar

loyd avatars update avatar-123 \
--name "Updated Avatar" \
--voice-id voice-456

Delete Avatar

loyd avatars delete avatar-123

# Force without confirmation
loyd avatars delete avatar-123 --force

Streaming

Create Session

loyd streaming create \
--agent-id agent-123 \
--mode video

# With avatar
loyd streaming create \
--agent-id agent-123 \
--avatar-id avatar-456 \
--mode voice

Get Session

loyd streaming get session-123

List Sessions

loyd streaming list

# Filter by status
loyd streaming list --status active

End Session

loyd streaming end session-123

Voice

List Voices

loyd voice list

Get Voice

loyd voice get voice-123

Create Custom Voice

loyd voice create \
--name "Custom Voice" \
--provider elevenlabs \
--config '{"voice_id": "abc123"}'

Preview Voice

loyd voice preview voice-123 --text "Hello, this is a test."

Delete Voice

loyd voice delete voice-123 --force

Tasks

List Tasks

loyd tasks list

# Filter by agent
loyd tasks list --agent-id agent-123

# Filter by status
loyd tasks list --status active

Get Task

loyd tasks get task-123

Create Task

loyd tasks create \
--agent-id agent-123 \
--name "Daily Report" \
--type manual \
--input '{"report_type": "daily"}'

Run Task

# Run immediately
loyd tasks run task-123

# With input
loyd tasks run task-123 --input '{"param": "value"}'

# Wait for completion
loyd tasks run task-123 --wait

# Stream output
loyd tasks run task-123 --stream

View Execution

loyd tasks execution exec-123

Schedules

List Schedules

loyd schedules list

# Filter by task
loyd schedules list --task-id task-123

Create Schedule

loyd schedules create \
--task-id task-123 \
--name "Daily at 9 AM" \
--cron "0 9 * * *" \
--timezone "Europe/Paris"

Update Schedule

loyd schedules update schedule-123 \
--cron "0 10 * * *" \
--enabled true

Pause/Resume Schedule

# Pause
loyd schedules pause schedule-123

# Resume
loyd schedules resume schedule-123

Delete Schedule

loyd schedules delete schedule-123

Triggers

List Triggers

loyd triggers list

# Filter by type
loyd triggers list --type webhook

Get Trigger

loyd triggers get trigger-123

Enable/Disable Trigger

# Enable
loyd triggers enable trigger-123

# Disable
loyd triggers disable trigger-123

Test Trigger

loyd triggers test trigger-123

# With payload
loyd triggers test trigger-123 --payload '{"event": "test"}'

Delete Trigger

loyd triggers delete trigger-123

# Force without confirmation
loyd triggers delete trigger-123 --force

Tools

List Tools

loyd tools list

# Filter by type
loyd tools list --type custom

Get Tool

loyd tools get tool-123

List Built-in Tools

loyd tools builtins

Test Tool

loyd tools test tool-123

# With input
loyd tools test tool-123 --input '{"query": "test"}'

Delete Tool

loyd tools delete tool-123

# Force without confirmation
loyd tools delete tool-123 --force

Teams

List Teams

loyd teams list

Get Team

loyd teams get team-123

Create Team

loyd teams create --name "Engineering"

Delete Team

loyd teams delete team-123

# Force without confirmation
loyd teams delete team-123 --force

Add Member

loyd teams add-member team-123 \
--user user-456 \
--role member

Remove Member

loyd teams remove-member team-123 --user user-456

Update Member Role

loyd teams update-role team-123 \
--user user-456 \
--role admin

Workflows

List Workflows

loyd workflows list

Get Workflow

loyd workflows get workflow-123

Run Workflow

# Run workflow
loyd workflows run workflow-123

# With input
loyd workflows run workflow-123 --input '{"data": "value"}'

# Wait for completion
loyd workflows run workflow-123 --wait

Pause/Resume Workflow

# Pause workflow
loyd workflows pause workflow-123

# Activate workflow
loyd workflows activate workflow-123

List Workflow Runs

loyd workflows runs workflow-123

Get Run Status

loyd workflows run-status workflow-123 run-456

Cancel Workflow Run

loyd workflows cancel workflow-123 run-456

Delete Workflow

loyd workflows delete workflow-123

# Force without confirmation
loyd workflows delete workflow-123 --force

Templates

List Templates

loyd templates list

# Filter by category
loyd templates list --category support

Get Template

loyd templates get template-123

List Categories

loyd templates categories

Deploy Template

# Deploy template as new agent
loyd templates deploy template-123 --name "My Agent"

# With custom configuration
loyd templates deploy template-123 \
--name "Custom Agent" \
--config '{"key": "value"}'

Delete Template

loyd templates delete template-123

# Force without confirmation
loyd templates delete template-123 --force

API Keys

List API Keys

loyd api-keys list

Create API Key

# Interactive
loyd api-keys create

# With options
loyd api-keys create \
--name "Production API Key" \
--scopes "agents:read,agents:write" \
--expires-at "2025-12-31"

Delete API Key

loyd api-keys delete key-123

# Force without confirmation
loyd api-keys delete key-123 --force

Rotate API Key

loyd api-keys rotate key-123

Store

Browse

loyd store browse

# With filters
loyd store browse \
--category support \
--pricing free \
--sort popular

Get Listing

loyd store get listing-123

Install

loyd store install listing-123

My Installations

loyd store installs

Uninstall

loyd store uninstall install-123

Configuration

View Config

loyd config list

Set Config

# Set default output format
loyd config set output json

# Set default organization
loyd config set organization org-123

Config File

Location: ~/.loyd/config.yaml

api_key: sk_live_xxxxx
base_url: https://app.meetloyd.com/api/v1
output: table
organization: org-123

Output Formats

Table (default)

loyd agents list

# Output:
# ID NAME STATUS CREATED
# agent-123 Customer Support active 2024-01-15
# agent-456 Sales Agent active 2024-01-10

JSON

loyd agents list --json

# Output:
# [
# {"id": "agent-123", "name": "Customer Support", ...},
# {"id": "agent-456", "name": "Sales Agent", ...}
# ]

YAML

loyd agents list --yaml

Quiet (IDs only)

loyd agents list --quiet

# Output:
# agent-123
# agent-456

Scripting

Exit Codes

CodeMeaning
0Success
1General error
2Invalid arguments
3Authentication error
4Not found
5Rate limited

Piping

# Get agent ID and use it
AGENT_ID=$(loyd agents create --name "Test" --quiet)
loyd conversations create --agent-id $AGENT_ID

# Process JSON output
loyd agents list --json | jq '.[0].id'

Batch Operations

# Delete all inactive agents
loyd agents list --status inactive --quiet | xargs -I {} loyd agents delete {} --force

# Export all agent configs
for id in $(loyd agents list --quiet); do
loyd agents get $id --json > "agents/$id.json"
done

Environment Variables

VariableDescription
MEETLOYD_API_KEYAPI key for authentication
MEETLOYD_BASE_URLAPI base URL
MEETLOYD_OUTPUTDefault output format
MEETLOYD_NO_COLORDisable colored output
MEETLOYD_DEBUGEnable debug logging

Global Flags

FlagDescription
--api-keyOverride API key
--jsonOutput as JSON
--yamlOutput as YAML
--quietOnly output IDs
--no-colorDisable colors
--debugEnable debug mode
--helpShow help
--versionShow version

Interactive Mode

Start an interactive shell:

loyd shell

# In shell:
loyd> agents list
loyd> agents chat agent-123
loyd> exit

Aliases

Built-in command aliases:

AliasCommand
lslist
rmdelete
getget
newcreate
# These are equivalent:
loyd agents list
loyd agents ls

Auto-Completion

Bash

loyd completion bash >> ~/.bashrc
source ~/.bashrc

Zsh

loyd completion zsh >> ~/.zshrc
source ~/.zshrc

Fish

loyd completion fish > ~/.config/fish/completions/client.fish

PowerShell

loyd completion powershell >> $PROFILE

Examples

Create and Chat with Agent

# Create agent
AGENT=$(loyd agents create \
--name "Helper" \
--model claude-sonnet-4-20250514 \
--system-prompt "You are a helpful assistant." \
--quiet)

# Start conversation
CONV=$(loyd conversations create --agent-id $AGENT --quiet)

# Chat
loyd agents chat $AGENT --message "What can you help me with?"

Scheduled Task Setup

# Create task
TASK=$(loyd tasks create \
--agent-id $AGENT \
--name "Daily Summary" \
--type manual \
--quiet)

# Create schedule
loyd schedules create \
--task-id $TASK \
--name "Every morning" \
--cron "0 9 * * *" \
--timezone "America/New_York"

Webhook Integration

# Create trigger
WEBHOOK=$(loyd triggers create \
--task-id $TASK \
--name "GitHub Push" \
--type webhook \
--secret "github-secret" \
--json | jq -r '.webhookUrl')

echo "Add this URL to GitHub: $WEBHOOK"

Export/Import Agents

# Export
loyd agents get agent-123 --json > backup.json

# Import
loyd agents create --from backup.json

Troubleshooting

Debug Mode

loyd --debug agents list

Check Connection

loyd ping
# Output: Connected to app.meetloyd.com/api (latency: 45ms)

Reset Config

loyd config reset

Clear Cache

loyd cache clear

Need help? Run loyd help [command] for detailed command information.