@askalf/agent
Connect any device to the organism.
WebSocket bridge that registers your machine as a node in the AskAlf fleet. Once connected, autonomous agents dispatch tasks to your device — executed via Claude CLI or native shell. Your device becomes part of a AI workforce that thinks, heals, remembers, and evolves.
Part of AskAlf — an AI workforce that thinks, heals, remembers, and evolves with a nervous system, immune system, and collective memory.
Install
npm install -g @askalf/agent
One Command Setup
askalf-agent connect <your-api-key> --url ws://your-server:3005 --name prod-box --install
That's it. Config saved, service installed, runs on boot. Close the terminal — it keeps running.
What It Does
When connected, your device:
- Registers with the fleet via WebSocket
- Scans capabilities — CPU, RAM, 18 tools checked, Claude CLI detection
- Receives tasks dispatched by the fleet's unified scheduler
- Executes autonomously — Claude CLI or native shell
- Emits signals — confidence, urgency, stuck status flow to the nervous system
- Receives alerts — incident notifications, agent messages, signal broadcasts
- Reports results — output, tokens, cost, duration back to the fleet
- Streams progress — the dashboard sees output in real-time
Nervous System Integration
The agent participates in the fleet's nervous system:
Fleet Chief ──signal──> Your Device ──signal──> Watchdog
│ │ │
└──── agent:message ──────┘ │
│ │
└── incident:alert ──────┘
- Emits signals after every execution (success, stuck, urgency)
- Receives agent messages with urgency levels (CRITICAL / HIGH / INFO)
- Receives incident alerts when the immune system activates
- Receives signal broadcasts from fleet-wide awareness
Service Installation
askalf-agent install-service
| Linux | systemd unit | On boot |
| macOS | launchd plist | On login |
| Windows | Scheduled Task (or nssm) | On login |
Commands
askalf-agent connect <key> Connect to fleet
askalf-agent connect <key> --install Connect + install as service
askalf-agent doctor Diagnose and fix setup issues
askalf-agent install-service Install as OS service
askalf-agent uninstall-service Remove OS service
askalf-agent daemon Background daemon
askalf-agent status Connection + service status
askalf-agent scan Local capabilities scan
askalf-agent disconnect Stop daemon
Options
--url <url> | Server WebSocket URL | wss://askalf.org |
--name <name> | Device display name | System hostname |
--install | Install as service after connecting | |
-v, --version | Show version | |
-h, --help | Show help | |
How It Works
Your Device AskAlf Fleet
┌──────────────┐ WSS ┌────────────────────┐
│ askalf-agent │◄──────────►│ Forge Orchestrator │
│ │ │ Unified Scheduler │
│ Claude CLI │ signals │ Nervous System │
│ Shell │◄──────────►│ Immune System │
│ Your Tools │ messages │ Collective Memory │
└──────────────┘ └────────────────────┘
- Heartbeat every 30s with memory usage and uptime
- Auto-reconnect with exponential backoff (2s → 60s max)
- Capabilities scan — responds to server requests with full system info
- 10 minute timeout per execution (configurable)
- Progress streaming — real-time output to dashboard
Programmatic Usage
import { AgentBridge, scanCapabilities } from '@askalf/agent';
const caps = scanCapabilities();
console.log(caps);
const bridge = new AgentBridge({
apiKey: 'your-api-key',
url: 'ws://your-server:3005',
deviceName: 'my-server',
hostname: 'prod-01',
os: 'Linux 6.1',
capabilities: caps,
});
await bridge.connect();
Requirements
- Node.js 22+
- Claude Code for AI execution (
npm i -g @anthropic-ai/claude-code)
- An AskAlf instance (
npx create-askalf or curl -fsSL https://get.askalf.org | bash)
Links
MIT — askalf.org