CLI (mudbase-cells-cli)
mudbase-cells-cli is the official command-line tool for managing Cells sessions, running commands, and transferring files from your terminal.
Install
npm
npm install -g mudbase-cells-clinpm install -g mudbase-cells-cliAuthenticate
Set your API key via the CELLS_API_KEY environment variable, or add it to ~/.cells/config.json:
env vars (recommended)
export CELLS_API_KEY=ak_...
export CELLS_PROJECT_ID=your_project_idexport CELLS_API_KEY=ak_...
export CELLS_PROJECT_ID=your_project_idCreate a session
shell
# Create a Node.js session (default timeout 300 s)
cells create --language node --timeout 600
# Create a Python session with a named persistent cell
cells create --language python --cell-name my-project# Create a Node.js session (default timeout 300 s)
cells create --language node --timeout 600
# Create a Python session with a named persistent cell
cells create --language python --cell-name my-projectRun commands
Pass commands after --. Output streams live to stdout.
shell
# Run a command in an existing session
cells exec SESSION_ID -- node -e "console.log(42)"
# Run a longer install
cells exec SESSION_ID --timeout 120000 -- pip install pandas# Run a command in an existing session
cells exec SESSION_ID -- node -e "console.log(42)"
# Run a longer install
cells exec SESSION_ID --timeout 120000 -- pip install pandasFiles
Write local files into a session or read files back out.
shell
# Write a local file into a session
cells files write SESSION_ID ./hello.py
# Read a file from a session to stdout
cells files read SESSION_ID /workspace/hello.py# Write a local file into a session
cells files write SESSION_ID ./hello.py
# Read a file from a session to stdout
cells files read SESSION_ID /workspace/hello.pyList sessions
shell
cells listcells listClose a session
The CLI does not have a close command. Use the REST API directly to delete a session.
curl
# Use the REST API to close a session
curl -X DELETE https://api.mudbase.dev/api/sandboxes/projects/PROJECT_ID/sessions/SESSION_ID \
-H "x-api-key: YOUR_API_KEY"# Use the REST API to close a session
curl -X DELETE https://api.mudbase.dev/api/sandboxes/projects/PROJECT_ID/sessions/SESSION_ID \
-H "x-api-key: YOUR_API_KEY"Configuration
The CLI reads configuration from ~/.cells/config.json. You can also pass credentials via environment variables:
| Variable | Description |
|---|---|
CELLS_API_KEY | Project API key. Overrides the value in ~/.cells/config.json. |
CELLS_PROJECT_ID | Project ID. Overrides the configured default project. |