Looker Integration
Oxygen integrates with Looker to enable agents and automations to query Looker explores directly. The integration supports metadata synchronization, LLM-powered query generation, and automation support.Prerequisites
- A Looker instance with API access enabled
- API credentials (client ID and client secret) from your Looker admin panel
- Oxygen CLI installed
Configuration
Add your Looker integration toconfig.yml:
Configuration Options
client_id_var- Name of the environment variable storing your Looker API client IDclient_secret_var- Name of the environment variable storing your Looker API client secretbase_url- Your Looker instance URL including the API port (typically:19999)explores- List of Looker explores to make availablemodel- The LookML model namename- The explore namedescription- Optional description for agent context
Authentication
Oxygen authenticates with Looker using OAuth 2.0 client credentials. Store your credentials as environment variables:1
Navigate to Looker Admin
Go to your Looker instance and navigate to Admin > Users.
2
Edit API keys
Select your user (or a service account) and click Edit Keys under the API section.
3
Create new API credentials
Click New API Key. Copy the Client ID and Client Secret — the secret is only shown once.
4
Set environment variables
Export the credentials in your shell or add them to your
.env file:Metadata Synchronization
Before querying, you need to sync explore metadata from Looker. This downloads field definitions (dimensions, measures, views) so that agents have context for generating queries.Sync Commands
How Metadata Storage Works
Synced metadata is stored in two layers:- Base metadata (auto-generated, git-ignored):
~/.local/share/oxy/.looker/<integration>/<model>/<explore>.yml - Overlay metadata (user-managed, version-controlled):
looker/<integration>/<model>/<explore>.ymlin your project directory
Overlay Metadata Example
Using Looker in Agents
Add a Looker tool to your agent configuration to let the agent query Looker explores:Looker Filter Syntax
Looker uses its own filter syntax, not SQL expressions. When writing overlay hints for agents, include examples using native Looker filter syntax:Using Looker in Automations
Add a Looker query task to your automation:Query Parameters
fields- List of dimension and measure names to include (use fullview.field_nameformat)filters- Map of field names to Looker filter expressionsfilter_expression- Optional filter expression for complex OR conditionssorts- List of sort objects, each withfieldanddirection(ascordesc, defaults toasc)limit- Maximum number of rows to return (use-1for unlimited)
CLI Commands
Test Connection
List Synced Explores
Troubleshooting
- Authentication errors - Verify your client ID and secret are correct and that the environment variables are exported. API credentials may expire if rotated in the Looker admin panel.
- Connection refused - Ensure the
base_urlincludes the correct port (Looker API typically runs on port19999). - Empty metadata after sync - Check that the explores listed in your configuration exist in Looker and that your API credentials have permission to access them.
- Query errors with filters - Looker uses its own filter syntax, not SQL. Use expressions like
"last 30 days"instead of SQL date functions.