analyze
Analyze a database schema with AI to identify sensitive columns and generate a sanitization query.
clonit analyze <target> [flags]clonit analyze [command]Arguments
Section titled “Arguments”| 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 |
Description
Section titled “Description”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.
Subcommands
Section titled “Subcommands”| 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) |
Examples
Section titled “Examples”Analyze a target and generate a sanitization query:
clonit analyze mydbAnalyze the schema only, without sampling row data:
clonit analyze mydb --no-samplesSample more rows per table for better detection:
clonit analyze mydb --sample-rows 50Force local analysis with your own Anthropic key even when cloud is configured:
clonit analyze mydb --localOverride the Claude model used for analysis:
clonit analyze mydb --model claude-sonnet-4-20250514List all generated query versions for a target:
clonit analyze queries mydbShow the active query, or a specific version:
clonit analyze show mydbclonit analyze show mydb 2Activate a specific query version:
clonit analyze activate mydb 2Import your own SQL file as a new query version:
clonit analyze import mydb /path/to/sanitize.sqlSee Also
Section titled “See Also”- sanitize – Run the sanitization pipeline on a snapshot
- build – Create a snapshot of the source database
- targets-update – Set sanitization fields on a target