An AI-powered assistant for building CARTO Workflows using OpenCode and the carto CLI.
- A CARTO account with access to an organization and at least one connection
Follow the instructions at https://opencode.ai to install OpenCode. In macOS, should be enough to run:
brew install opencodeCreate ~/.config/opencode/opencode.jsonc with the following content:
The CLI requires the @cloud-native/workflows-engine package from the CartoDB/cloud-native repository.
# Clone the cloud-native repository (required dependency)
git clone \
-b feat/workflows-validation-for-assistant \
https://github.com/CartoDB/cloud-native.git
# Install cloud-native dependencies (required for building workflows-engine)
cd cloud-native
# Review the cloud-native README
nvm install && nvm use
corepack enable && yarn install
cd ..
# Clone the carto-cli repository
git clone \
-b feature/workflows-engine-validation \
https://github.com/CartoDB/carto-cli.git
# Specify the custom path to cloud-native to link workflows-engine
cd carto-cli
./scripts/setup-engine.sh /path/to/cloud-native
# Build the CLI
npm install
npm run build
npm run bundleThe bundled CLI will be available at bundle/carto. Add it to your PATH or create a symlink:
# Option A: Create symlink to make 'carto' available globally, you may need sudo
ln -s $(pwd)/bundle/carto /usr/local/bin/carto
# Option B: symlink to the local bin folder if you have it configured
ln -s $(pwd)/bundle/carto $HOME/.local/bin/cartogit clone https://github.com/CartoDB/workflows-assistant.git
cd workflows-assistantCopy the .env.template file to .env and fill in the required values:
cp .env.template .env
# Edit .env with your configuration valuesBefore using the assistant, source the environment file to load the variables:
source .envcarto auth login
carto auth status # verify authenticationStart OpenCode in the repository directory:
cd workflows-assistant
opencodePress Tab to cycle through agents:
- Build (default) - General coding assistant
- Plan - Planning mode
- Workflows-Assistant - The CARTO Workflows assistant
Select Workflows-Assistant to test the workflows agent. Before starting, please make sure that you are using Opus 4.5 via Vertex AI by running the /models command.
If you test this tool and run into any issues, missing functionality, or come up with feedback, please create an issue in this GitHub repository.
Some things that can help you diagnose errors if something is not working:
Authentication issues
carto auth logout
carto auth loginCheck available connections
carto connections listVerify CLI is working
carto workflows components list --provider bigqueryMake sure that the OpenCode colorscheme is correct
# Use this command from OpenCode
/theme
{ "$schema": "https://opencode.ai/config.json", "provider": { "google-vertex-anthropic": { "models": {}, "options": { "project": "carto-ai-staff-usage", "location": "us-east5" } } } }