Build IoT applications — from raw sensor data to production-ready dashboards — using your local AI coding assistant and the Ubidots platform.
The Ubidots CLI connects your local development environment to the Ubidots IoT platform. When paired with an AI coding assistant (Claude Code, GitHub Copilot, Codex, Cursor), it creates a tight feedback loop: write code locally, push to Ubidots, trigger it, read the logs, iterate — without leaving your terminal.
The CLI caters to both types of IoT application developers:
-
Pure backend — Use Ubidots as your data processing and storage layer. Leverage its built-in capabilities:
- Device management — Devices, device groups, and device types.
- Data management — Industry-proven time-series storage and retrieval at scale; events/rules engine; hybrid hot/cold storage for 10+ years of efficient retention; PDF/XLS reporting; Data APIs for querying and transforming time-series; synthetic variables; outbound data pipelines; and more.
- Serverless computing — Deploy Python or Node.js serverless functions to customize your backend. Ingest data from devices (HTTP / MQTT / CoAP), run transformations, call external APIs, apply business logic, or run ML models — Ubidots handles the data infrastructure.
-
Full-stack IoT application — Combine all of the above with Ubidots dashboards: use pre-built widgets, drop in custom HTML/JS widgets, or build entire UIs with Ubidots Pages (HTML/JS/CSS pages embedded directly in the platform). Go from sensor data to a production UI without deploying any servers.
Devices → Ubidots (data + events + APIs) → UbiFunctions (custom logic) → Pages (UI)
- Python 3.9+
- Docker (for local development only — not needed for cloud-only operations)
- An Ubidots account with Industrial license or above
pip install ubidots-cli
ubidots --helpAll commands that talk to Ubidots require a profile. Create one with your API token:
# Interactive setup
ubidots config
# Non-interactive (useful in scripts or CI)
ubidots config --no-interactive --profile prod --token BBFF-your-token-here
# Set as default so you don't need --profile on every command
ubidots config --default prodProfiles are stored at ~/.ubidots_cli/profiles/<profile-name>.yaml.
UbiFunctions are serverless Python or Node.js functions triggered by HTTP, MQTT, or a scheduler. They can read and write device data, call external APIs, process payloads, and return responses.
dev add → dev start → (write code) → dev stop → push → run → logs
ubidots functions dev add --name my-function --language python --runtime python3.11:lite
cd my-functionThis creates a project folder with starter code, a manifest.yaml, and a Docker-based local runtime.
ubidots functions dev startPrints a local URL (e.g. http://localhost:32768). Send HTTP requests to it while you develop.
curl -X POST http://localhost:32768 -H "Content-Type: application/json" -d '{"value": 42}'Watch logs in real time:
ubidots functions dev logs --followubidots functions push# Trigger with a payload and immediately print execution logs
ubidots functions run --label my-function --payload '{"value": 42}' --logs
# Show logs for the last 5 activations (default)
ubidots functions logs --label my-function
# Show logs for the last 3 activations
ubidots functions logs --label my-function --tail 3# List all functions
ubidots functions list
# Get details (including the webhook URL)
ubidots functions get --label my-function --fields url,id,label,serverless,triggers --format json
# Update runtime or configuration
ubidots functions update --label my-function --runtime python3.11:base --timeout 30
# Delete
ubidots functions delete --label my-function --yes# Run from the parent directory where you want the function folder created
ubidots functions pull --remote-id <function-id>
cd <function-name>
ubidots functions dev startPages are custom dashboard views embedded in the Ubidots platform. Each page is an HTML/JS/CSS project that runs inside Ubidots and has access to the Ubidots JS SDK — giving it direct access to your device data.
dev add → dev start → (write HTML/JS/CSS) → dev stop → push
ubidots pages dev add --name "Fleet Monitor" --type dashboard
cd fleet-monitorCreates a project with body.html, script.js, style.css, static/, and a manifest.
ubidots pages dev startPrints a local URL. Open it in a browser. Edits to your files are reflected immediately — no container restart needed.
ubidots pages pushThe page is now live inside the Ubidots platform.
# List all pages
ubidots pages list
# Get details (including the live URL)
ubidots pages get --label fleet-monitor --fields id,label,url --format json
# Update the display name
ubidots pages update --label fleet-monitor --new-name "Fleet Monitor v2"
# Delete
ubidots pages delete --label fleet-monitor --yesubidots pages pull --remote-id <page-id>
cd <page-name>
ubidots pages dev start# Create a device
ubidots devices add plant-sensor --name "Plant Sensor A" --tags climate,plantA
# List devices with a specific tag
ubidots devices list --filter "tags__contains=plantA" --format json
# Get a device
ubidots devices get --label plant-sensor --fields id,label,lastActivity,variables
# Create a variable on a device
ubidots variables add ~plant-sensor temperature "Temperature" --unit "°C"
# List variables in JSON
ubidots variables list --fields id,label,lastValue,unit --format jsonBelow is the sequence an AI assistant would follow to build a complete IoT application on Ubidots from scratch.
ubidots config --no-interactive --profile prod --token BBFF-your-tokenubidots functions dev add --name data-processor --language python --runtime python3.11:lite
cd data-processor
# Write your logic in main.py
ubidots functions dev start
# Test locally
curl -X POST http://localhost:<port> -d '{"deviceLabel": "sensor-1", "value": 22.5}'
ubidots functions dev logs --follow
# Push when ready
ubidots functions dev stop
ubidots functions push --yes --profile produbidots functions run --label data-processor --payload '{"deviceLabel": "sensor-1", "value": 22.5}' --logs --profile prodcd ..
ubidots pages dev add --name "Sensor Dashboard" --type dashboard
cd sensor-dashboard
# Edit body.html, script.js, style.css using the Ubidots JS SDK
ubidots pages dev start
# Preview at the printed URL
ubidots pages push --yes --profile prod# Check what's running in production
ubidots functions logs --label data-processor --tail 5 --profile prod # target prod explicitly
# Pull a function down to fix a bug
ubidots functions pull --remote-id <id> --profile prod
cd data-processor
ubidots functions dev start
# Fix, test, push
ubidots functions push --yes --profile prodEvery cloud command uses your default profile (set by ubidots config --default <name>). The --profile flag lets you override that for a single command — useful when managing multiple environments (e.g. staging, prod) without changing your default.
ubidots config --no-interactive --profile staging --token BBFF-staging-token
ubidots config --no-interactive --profile prod --token BBFF-prod-token
ubidots config --default staging
# Override for a single command
ubidots functions push --profile prod| Runtime | Description |
|---|---|
python3.11:lite |
Python 3.11 — minimal dependencies |
python3.11:base |
Python 3.11 — common data/HTTP libraries |
python3.11:full |
Python 3.11 — full scientific stack |
python3.9:lite |
Python 3.9 — minimal |
python3.9:base |
Python 3.9 — common libraries |
python3.9:full |
Python 3.9 — full stack |
nodejs20.x:lite |
Node.js 20 — minimal (default) |
nodejs20.x:base |
Node.js 20 — common libraries |
ubidots config Set up authentication profiles
ubidots functions dev add Create a local function project
ubidots functions dev start Start the local function server
ubidots functions dev stop Stop the local function server
ubidots functions dev restart Restart the local function server
ubidots functions dev status Check local server status
ubidots functions dev logs Stream local logs
ubidots functions dev clean Remove local containers and images
ubidots functions push Upload local code to Ubidots
ubidots functions pull Download remote function to local
ubidots functions run Trigger a remote function
ubidots functions logs View remote activation logs
ubidots functions list List all remote functions
ubidots functions get Get details for a remote function
ubidots functions add Create a new remote function
ubidots functions update Update a remote function
ubidots functions delete Delete a remote function
ubidots pages dev add Create a local page project
ubidots pages dev start Start the local page preview server
ubidots pages dev stop Stop the local page server
ubidots pages dev restart Restart the local page server
ubidots pages dev status Check page server status
ubidots pages dev list List all local page containers
ubidots pages dev logs Stream local page server logs
ubidots pages push Upload local page to Ubidots
ubidots pages pull Download remote page to local
ubidots pages list List all remote pages
ubidots pages get Get details for a remote page
ubidots pages add Create a new remote page
ubidots pages update Update a remote page
ubidots pages delete Delete a remote page
ubidots devices list List devices
ubidots devices get Get device details
ubidots devices add Create a device
ubidots devices update Update a device
ubidots devices delete Delete a device
ubidots variables list List variables
ubidots variables get Get variable details
ubidots variables add Create a variable on a device
ubidots variables update Update a variable
ubidots variables delete Delete a variable
All commands support --help for full option details.