CLI Introduction
Get started with the HumanLayer command-line interface
HumanLayer CLI
The HumanLayer CLI provides a powerful command-line interface for interacting with HumanLayer services directly from your terminal. Whether you need to authenticate, manage configurations, or contact humans for approvals, the CLI offers a streamlined workflow for developers.
Installation
The HumanLayer CLI is distributed as an npm package and can be used directly with npx (recommended):
Or install globally:
Quick Start
-
Login to HumanLayer:
-
Show your current configuration:
-
Contact a human:
-
Launch the Terminal UI:
Available Commands
Command | Description |
---|---|
login | Authenticate with HumanLayer and save API token |
config show | Display current configuration settings |
contact_human | Send a message to a human and wait for response |
tui | Launch the Terminal User Interface |
Configuration
The CLI supports multiple configuration methods, in order of precedence:
- Command-line flags (highest priority)
- Environment variables
- Configuration files (lowest priority)
Configuration Files
The CLI looks for configuration files in the following locations:
./humanlayer.json
(local project config)~/.config/humanlayer/humanlayer.json
(user config)
Environment Variables
All configuration options can be set via environment variables with the HUMANLAYER_
prefix:
HUMANLAYER_API_TOKEN
- Your HumanLayer API tokenHUMANLAYER_API_BASE_URL
- API base URL (default: https://api.humanlayer.dev)HUMANLAYER_APP_URL
- App base URL (default: https://app.humanlayer.dev)HUMANLAYER_SLACK_CHANNEL
- Slack channel or user IDHUMANLAYER_SLACK_BOT_TOKEN
- Slack bot tokenHUMANLAYER_SLACK_CONTEXT
- Context about the Slack channel/userHUMANLAYER_SLACK_THREAD_TS
- Slack thread timestampHUMANLAYER_SLACK_BLOCKS
- Enable experimental Slack blocks (true/false)HUMANLAYER_EMAIL_ADDRESS
- Email address to contactHUMANLAYER_EMAIL_CONTEXT
- Context about the email recipient
Getting Help
Use the --help
flag with any command to get detailed usage information: