@2501 prefix and work from any directory.
The commands below belong to the
@2501 agent CLI. Managing platform configuration (agents, hosts, specialties, rules, and more) as version-controlled files uses a separate administrative 2501 CLI with its own resources commands. See Configuration as Code.Command Overview
set
Configure essential CLI settings, primarily for authentication.config
Fetch and display available agent configurations from the API, including specialties and operational settings.init
Initialize a new agent in the current or specified workspace. Agents can execute tasks locally or remotely.| Option | Description | Default |
|---|---|---|
--name <name> | Agent name | Auto-generated |
--workspace <path> | Workspace directory path | Current directory |
--config <configKey> | Specialty configuration key | SYSOPS |
--remote-exec <connection> | Enable remote execution (user@host:port) | None (local) |
--remote-exec-type <type> | Remote connection type: ssh or winrm | ssh |
--remote-private-key <privateKey> | Path to the SSH private key for authentication | ~/.ssh/id_rsa |
--remote-exec-password <password> | Password for remote authentication | None |
Local Execution
Initialize an agent for local execution (requires CLI installed on the target machine):Remote Execution
Initialize an agent for remote execution via SSH or WinRM. The agent runs in the 2501 agent swarm and connects to target machines remotely. SSH with Default Key:--remote-private-key, the CLI uses ~/.ssh/id_rsa if it is present.
SSH with Custom Private Key:
5985 (HTTP) or 5986 (HTTPS).
Complete Remote Example:
agents
List and manage agents in the current workspace or across your machine.| Option | Description |
|---|---|
--workspace <path> | List agents in specific workspace |
--all | List all agents on the machine |
--flush | Clear cached agent data |
tasks
Fetch the tasks assigned to your agents, and optionally execute new ones as they arrive. Tasks are created in Command Center, through gateways, or via the API, and the CLI runs them on the agent’s host.| Option | Description |
|---|---|
--workspace <path> | Use a specific workspace |
--subscribe | Receive continuous updates every minute |
--unsubscribe | Stop receiving updates |
--listen | Listen for new tasks from the API and execute them automatically |
--listen is the unattended mode for CI/CD and fleet automation: the agent picks up tasks created by gateways or the API and runs them as they arrive.
start-task
Run a specific task by its ID. Useful for manually triggering or re-running a task created elsewhere.| Option | Description | Default |
|---|---|---|
--workspace <path> | Use a specific workspace | Current directory |
--agent-id <agentId> | Run as a specific agent | Workspace agent |
--stream | Stream task output to the terminal | Enabled |
Best Practices
Workspace Management: Initialize agents in project directories for automatic workspace association. Use--workspace to switch between projects without changing directories. Keep one agent per project for better context isolation.
Remote Execution: Prefer key-based auth over passwords. Test SSH/WinRM access manually before initializing agents. Use descriptive names based on target system and role. Check firewall rules to ensure agent swarm can reach remote hosts.
Agent Organization: Create specialized agents for different tasks or environments. Use naming conventions like {environment}-{role}-{system} (e.g., prod-deploy-api). List agents regularly and flush cache if experiencing stale data.
Task Monitoring: Use --subscribe for active monitoring during deployments. Use --listen for unattended automation. Unsubscribe when done to reduce API calls.
Common Workflows
Initial Setup:Troubleshooting
Command Not Found: Verify CLI is installed withnpm list -g @2501-ai/cli. Check PATH includes npm global bin directory. Reinstall if necessary.
Authentication Errors: Verify API key with @2501 config. Re-set with @2501 set api_key YOUR_API_KEY. Check key hasn’t expired. See Authentication for detailed troubleshooting.
Agent Not Found: List agents with @2501 agents --all. Verify you’re in the correct workspace. Initialize if needed. Clear cache with @2501 agents --flush.
Remote Execution Failures: Test manual SSH/WinRM connection. Verify host accessibility (firewall, network). Check credentials. Ensure private key has correct permissions (SSH requires 600). Confirm port numbers (SSH: 22, WinRM: 5985/5986).
Task Not Executing: Check agent status with @2501 agents. Verify the workspace has an initialized agent. Review the task in Command Center for detailed errors.
Task Subscription Not Working: Verify the agent is initialized. Check API authentication. Ensure the workspace path is correct. Try unsubscribing and resubscribing.
For additional support, contact hello@2501.ai.
