{"_id":"sandbox-cli-detector","_rev":"7-da3cc178247da522481b300fa70442f9","name":"sandbox-cli-detector","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"sandbox-cli-detector","version":"0.1.0","keywords":["sandbox","detect","e2b","vercel-sandbox","replit","daytona","modal","codespaces","gitpod","cli","environment"],"author":{"name":"David Mokos"},"license":"MIT","_id":"sandbox-cli-detector@0.1.0","maintainers":[{"name":"davidmokos","email":"davidmokos@gmail.com"}],"homepage":"https://github.com/davidmokos/sandbox-cli-detector#readme","bugs":{"url":"https://github.com/davidmokos/sandbox-cli-detector/issues"},"bin":{"sandbox-cli-detector":"dist/cli.js"},"dist":{"shasum":"3237e37d57cd584ac7ea55702546c8cd8170ed7b","tarball":"https://registry.npmjs.org/sandbox-cli-detector/-/sandbox-cli-detector-0.1.0.tgz","fileCount":17,"integrity":"sha512-7ns6yiuTgzvsLxm02h4XVMnsvdnv887IW56dXfjp3rMCnHq4iDd37kN7du97hywC1imPeZEFO3YuJ3JdM4tWBw==","signatures":[{"sig":"MEQCIHN/QDrFfbd2p5fwODedBCntIZdCtxKe7x6hcnUq+4TjAiBFBOBFmt7b0yv11DO1V43SCiglFG6BRlx6DqX5tmvauw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":69246},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f1df646b3668fd6c1b1d03f1e70afa3b4288413a","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"npm run build && vitest run","build":"tsup && node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755)\"","clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","prepack":"npm run clean && npm run lint && npm test","test:watch":"vitest"},"_npmUser":{"name":"davidmokos","email":"davidmokos@gmail.com"},"repository":{"url":"git+https://github.com/davidmokos/sandbox-cli-detector.git","type":"git"},"_npmVersion":"11.6.2","description":"Detect whether a CLI is running inside a sandboxed environment (E2B, Vercel Sandbox, Replit, Daytona, Modal, and more)","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.0.0","typescript":"^5.7.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sandbox-cli-detector_0.1.0_1784298715324_0.8017538934752007","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"sandbox-cli-detector","version":"0.1.1","keywords":["sandbox","detect","e2b","vercel-sandbox","replit","daytona","modal","codespaces","gitpod","cli","environment"],"author":{"name":"David Mokos"},"license":"MIT","_id":"sandbox-cli-detector@0.1.1","maintainers":[{"name":"davidmokos","email":"davidmokos@gmail.com"}],"homepage":"https://github.com/davidmokos/sandbox-cli-detector#readme","bugs":{"url":"https://github.com/davidmokos/sandbox-cli-detector/issues"},"bin":{"sandbox-cli-detector":"dist/cli.js"},"dist":{"shasum":"aa126cb476025a9f9489f60dac02e2f31ffbe9ac","tarball":"https://registry.npmjs.org/sandbox-cli-detector/-/sandbox-cli-detector-0.1.1.tgz","fileCount":17,"integrity":"sha512-WEC6pcmR62ceW4F+84FIbOzt3+qovC0oQzZ6SkXoGd8Ves5hOQH2I10v3jq0JDN/dNi0n/dQ6CtxpuEmDRbIrw==","signatures":[{"sig":"MEUCIDqevikX0xlaz52L6JhB8kyRNpdQLHIuFL2F9uk0hP8GAiEAhSXTFpIzK2FqURpkAGWjcnLsM+eMadtzdNhHDtdTWxU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":71837},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"43d165b58ddc441a16401bea04915693015036ae","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"npm run build && vitest run","build":"tsup && node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755)\"","clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","prepack":"npm run clean && npm run lint && npm test","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e5b52415-57d6-4c42-8914-d1fe0689a96a"}},"repository":{"url":"git+https://github.com/davidmokos/sandbox-cli-detector.git","type":"git"},"_npmVersion":"12.0.1","description":"Detect whether a CLI is running inside a sandboxed environment (E2B, Vercel Sandbox, Replit, Daytona, Modal, and more)","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.0.0","typescript":"^5.7.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sandbox-cli-detector_0.1.1_1784305140544_0.5255915431117957","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"sandbox-cli-detector","version":"0.2.0","keywords":["sandbox","detect","e2b","vercel-sandbox","replit","daytona","modal","codespaces","gitpod","cli","environment"],"author":{"name":"David Mokos"},"license":"MIT","_id":"sandbox-cli-detector@0.2.0","maintainers":[{"name":"davidmokos","email":"davidmokos@gmail.com"}],"homepage":"https://github.com/davidmokos/sandbox-cli-detector#readme","bugs":{"url":"https://github.com/davidmokos/sandbox-cli-detector/issues"},"bin":{"sandbox-cli-detector":"dist/cli.js"},"dist":{"shasum":"ebf563e4e994ff485e3ed9314b1a110c913aa5e8","tarball":"https://registry.npmjs.org/sandbox-cli-detector/-/sandbox-cli-detector-0.2.0.tgz","fileCount":17,"integrity":"sha512-4lyHX0ZU0AZKwjgZ1InxZAa3PNpyEb8rOQ+Zss1ReYmhNzW0Q+h1zE5nvniXN0HaAWZaZE1zgVNEirb0R7LmNg==","signatures":[{"sig":"MEQCIDdJrnuTsI1h4m/6/3fnffnQpWFiEkXnd04CtRSlqhIqAiBeZcVVHnK386iZvdl1y259uZ4LIH/gmK/kofg9J1E19A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/sandbox-cli-detector@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":31999},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.18"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"0cdc7148f4c2708e9c8112946b54c45fd80e779b","scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"npm run build && vitest run","build":"tsup && node -e \"require('node:fs').chmodSync('dist/cli.js', 0o755)\"","clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","prepack":"npm run clean && npm run lint && npm test","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:e5b52415-57d6-4c42-8914-d1fe0689a96a"}},"repository":{"url":"git+https://github.com/davidmokos/sandbox-cli-detector.git","type":"git"},"_npmVersion":"12.0.1","description":"Detect whether a CLI is running inside a sandboxed environment","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^3.0.0","typescript":"^5.7.2","@types/node":"^26.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sandbox-cli-detector_0.2.0_1784386761475_0.799819853476587","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-07-17T14:31:55.273Z","modified":"2026-09-23T11:28:48.441Z","0.1.0":"2026-07-17T14:31:55.468Z","0.1.1":"2026-07-17T16:19:00.680Z","0.2.0":"2026-07-18T14:59:21.605Z"},"bugs":{"url":"https://github.com/davidmokos/sandbox-cli-detector/issues"},"author":{"name":"David Mokos"},"license":"MIT","homepage":"https://github.com/davidmokos/sandbox-cli-detector#readme","keywords":["sandbox","detect","e2b","vercel-sandbox","replit","daytona","modal","codespaces","gitpod","cli","environment"],"repository":{"url":"git+https://github.com/davidmokos/sandbox-cli-detector.git","type":"git"},"description":"Detect whether a CLI is running inside a sandboxed environment","maintainers":[{"email":"ide+npm@jameside.com","name":"ide"},{"email":"brentvatne@gmail.com","name":"brentvatne"},{"email":"support@expo.io","name":"expoadmin"},{"email":"exponent.team@gmail.com","name":"exponent"},{"email":"me@bycedric.com","name":"bycedric"},{"email":"ckchien@gmail.com","name":"kudochien"},{"email":"hughesno1@gmail.com","name":"alanhughes"},{"email":"npm@tsapeta.com","name":"tsapeta"},{"email":"brent+expobotnpm@expo.io","name":"expo-bot"},{"email":"phil@kitten.sh","name":"philpl"},{"email":"ccheever@gmail.com","name":"ccheever"},{"email":"sz.dziedz@gmail.com","name":"szdziedzic"},{"email":"wschurman@gmail.com","name":"wschurman"},{"email":"davidmokos@gmail.com","name":"davidmokos"}],"readme":"# sandbox-cli-detector\n\nDetect whether the current process is running inside a sandboxed developer\nenvironment.\n\nPlease [open an issue](https://github.com/davidmokos/sandbox-cli-detector/issues/new)\nif your sandbox is not properly detected.\n\n[![npm](https://img.shields.io/npm/v/sandbox-cli-detector.svg)](https://www.npmjs.com/package/sandbox-cli-detector)\n[![Tests](https://github.com/davidmokos/sandbox-cli-detector/actions/workflows/test.yml/badge.svg)](https://github.com/davidmokos/sandbox-cli-detector/actions/workflows/test.yml)\n[![License](https://img.shields.io/npm/l/sandbox-cli-detector.svg)](LICENSE)\n\n## Installation\n\n```sh\nnpm install sandbox-cli-detector\n```\n\n## Usage\n\n```ts\nimport { detectSandbox } from \"sandbox-cli-detector\";\n\nconst result = detectSandbox();\n\nif (result.detected && result.sandbox) {\n  console.log(\"The name of the sandbox is:\", result.sandbox.name);\n} else {\n  console.log(\"This program is not running inside a known sandbox\");\n}\n```\n\n## Supported sandboxes\n\nOfficially supported sandbox environments:\n\n| Name | ID |\n| --- | --- |\n| [Replit](https://replit.com) | `replit` |\n| [bolt.new](https://bolt.new) | `bolt` |\n| [E2B](https://e2b.dev) | `e2b` |\n| [Vercel Sandbox](https://vercel.com/docs/sandbox) | `vercel-sandbox` |\n| [Daytona](https://daytona.io) | `daytona` |\n| [Modal](https://modal.com) | `modal` |\n| [Cloudflare Sandbox](https://developers.cloudflare.com/sandbox/) | `cloudflare-sandbox` |\n| [GitHub Codespaces](https://github.com/features/codespaces) | `codespaces` |\n| [CodeSandbox](https://codesandbox.io) | `codesandbox` |\n\nDetection is data-driven. The exact environment variables for each sandbox\nlive in [`src/sandboxes.ts`](src/sandboxes.ts).\n\n## API\n\n### `detectSandbox(options?)`\n\nReturns a detection result:\n\n```ts\n{\n  detected: true,\n  sandbox: {\n    id: \"e2b\",\n    name: \"E2B\"\n  }\n}\n```\n\nWhen no sandbox is detected, it returns `{ detected: false }`.\n\n### `result.detected`\n\nA boolean that is `true` when the process is running inside a known sandbox and\n`false` otherwise.\n\n### `result.sandbox.id`\n\nA stable identifier for the detected sandbox. Prefer comparing this value over\n`result.sandbox.name`.\n\n### `result.sandbox.name`\n\nThe display name of the detected sandbox. This may change without it being a\nbreaking change.\n\n### `isRunningInSandbox(options?)`\n\nA convenience function that returns `result.detected` as a boolean:\n\n```ts\nimport { isRunningInSandbox } from \"sandbox-cli-detector\";\n\nif (isRunningInSandbox()) {\n  // Adjust CLI behavior for sandboxed execution.\n}\n```\n\n### Custom sandboxes\n\nPass custom definitions when you need to detect an internal environment:\n\n```ts\nimport { defaultSandboxes, detectSandbox } from \"sandbox-cli-detector\";\n\nconst result = detectSandbox({\n  sandboxes: [\n    {\n      id: \"internal\",\n      name: \"Internal Sandbox\",\n      env: [{ name: \"INTERNAL_SANDBOX\", value: \"true\" }],\n    },\n    ...defaultSandboxes,\n  ],\n});\n```\n\nEach environment signal matches either an exact `value` or any non-empty value\nwhen `value` is omitted. If multiple sandboxes match, the first definition is\nreturned.\n\n## CLI\n\nThe package also ships a CLI:\n\n```sh\nnpx sandbox-cli-detector\nnpx sandbox-cli-detector --json\nnpx sandbox-cli-detector --quiet\n```\n\nIt exits with `0` when a sandbox is detected and `1` otherwise.\n\n## Contributing detections\n\nPlease include the platform name, a redacted `env | sort` captured inside the\nplatform, and the variables that identify it.\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}