Skip to content

CLI Reference

To see all available CLI commands and options, run:

Terminal window
uv run komodo --help

For help with a specific command:

Terminal window
uv run komodo <command> --help
FlagDescription
--version, -vShow the CLI version and exit
--helpShow help text and exit

Start the OAuth 2.0 Device Authorization Flow. Opens your browser for authentication and stores your JWT and refresh token in ~/.komodo/credentials.

Terminal window
uv run komodo login
FlagDescription
-E, --environmentTarget environment: production (default). integration and development require komodo-internal-tools

Print the current JWT token for debugging or use with external tools.

Terminal window
uv run komodo jwt
FlagDescription
-E, --environmentTarget environment

Interactively select the active Komodo account from your available accounts.

Terminal window
uv run komodo account set

Print the currently selected account ID and slug.

Terminal window
uv run komodo account get

List all accounts you have access to.

Terminal window
uv run komodo account list

Manage service principal credentials for machine-to-machine (M2M) authentication. See the Authentication guide for usage.

Create a new service principal. Returns the client_id and client_secret.

Terminal window
uv run komodo service-principal create --name "my-service" --description "My service principal"
FlagDescription
--nameName for the service principal (required)
--descriptionDescription (optional)

List all service principals for the current account.

Terminal window
uv run komodo service-principal list

Delete a service principal by ID.

Terminal window
uv run komodo service-principal delete <SERVICE_PRINCIPAL_ID>

Generate the MCP server configuration JSON for your AI client. The output is automatically copied to your clipboard.

Terminal window
uv run komodo mcp show-config
FlagDescription
--name, -nCustom server name (default: komodo)

See the MCP Server guide for full setup instructions.

Start the MCP server with STDIO transport. Typically started automatically by your AI client via the configuration from show-config.

Terminal window
uv run komodo mcp run

Execute a single SQL statement against your Snowflake warehouse and display the results in a formatted table.

Terminal window
uv run komodo sql-execute "SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS LIMIT 10"
FlagDescription
-E, --environmentTarget environment

Start an interactive SQL shell for running multiple queries in a session. Type exit to quit. Errors in one statement do not exit the shell.

Terminal window
uv run komodo sql-shell
FlagDescription
-E, --environmentTarget environment

Show diagnostic detail for a previously executed query: the error code and message, execution status, warehouse, and timing that Snowflake recorded. Use this to self-diagnose a failed query without contacting Komodo support.

Terminal window
uv run komodo sql-diagnostics <query-id>
Argument / FlagDescription
query-idThe Snowflake query ID (sfqid) to diagnose
-E, --environmentTarget environment

The query ID is the sfqid attribute on the cursor after execute (cursor.sfqid), and is also included in surfaced error messages as Query ID: .... Diagnostics are backed by Snowflake’s INFORMATION_SCHEMA.QUERY_HISTORY, so the query must be within the history retention window and a database must be set on the connection.


Open Marmot in your browser, or chat with Marmot from the terminal.

Without flags, opens the Marmot web app:

Terminal window
uv run komodo marmot

With --chat / -c, sends a message to Marmot: the CLI creates a new analysis with a conversation in it, waits for the reply, and renders it in the terminal.

Terminal window
uv run komodo marmot -c "How many NSCLC patients were treated in 2025?"

When run in an interactive terminal, the CLI then keeps the session open so you can reply and continue the conversation in the same analysis — press Ctrl+C (or Ctrl+D) to end. At the end it prints a link to open the analysis in the Marmot web app, where the conversation can be resumed with full history.

Every chat creates a Marmot analysis, which owns the conversation and any files Marmot produces while working (queries, cohort definitions, reports). Those files can be read programmatically — see the MarmotApi SDK reference.

FlagDescription
--chat, -cMessage to send. Omit to open Marmot in the browser instead
--urlOverride the Marmot URL (e.g. https://marmot-staging.komodohealth.com)
-E, --environmentTarget environment

Install a Komodo CLI plugin package. Without arguments, installs komodo-internal-tools from Komodo’s internal package registry.

Terminal window
uv run komodo plugin install
FlagDescription
--packageSpecific package name to install
--pathInstall from a local path

Uninstall a plugin package.

Terminal window
uv run komodo plugin uninstall <PACKAGE_NAME>

List installed plugins and their registered CLI commands and MCP tools.

Terminal window
uv run komodo plugin list

Open the Marmot Development Kit documentation in your browser.

Terminal window
uv run komodo docs

Submit feedback about the Marmot Development Kit.

Terminal window
uv run komodo feedback

Beta commands are accessed through the komodo beta subgroup:

Terminal window
uv run komodo beta --help

Explore patient cohorts interactively using the Cohort API. This command provides a streamlined interface for rapid validation of clinical hypotheses via interactive prompts.

Terminal window
uv run komodo beta cohort-exploration

Features:

  • Simple mode — Guided prompts for diagnosis codes (ICD-10), procedure codes (CPT/HCPCS), and drug references (NDC)
  • Advanced mode — Build complex AND/OR/nested condition logic
  • Quick count — Fast approximate or exact distinct patient count
  • Comprehensive summary — Demographic breakdowns by time trends, gender, age, state, race/ethnicity, and mortality, plus top providers by member count (NPI) and estimated HCP/HCO totals
  • Full NPI breakdown (opt-in) — After choosing the comprehensive summary, optionally export the cohort to get member counts for every provider NPI (rendering, billing, or any-role attribution). The first run exports cohort data and can take a few minutes; re-runs hit the export cache. Results show the top 50 providers in the terminal and write the complete breakdown to a CSV file. Requires cohort-export permissions.

Supported parameters:

  • Diagnosis Code (ICD-10 format, e.g., C34%, C50.1)
  • Procedure Code (CPT/HCPCS format, e.g., 96413, J9271)
  • Drug Reference (NDC Code, e.g., 12345-6789-01)
  • Provider NPI (10-digit, e.g., 1234567890) — medical claims, prescriber, or pharmacy; filter a cohort by one or more providers (Advanced mode)
  • Time Duration (date range in mm/dd/yy format)

Options:

FlagDescription
-E, --environmentTarget environment (default: production)

Bring your own data into a Komodo dataset interactively — from a file in your own S3 bucket or from a local file. Guided prompts pick an approved schema, show its columns for review, and submit the ingestion.

Terminal window
uv run komodo beta data-ingestion

What it does:

  • Ingest data from customer bucket — pick a registered ingest source, choose an approved BYOD schema (its columns are shown), then give the full s3://… path to the file. Komodo validates the schema and that the path belongs to the source, then submits the ingestion.
  • Ingest data from local path — upload a local file against an approved BYOD schema; no bucket or cross-account role needed.
  • Check ingestion status — look up a submitted ingestion by request id.

Ingestion runs asynchronously; the wizard prints the dataset and request ids so you can check the status until it reaches a terminal state. See the Ingest API reference for the underlying SDK and MCP tools.

Options:

FlagDescription
-E, --environmentTarget environment (default: production)