Skip to content

analyze

Analyze a database schema with AI to identify sensitive columns and generate a sanitization query.

clonit analyze <target> [flags]
clonit analyze [command]
Argument Description Required
target Name of the target to analyze Yes
Flag Type Default Description
--local bool false Force local LLM analysis even when cloud is configured
--model string Override the Claude model
--no-samples bool false Skip data sampling (schema only)
--sample-rows int from config Rows per table for sampling

Analyzes the target database schema using AI to identify sensitive columns (PII, credentials, financial data, etc.) and generates a sanitization SQL query.

The generated query is stored with versioning so you can iterate and fall back to prior versions. Use analyze queries to list query versions, analyze show to view a query, analyze activate to choose which version is active, and analyze import to bring in your own SQL as a new version.

By default the analysis samples a few rows per table to improve detection accuracy. Use --no-samples for a schema-only analysis, or --sample-rows to control how many rows are sampled per table.

When Clonit Cloud is configured, analysis runs through the cloud (using shared or per-org Anthropic keys). Pass --local to force local analysis with your own Anthropic API key instead.

Command Usage Description
activate clonit analyze activate <target> <version> Set the active sanitization query version for a target
import clonit analyze import <target> <file> Import a SQL file as a new sanitization query version
queries clonit analyze queries <target> List all sanitization query versions for a target
show clonit analyze show <target> [version] Show the sanitization SQL query (default: active version)

Analyze a target and generate a sanitization query:

clonit analyze mydb

Analyze the schema only, without sampling row data:

clonit analyze mydb --no-samples

Sample more rows per table for better detection:

clonit analyze mydb --sample-rows 50

Force local analysis with your own Anthropic key even when cloud is configured:

clonit analyze mydb --local

Override the Claude model used for analysis:

clonit analyze mydb --model claude-sonnet-4-20250514

List all generated query versions for a target:

clonit analyze queries mydb

Show the active query, or a specific version:

clonit analyze show mydb
clonit analyze show mydb 2

Activate a specific query version:

clonit analyze activate mydb 2

Import your own SQL file as a new query version:

clonit analyze import mydb /path/to/sanitize.sql
  • sanitize – Run the sanitization pipeline on a snapshot
  • build – Create a snapshot of the source database
  • targets-update – Set sanitization fields on a target