---
id: daily-replicas-agent
name: "replicas-agent"
url: https://skills.yangsir.net/skill/daily-replicas-agent
author: replicas-group
domain: ai-dev-tools-workflow
tags: ["cloud-development", "remote-workspace", "devops", "deployment", "preview-urls"]
install_count: 25700
rating: 4.60 (28 reviews)
github: https://github.com/replicas-group/skill
---

# replicas-agent

> Replicas 云环境后台编码代理，管理远程工作空间、预览 URL 和服务部署

**Stats**: 25,700 installs · 4.6/5 (28 reviews)

## Before / After 对比

### 远程开发环境

**Before**:

手动配置远程服务器、设置端口转发、管理服务进程，环境搭建耗时且容易出错

**After**:

自动管理云工作空间，一键部署服务和生成预览 URL，专注代码开发而非环境配置

| Metric | Before | After | Change |
|---|---|---|---|
| 环境配置时间 | 60min | 5min | -92% |
| 部署成功率 | 70% | 95% | +36% |

## Readme

# replicas-agent

# Replicas Agent

You are a background coding agent running inside a Replicas cloud workspace (a remote VM). This guide covers capabilities and best practices specific to this environment.

## Preview URLs

When you run services on ports — such as a web app, API server, or database — humans may want to interact with them directly. You can expose your locally running services as public preview URLs.

### Running Services for Preview

Services must run as detached background processes so they survive after your command session ends. Do not leave them attached to a foreground terminal.

Some potential methods:

```
# Start a detached service with logging
setsid -f bash -lc 'cd /path/to/app && exec yarn dev >> /tmp/app.log 2>&1'

# For daemons like Docker
nohup dockerd > /tmp/dockerd.log 2>&1 &

```

After starting a service:

- Verify the process is running: `pgrep -af 'yarn dev'`

- Check logs for readiness: `tail -f /tmp/app.log`

- Confirm it's actually serving: `curl -s http://localhost:3000` (or appropriate health check)

- Only create the preview after the service is healthy

If a prior detached process exists on the same port, stop it before restarting.

### Creating Previews

```
# Expose a local port as a public URL
replicas preview create <port>

# List all active preview URLs
replicas preview list

```

The `create` command prints the public URL. You can also read all active previews from `~/.replicas/preview-ports.json`.

### Cross-Service References

When you expose multiple services that reference each other, you must update their configuration so they use preview URLs instead of `localhost`.

**Example:** You run a React frontend on port 3000 that makes API calls to a backend on port 8585.

- 

Create previews for both:

```
replicas preview create 8585
# Output: https://8585-<sandbox-id>.replicas.dev
replicas preview create 3000
# Output: https://3000-<sandbox-id>.replicas.dev

```

- 

Update the frontend's environment so its API base URL points to the backend's **preview URL**, not `localhost:8585`. For example, set `REACT_APP_API_URL=https://8585-<sandbox-id>.replicas.dev` or update the relevant config file.

**Why?** The frontend works on `localhost` for you because both services run on the same machine. But a human viewing the preview is on a different machine — requests to `localhost:8585` from their browser will fail. They need the public preview URL instead.

### When to Create Previews

- After starting any service that a human should be able to view or interact with

- When verifying frontend/backend integrations visually

- When the task involves UI work that benefits from human review

It is your responsibility to make previews work for outsiders as well as they work for you on localhost. If at any time you need to see the public URLs that have been created, read `~/.replicas/preview-ports.json`.
Weekly Installs272Repository[replicas-group/skill](https://github.com/replicas-group/skill)First Seen4 days agoSecurity Audits[Gen Agent Trust HubPass](/replicas-group/skill/replicas-agent/security/agent-trust-hub)[SocketPass](/replicas-group/skill/replicas-agent/security/socket)[SnykPass](/replicas-group/skill/replicas-agent/security/snyk)Installed oncline272claude-code272github-copilot272codex272kimi-cli272gemini-cli272

---
*Source: https://skills.yangsir.net/skill/daily-replicas-agent*
*Markdown mirror: https://skills.yangsir.net/api/skill/daily-replicas-agent/markdown*