Community translations by veiseule.ai — Help improve them on Crowdin
Skip to main content

Sandbox CLI

الگ تھلگ ایجنٹ اجرا کے لیے Docker پر مبنی sandbox کنٹینرز کا انتظام کریں۔

جائزہ

OpenClaw سیکیورٹی کے لیے ایجنٹس کو الگ تھلگ Docker کنٹینرز میں چلا سکتا ہے۔ 9. sandbox کمانڈز آپ کو ان کنٹینرز کو منظم کرنے میں مدد دیتی ہیں، خاص طور پر اپڈیٹس یا کنفیگریشن تبدیلیوں کے بعد۔

کمانڈز

openclaw sandbox explain

مؤثر سینڈباکس موڈ/اسکوپ/ورک اسپیس رسائی، سینڈباکس ٹول پالیسی، اور elevated gates (fix-it کنفیگ کلید کے راستوں کے ساتھ) کا معائنہ کریں۔

openclaw sandbox explain
openclaw sandbox explain --session agent:main:main
openclaw sandbox explain --agent work
openclaw sandbox explain --json

openclaw sandbox list

تمام سینڈباکس کنٹینرز کو ان کی حالت اور کنفیگریشن کے ساتھ فہرست کریں۔

openclaw sandbox list
openclaw sandbox list --browser  # List only browser containers
openclaw sandbox list --json     # JSON output

آؤٹ پٹ میں شامل ہے:

  • کنٹینر کا نام اور حالت (چل رہا/روکا ہوا)
  • Docker امیج اور آیا یہ کنفیگ سے مطابقت رکھتا ہے یا نہیں
  • عمر (تخلیق کے بعد سے وقت)
  • غیر فعالی کا وقت (آخری استعمال کے بعد سے وقت)
  • منسلک سیشن/ایجنٹ

openclaw sandbox recreate

اپڈیٹ شدہ امیجز/کنفیگ کے ساتھ دوبارہ تخلیق کو مجبور کرنے کے لیے سینڈباکس کنٹینرز ہٹائیں۔

openclaw sandbox recreate --all                # Recreate all containers
openclaw sandbox recreate --session main       # Specific session
openclaw sandbox recreate --agent mybot        # Specific agent
openclaw sandbox recreate --browser            # Only browser containers
openclaw sandbox recreate --all --force        # Skip confirmation

اختیارات:

  • --all: تمام سینڈباکس کنٹینرز دوبارہ تخلیق کریں
  • --session <key>: مخصوص سیشن کے لیے کنٹینر دوبارہ تخلیق کریں
  • --agent <id>: مخصوص ایجنٹ کے لیے کنٹینرز دوبارہ تخلیق کریں
  • --browser: صرف براؤزر کنٹینرز دوبارہ تخلیق کریں
  • --force: تصدیقی پرامپٹ چھوڑ دیں

Important: ایجنٹ کے اگلی بار استعمال ہونے پر کنٹینرز خودکار طور پر دوبارہ تخلیق ہو جاتے ہیں۔

استعمال کے کیسز

Docker امیجز اپڈیٹ کرنے کے بعد

# Pull new image
docker pull openclaw-sandbox:latest
docker tag openclaw-sandbox:latest openclaw-sandbox:bookworm-slim

# Update config to use new image
# Edit config: agents.defaults.sandbox.docker.image (or agents.list[].sandbox.docker.image)

# Recreate containers
openclaw sandbox recreate --all

سینڈباکس کنفیگریشن تبدیل کرنے کے بعد

# Edit config: agents.defaults.sandbox.* (or agents.list[].sandbox.*)

# Recreate to apply new config
openclaw sandbox recreate --all

setupCommand تبدیل کرنے کے بعد

openclaw sandbox recreate --all
# or just one agent:
openclaw sandbox recreate --agent family

صرف کسی مخصوص ایجنٹ کے لیے

# Update only one agent's containers
openclaw sandbox recreate --agent alfred

یہ کیوں ضروری ہے؟

Problem: جب آپ سینڈباکس Docker امیجز یا کنفیگریشن اپڈیٹ کرتے ہیں:

  • موجودہ کنٹینرز پرانی ترتیبات کے ساتھ چلتے رہتے ہیں
  • کنٹینرز صرف 24 گھنٹے غیر فعالی کے بعد prune ہوتے ہیں
  • باقاعدہ استعمال ہونے والے ایجنٹس پرانے کنٹینرز کو غیر معینہ مدت تک چلاتے رہتے ہیں

حل: پرانے کنٹینرز کو زبردستی ہٹانے کے لیے openclaw sandbox recreate استعمال کریں۔ اگلی بار ضرورت پڑنے پر وہ موجودہ ترتیبات کے ساتھ خود بخود دوبارہ بنا دیے جائیں گے۔

مشورہ: دستی docker rm پر openclaw sandbox recreate کو ترجیح دیں۔ یہ استعمال کرتا ہے Gateway’s container naming and avoids mismatches when scope/session keys change.

Configuration

سینڈباکس کی ترتیبات ~/.openclaw/openclaw.json میں agents.defaults.sandbox کے تحت موجود ہوتی ہیں (ہر ایجنٹ کے لیے overrides agents.list[].sandbox میں جاتی ہیں):

{
  "agents": {
    "defaults": {
      "sandbox": {
        "mode": "all", // off, non-main, all
        "scope": "agent", // session, agent, shared
        "docker": {
          "image": "openclaw-sandbox:bookworm-slim",
          "containerPrefix": "openclaw-sbx-",
          // ... more Docker options
        },
        "prune": {
          "idleHours": 24, // Auto-prune after 24h idle
          "maxAgeDays": 7, // Auto-prune after 7 days
        },
      },
    },
  },
}

See Also