Skip to main content
The 2501 CLI provides commands for managing agents, executing tasks, and interacting with your infrastructure. All commands use the @2501 prefix and work from any directory.

Command Overview

CommandPurpose
setConfigure CLI settings
configView available configurations
initInitialize a new agent
agentsManage and list agents
queryExecute tasks with agents
jobsMonitor and manage jobs

set

Configure essential CLI settings, primarily for authentication.
api_key Set your API key for authentication:
Retrieve your API key from accounts.2501.ai. See Authentication for details.

config

Fetch and display available agent configurations from the API, including specialties and operational settings.
Shows available specialties, engine configurations, and organization settings. Use this to verify authentication and explore configurations before initializing agents.

init

Initialize a new agent in the current or specified workspace. Agents can execute tasks locally or remotely.
Options:
OptionDescriptionDefault
--name <name>Agent nameAuto-generated
--workspace <path>Workspace directory pathCurrent directory
--config <configKey>Specialty configuration keySYSOPS
--remote-exec <connection>Enable remote execution (user@host:port)None (local)
--remote-exec-type <type>Remote connection type: ssh or winrmssh
--remote-private-key <key>SSH private key for authentication~/.ssh/id_rsa
--remote-exec-password <password>Password for remote authenticationNone

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:
SSH with Custom Private Key:
SSH with Password:
Key-based authentication is recommended over passwords. WinRM for Windows:
WinRM typically uses port 5985 (HTTP) or 5986 (HTTPS). Complete Remote Example:
When initializing via CLI, the host is automatically registered in your account under the appropriate organization based on your API key’s scope.

agents

List and manage agents in the current workspace or across your machine.
Options:
OptionDescription
--workspace <path>List agents in specific workspace
--allList all agents on the machine
--flushClear cached agent data
Examples:
Shows agent names and IDs, associated workspaces, configuration details, and status.

query

Execute tasks by sending natural language instructions to agents. This is the primary command for assigning work.
or
Options:
OptionDescriptionDefault
--workspace <path>Execute in specific workspaceCurrent directory
--agentId <id>Target specific agent by IDWorkspace agent
Examples:
How it works: The query is sent to the specified agent. The secondary engine analyzes the task and creates an execution plan. The main engine executes on the target system. Real-time progress displays in the terminal with results shown upon completion. Tips: Be specific about what you want. Include relevant context like file paths or service names. Reference previous tasks when following up. Use natural language—the agent understands intent.

jobs

Monitor and manage jobs—coordinated multi-task operations created by gateways or manual orchestration.
Options:
OptionDescription
--workspace <path>Monitor jobs for specific workspace
--subscribeReceive continuous updates every minute
--unsubscribeStop receiving updates
--listenListen for and auto-execute new jobs from API
Examples:
Shows job ID and status, associated tasks and their states, progress information, and completion or failure details. Use for monitoring gateway-generated jobs, tracking multi-agent workflows, automating job execution in CI/CD pipelines, and observing fleet operations.

Best Practices

Query Construction: Be specific—“Restart nginx and verify it’s serving traffic” beats “fix nginx”. Include context like file paths and service names. Write queries as you would ask a colleague. Reference previous tasks when following up. 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. Job Monitoring: Use --subscribe for active monitoring during deployments. Use --listen for unattended automation. Check jobs regularly to track gateway-initiated workflows. Unsubscribe when done to reduce API calls.

Common Workflows

Initial Setup:
Development:
Production Operations:
CI/CD Integration:

Troubleshooting

Command Not Found: Verify CLI is installed with npm 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). Query Not Executing: Check agent status with @2501 agents. Verify workspace has an initialized agent. Try with explicit agent ID. Review task in Command Center for detailed errors. Job Subscription Not Working: Verify agent is initialized. Check API authentication. Ensure workspace path is correct. Try unsubscribing and resubscribing. For additional support, visit our Discord community or contact hello@2501.ai.

Next Steps

  • Learn about Agents configuration and management
  • Explore Tasks for execution details
  • Review Specialties for domain-specific configurations
  • Set up Gateways for automated task creation