{"id":18229,"library":"codesandbox","title":"CodeSandbox CLI","description":"Command-line interface (CLI) for uploading and deploying projects to CodeSandbox, an online code editor tailored for web applications. As of version 2.2.3, this tool allows developers to quickly upload local projects as templates or sandboxes using a single command. It requires authentication to prevent abuse. The library is relatively simple, with no major competitors in the same niche; it is maintained as part of the CodeSandbox ecosystem. Release cadence is low, with the last release in May 2020.","status":"maintenance","version":"2.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/codesandbox-app/codesandbox-importers","tags":["javascript","codesandbox","cli","editor"],"install":[{"cmd":"npm install codesandbox","lang":"bash","label":"npm"},{"cmd":"yarn add codesandbox","lang":"bash","label":"yarn"},{"cmd":"pnpm add codesandbox","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Command-line argument parsing","package":"commander","optional":false},{"reason":"Interactive prompts for authentication and configuration","package":"inquirer","optional":false},{"reason":"HTTP requests to CodeSandbox API","package":"axios","optional":false},{"reason":"Spinner for CLI loading states","package":"ora","optional":false}],"imports":[{"note":"This is a CLI tool, not a library to import programmatically. Use as a global command via npm or npx.","wrong":"require('codesandbox')","symbol":"CLI","correct":"npx codesandbox <path>"},{"note":"The CLI does not expose a programmatic API; it is intended for command-line use only.","wrong":"codesandbox --upload ./path","symbol":"deploy","correct":"codesandbox ./path"}],"quickstart":{"code":"# Install globally\nnpm install -g codesandbox\n\n# Go to project directory\ncd /my/project\n\n# Deploy (will prompt for authentication if not logged in)\ncodesandbox ./\n\n# Or with npx (no install required)\nnpx codesandbox ./my-project --output=url","lang":"javascript","description":"Install the CLI globally, navigate to a project, and deploy it to CodeSandbox with a single command. Use --output=url to get the sandbox URL directly."},"warnings":[{"fix":"Run 'codesandbox login' first or authenticate interactively when prompted.","message":"You must be signed in to CodeSandbox to use the CLI; otherwise deployment will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure your project has a valid package.json and is a standard web project (e.g., React, Vue, etc.).","message":"The CLI may not work with all project structures; it expects a package.json and supported files.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check CodeSandbox documentation for API updates; consider using the official web interface instead.","message":"The CLI uses the CodeSandbox v1 API which may be deprecated in favor of a newer API.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'codesandbox login' and authenticate via the browser.","cause":"Attempting to deploy without authentication.","error":"Error: You must be signed in first. Run codesandbox login."},{"fix":"Run the command from a directory containing a package.json, or specify a path that contains one.","cause":"The CLI requires a package.json to determine the project type.","error":"ERROR: Could not find package.json in the specified directory"},{"fix":"Re-authenticate by running 'codesandbox login' again.","cause":"Authentication token is invalid or expired.","error":"Error: Request failed with status code 401"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}