Deskmate
Control your device from anywhere using natural language.
Installation
npx deskmateAsk AI about Deskmate
Powered by Claude Β· Grounded in docs
I know everything about Deskmate. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Deskmate
Control your Local Machine from anywhere using natural language.
Deskmate is a local execution agent that lets you control your personal machine using natural language and talks to you on the channels you already use. Deskmate focuses on execution, not autonomy or orchestration. Send a Telegram message from your phone, and it executes on your machine. Supports multiple agent backends β Claude Code, Codex (OpenAI), Gemini CLI, and OpenCode β with full local tool access, no sandboxed command set, no artificial limits.
A passion project developed, born from a simple goal: staying in creative and developer flow even when I'm not sitting at my desk. Inspired by gen-shell.
Getting Started Β· Gateway Mode Β· Agent Providers Β· Architecture Β· Discord
Demo
| Telegram Conversation | Installation |
|---|---|
![]() | ![]() |
How it works
Telegram / Discord* / Slack* / ...
|
v
+-------------------+
| Gateway | auth, sessions, approval routing
| (control plane) |
+--------+----------+
|
v
+-------------------+
| Agent Provider | Claude Code | Codex | Gemini | OpenCode
| (pluggable) | full local tool access
+-------------------+
|
v
Your Machine
(executes tasks)
*Discord and Slack adapters are planned β see Adding a new client.
The Gateway is the control plane. Each messaging platform is a thin I/O adapter. The agent has unrestricted access to your machine (approve-by-default), with optional approval gating for protected folders.
Responsibility Boundary
Deskmate's responsibility is execution.
- It turns intent into concrete system actions
- It does not coordinate other agents
Highlights
- Full local access β the agent can run any command, read/write any file, take screenshots. No artificial 6-tool sandbox.
- Multi-channel gateway β Telegram today, Discord/Slack/WhatsApp tomorrow. One Gateway, many clients.
- Conversation memory β session continuity across messages. Ask follow-up questions naturally.
- Multi-agent backends β ships with Claude Code (default), Codex (OpenAI), Gemini CLI (Google), and OpenCode. Switch with
AGENT_PROVIDER=codexin.env. - Approve-by-default β safe commands auto-approve. Protected folders (Desktop, Documents, etc.) prompt for confirmation via inline buttons.
- MCP server β expose your machine as a tool server for Claude Desktop or any MCP client.
- Skills system β define reusable multi-step workflows in
skills.json. Skills can run commands, agent prompts, or other skills. Hot-reloaded on change. - Cron scheduler β schedule recurring jobs (commands, agent queries, or skills) via
crons.json. Results are delivered to your active chat channels. - Health monitoring β built-in health checks for CPU, memory, disk, agent availability. Accessible via
/healthin Telegram,deskmate healthon CLI, or theget_healthMCP tool. - Docker container mode β run the core in Docker with a native sidecar for host commands. Set
INSTALL_MODE=containerand usedocker-compose up. - Runs as service β launchd (macOS) or systemd (Linux) integration, starts on boot, restarts on crash.
- Extensible agent layer β bring your own agent via
registerProvider().
Requirements
- macOS (tested on Ventura, Sonoma, Sequoia) or Linux (with systemd)
- Windows via WSL2
- Node.js 18+
- One of the supported agent CLIs installed (see Agent Providers)
- Telegram account (for Telegram mode)
- API key for your chosen provider (Anthropic, OpenAI, or Google β OpenCode manages its own auth)
Linux Prerequisites
- Screenshots: Install ImageMagick (
sudo apt install imagemagick) for screenshot support - Service: systemd with user session support (
systemctl --user)
macOS Permissions
The installer guides you through these (macOS only). You can also configure them manually in System Settings > Privacy & Security.
| Permission | Purpose |
|---|---|
| Screen Recording | Take screenshots when requested |
| Accessibility | Control system functions |
| Full Disk Access | Read/write files in protected locations |
| Automation | Control other applications via AppleScript |
| Background Items | Run as a background service at login |
| Folder Access | Access to Desktop, Documents, Downloads, etc. |
Quick Start
Option A: Install from npm (recommended)
npm install -g @sarkar-ai/deskmate
deskmate init
The wizard walks you through everything: API keys, Telegram credentials,
platform permissions, and background service setup. Config is stored in
~/.config/deskmate/.env.
After setup, run manually with deskmate or let the background service handle it.
Option B: Install from source (for contributors)
git clone https://github.com/sarkar-ai-taken/deskmate.git
cd deskmate
npm install --legacy-peer-deps
npm run build
./install.sh # interactive: configures .env, service, permissions
Or use the TypeScript wizard instead of the shell installer:
cp .env.example .env # edit with your credentials
npx deskmate init # or: npm link && deskmate init
To reconfigure later: deskmate init
Running Modes
| Mode | Command | Description |
|---|---|---|
| Gateway | deskmate | Multi-client gateway (default) |
| MCP | deskmate mcp | MCP server for Claude Desktop |
| Both | deskmate both | Gateway + MCP simultaneously |
| Sidecar | deskmate sidecar | Host sidecar for container mode |
Note:
deskmate telegramstill works but is a deprecated alias that starts the gateway.
Gateway Mode
The gateway is the default way to run Deskmate. It separates platform I/O from agent logic, so adding a new messaging client doesn't require touching auth, sessions, or the agent layer.
# Configure multi-client auth
ALLOWED_USERS=telegram:123456,discord:987654321
# Start
deskmate
The gateway auto-registers clients based on available env vars. If TELEGRAM_BOT_TOKEN is set, Telegram is active. Future clients (Discord, Slack) follow the same pattern.
Bot Commands
| Command | Description |
|---|---|
/start | Show welcome message |
/screenshot | Take a screenshot and send it |
/status | Show system info and session status |
/health | Show system health and resource metrics |
/skill | List or run a registered skill |
/cron | Show cron job status |
/reset | Clear conversation memory |
Usage Examples
System management β "Show disk usage", "What processes are using the most CPU?", "List all running Docker containers"
File operations β "Show me the contents of package.json", "Find all TypeScript files in src/", "Create a new file called notes.txt with today's date"
Development β "Run the tests", "What's the git status?", "Show me recent commits"
Troubleshooting β "What's using port 8080?", "Show me the last 50 lines of the error log", "Check if nginx is running"
Visual β "Take a screenshot", "Show me what's on the screen"
| Taking a Screenshot | Opening Google Meet |
|---|---|
![]() | ![]() |
MCP Server
The MCP server exposes your machine as a tool server for Claude Desktop or any MCP client.
Setup with Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"deskmate": {
"command": "node",
"args": ["/path/to/deskmate/dist/index.js", "mcp"],
"env": {
"WORKING_DIR": "/Users/yourname"
}
}
}
}
Restart Claude Desktop. You can now ask Claude to interact with your local machine.
Combined Mode (Gateway + MCP)
Run both with deskmate both. MCP handles Claude Desktop requests; the gateway handles Telegram (and future clients), sending approval notifications to your phone so you can approve sensitive operations from anywhere.
Observability
Deskmate focuses on executing actions safely.
For monitoring agent behavior, resource usage, and failures across multiple local agents, see Riva (local-first agent observability).
Skills
Skills are reusable multi-step workflows defined in JSON. Place a skills.json in your project root or ~/.config/deskmate/skills.json for global skills. Skills hot-reload when the file changes.
{
"version": 1,
"skills": [
{
"name": "deploy",
"description": "Build and deploy the project",
"parameters": [{ "name": "env", "required": true }],
"steps": [
{ "type": "command", "command": "npm run build" },
{ "type": "command", "command": "./deploy.sh {{env}}" }
]
}
]
}
Each step can be a command (shell), prompt (agent query), or skill (nested skill). Run via /skill deploy env=staging in Telegram or the run_skill MCP tool.
Cron Jobs
Schedule recurring jobs via crons.json (project-local or ~/.config/deskmate/crons.json).
{
"version": 1,
"jobs": [
{
"name": "daily-backup",
"schedule": "0 2 * * *",
"action": { "type": "command", "command": "tar czf ~/backup.tar.gz ~/Documents" },
"notify": true
}
]
}
Actions can be command, agent_query (natural language prompt), or skill. Set notify: true to receive results in your active chat channels. Check status with /cron in Telegram or list_cron_jobs MCP tool.
Security
Important: The agent can execute arbitrary commands on your machine. This is by design β the strategy is approve-by-default for read-only operations, with approval gating for protected folders and write operations.
Built-in protections
| Layer | What it does |
|---|---|
| User authentication | Allowlist-based access control via SecurityManager. Only users in ALLOWED_USERS can interact. Supports per-client auth (telegram:123, discord:456) and wildcards (*:*). |
| Action approval | ApprovalManager gates sensitive operations. Write commands, file writes, and folder access require explicit human approval with configurable timeouts (default 5 min). |
| Protected folders | OS-aware folder protection. Desktop, Documents, Downloads, Pictures, Movies/Videos, Music, and iCloud (macOS) require approval. Session-based caching avoids repeated prompts. |
| Safe command auto-approval | Read-only commands (ls, cat, git status, docker ps, node -v, etc.) auto-approve. Full list in src/core/approval.ts. |
| Command execution limits | 2-minute timeout and 10 MB output buffer per command. Prevents runaway processes and memory exhaustion. |
| Session isolation | Sessions keyed by clientType:channelId. 30-minute idle timeout with automatic pruning. Optional disk persistence survives restarts. |
| Input validation | MCP tools use Zod schema validation. Telegram callbacks validated via regex patterns. |
| No open ports | The bot polls Telegram's servers β no inbound ports exposed. |
| No sudo by default | The agent won't use sudo unless you explicitly ask. |
| Structured logging | All actions logged with timestamps, context hierarchy, and configurable log levels for audit trails. |
| Stale message protection | Telegram client drops pending updates on startup (drop_pending_updates: true), preventing replay of messages received while offline. |
Approval workflow
- User sends a message that triggers a sensitive operation (e.g., writing to
~/Documents) ApprovalManagerchecks if the action matches a safe auto-approve pattern- If not safe, a pending approval is created with a timeout countdown
- Approval request is broadcast to all clients with recent activity (last 30 min)
- User taps Approve/Reject via inline buttons (Telegram) or equivalent
- Action executes on approval, or is cancelled on rejection/timeout
Set REQUIRE_APPROVAL_FOR_ALL=true to gate every operation, including reads.
Recommendations
- Set
WORKING_DIRto limit default command scope - Use
ALLOWED_USERSfor multi-client allowlisting - Use
ALLOWED_FOLDERSto pre-approve specific directories - Review logs regularly (
logs/stdout.log) - Keep
.envsecure and never commit it - Use
REQUIRE_APPROVAL_FOR_ALL=trueif you want to approve every operation
Execution Philosophy
Deskmate follows an approve-by-default, visible-by-design model.
- Read-only operations are auto-approved
- Sensitive operations require explicit confirmation
- All actions are logged locally
The goal is speed without hidden behavior.
Non-goals
Deskmate is intentionally not:
- A multi-agent orchestration framework
- A cloud-hosted control plane
- A long-running autonomous system
These constraints are deliberate.
Agent Providers
Deskmate supports multiple agent backends. Set AGENT_PROVIDER in your .env or select one during deskmate init.
| Provider | Binary | Env Var | Install |
|---|---|---|---|
| Claude Code (default) | claude | ANTHROPIC_API_KEY | docs.anthropic.com |
| Codex (OpenAI) | codex | OPENAI_API_KEY | github.com/openai/codex |
| Gemini CLI (Google) | gemini | GEMINI_API_KEY | github.com/google-gemini/gemini-cli |
| OpenCode | opencode | (manages own auth) | github.com/opencode-ai/opencode |
# Switch provider
AGENT_PROVIDER=codex
OPENAI_API_KEY=sk-...
# Or use the wizard
deskmate init
Only the API key matching your selected provider is required. Keys for other providers are preserved in .env if you switch back.
Architecture
src/
βββ core/
β βββ agent/
β β βββ types.ts # AgentProvider interface
β β βββ factory.ts # Provider factory + registerProvider()
β β βββ providers/
β β βββ claude-code.ts # Claude Code SDK (default)
β β βββ base-cli.ts # Base class for CLI-spawned providers
β β βββ codex.ts # Codex (OpenAI)
β β βββ gemini.ts # Gemini CLI (Google)
β β βββ opencode.ts # OpenCode
β βββ approval.ts # Approval manager (auto-approve + manual)
β βββ executor.ts # Command execution, file I/O, screenshots
β βββ executor-factory.ts # Creates local or remote executor
β βββ executor-interface.ts # IExecutor interface
β βββ remote-executor.ts # Executor that delegates to sidecar
β βββ health.ts # Health monitoring (CPU, memory, disk, agent)
β βββ skills/ # Skills system
β β βββ types.ts # Skill definition schema (Zod)
β β βββ registry.ts # Loads skills.json, hot-reloads on change
β β βββ executor.ts # Runs multi-step skill workflows
β βββ cron/ # Cron scheduler
β β βββ types.ts # Cron job definition schema (Zod)
β β βββ scheduler.ts # node-cron based job runner
β βββ logger.ts # Structured logging
βββ gateway/
β βββ types.ts # MessagingClient, MessageHandler interfaces
β βββ gateway.ts # Central coordinator
β βββ security.ts # Multi-client allowlist auth
β βββ session.ts # Session manager (composite keys, idle pruning)
βββ clients/
β βββ telegram.ts # Telegram adapter (grammY)
βββ sidecar/ # Host sidecar for container mode
β βββ server.ts # Express server exposing executor over HTTP
β βββ cli.ts # Sidecar CLI entry point
βββ mcp/
βββ server.ts # MCP server
Agent layer β ships with four providers: Claude Code (via @anthropic-ai/claude-agent-sdk), Codex, Gemini CLI, and OpenCode. The three non-Claude providers extend BaseCliProvider, which handles subprocess spawning and stdout streaming. Custom agent providers can be registered via registerProvider().
Gateway layer β central coordinator handling auth (SecurityManager), sessions (SessionManager), agent orchestration, approval routing, and screenshot delivery. Platform adapters implement the MessagingClient interface and do only I/O.
Adding a new client
- Create
src/clients/discord.tsimplementingMessagingClient(seesrc/gateway/types.ts) - Add
DISCORD_BOT_TOKENto.env - Add
discord:userIdtoALLOWED_USERS - Register in the gateway startup:
gateway.registerClient(new DiscordClient(token))
No changes to Gateway, SecurityManager, SessionManager, or the agent layer.
Bringing your own agent
import { AgentProvider, registerProvider } from "./core/agent";
class MyAgent implements AgentProvider {
readonly name = "my-agent";
readonly version = "1.0.0";
// implement query(), queryStream(), isAvailable()
}
registerProvider("my-agent", MyAgent);
// then set AGENT_PROVIDER=my-agent in .env
CLI Commands
| Command | Description |
|---|---|
deskmate | Start the gateway (default mode) |
deskmate init | Interactive setup wizard |
deskmate status | Show service status and config validation |
deskmate health | Show system health and resource metrics |
deskmate logs | Tail stdout.log (--stderr for error log) |
deskmate restart | Restart the background service |
deskmate doctor | Run diagnostic checks |
deskmate sidecar | Start the host sidecar (container mode) |
Docker / Container Mode
Run Deskmate in a Docker container with a native sidecar handling host-level commands (screenshots, file access).
# Set install mode
INSTALL_MODE=container
# Start the sidecar on the host
deskmate sidecar
# Start the container
docker-compose up -d
The Dockerfile and docker-compose.yml are included in the package. The sidecar exposes a local HTTP API that the containerized core uses to execute commands on the host.
Service Management
macOS (launchd)
# View logs
tail -f logs/stdout.log
tail -f logs/stderr.log
# Stop the service
launchctl unload ~/Library/LaunchAgents/com.deskmate.service.plist
# Start the service
launchctl load ~/Library/LaunchAgents/com.deskmate.service.plist
# Check status
launchctl list | grep deskmate
Linux (systemd)
# View logs
tail -f logs/stdout.log
journalctl --user -u deskmate.service -f
# Stop / start / restart
systemctl --user stop deskmate.service
systemctl --user start deskmate.service
systemctl --user restart deskmate.service
# Check status
systemctl --user status deskmate.service
Uninstall
./uninstall.sh
Troubleshooting
Bot not responding?
- Check logs:
tail -f logs/stderr.log - Verify your
ALLOWED_USERSincludes your Telegram ID (e.g.telegram:123456) - Ensure your agent CLI is installed (e.g.
which claude,which codex,which gemini,which opencode) - Run
deskmate doctorto diagnose configuration issues
Commands timing out?
- Default timeout is 2 minutes
- Long-running commands may need adjustment
Machine going to sleep?
- macOS: Run
./install.shto configure sleep prevention, or manually:sudo pmset -c sleep 0 - Linux: The systemd service uses idle inhibitor. Check your desktop environment's power settings.
Permission denied errors? (macOS)
- Re-run
./install.shand go through the permissions setup - Or manually grant permissions in System Settings > Privacy & Security
Screenshots not working?
- macOS: Grant Screen Recording permission in System Settings > Privacy & Security > Screen Recording
- Linux: Install ImageMagick (
sudo apt install imagemagick) - Restart the service after making changes
Future Work / Help Wanted
Additional messaging clients β the gateway architecture is ready. We'd welcome:
discordβ Discord bot via discord.jsslackβ Slack app via Bolt SDKwhatsappβ WhatsApp via the Business API
Background job handling β the current launchd (macOS) + systemd (Linux) approach works but could be improved for different device types (always-on Mac Mini vs MacBook, headless Linux servers).
Open an issue to discuss your approach.
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
See DEVELOPMENT.md for architecture details and local setup.
License
MIT License β see LICENSE for details.
Acknowledgments
- Claude Agent SDK β default agent runtime
- Codex β OpenAI agent backend
- Gemini CLI β Google agent backend
- OpenCode β OpenCode agent backend
- grammY β Telegram bot framework
- @modelcontextprotocol/sdk β MCP support
Community
- Discord β join the community, ask questions, share your setup
Share
If you find Deskmate useful, feel free to share:



