SnowConvert AI CLI (scai) Command Reference¶
CLI tool for accelerated database migration to Snowflake.
Global Options¶
| Option | Description |
|---|---|
-h, --help | Show help message |
-v, --version | Display version information |
--log-debug | Global flag to enable debug-level logging for any command. Can also be set via SCAI_LOG_LEVEL env var (accepts: verbose, debug, information, warning, error, fatal). |
--json | Emit a JSON envelope to stdout (success, warnings, errors, and command-specific result) for automation, CI/CD, and agent-driven workflows that need structured machine context. Recognized anywhere on the command line. |
JSON Output¶
When –json is present, the CLI writes a single JSON document to stdout at the end of the command (envelope with success, warnings, errors, and an optional result object). Human-oriented tables and markup are suppressed for commands that implement JSON mode.
Commands with structured result:
-
scai code extract -
scai code convert -
scai code deploy -
scai code add -
scai code resync -
scai code find -
scai query -
scai code find always sets the envelope result payload (items, total, truncated); when –json is not used, the no-op envelope writer discards it and the table is shown instead.
-
scai connection list, scai connection test (success path), scai project info, and scai project status attach a command-specific result when –json is active.
-
Keep commandsWithStructuredResult aligned with GlobalHelpJsonOverview in the CLI source when adding new Json result writers.
Quick Start¶
Basic workflow to get started:
- Create a project (use -c to set default Snowflake connection)
- Add source code (full migration: SqlServer, Redshift)
- Add source code (other languages)
- Convert to Snowflake SQL
- Deploy to Snowflake
Using -c
<connection>saves the Snowflake connection in the project, avoiding the need to specify it for each command.
For commands that only need Snowflake account/user metadata (for example code extract and code convert), the CLI reads your local Snowflake CLI config (TOML) first without opening a live session. If account and user cannot be read from that config while you are online, it falls back to testing the Snowflake connection. Missing or blank account or user in TOML also triggers a live connection test when online.
Global –json prints one JSON envelope to stdout (success, warnings, errors, and an optional command-specific result) for automation, CI/CD, and agents. It can appear anywhere on the command line. See jsonOutput.commandsWithStructuredResult for commands that attach a structured result payload today.
With –json, connection list, connection test (on success), project info, and project status populate the envelope result; other commands may emit the envelope with warnings/errors only or a minimal result until documented.
Run ‘scai
<command>-h’ for detailed help on any command.
Commands¶
| Command | Description |
|---|---|
scai init | Create a new migration project |
scai project | View and manage project configuration |
scai connection | Manage source database connections (Redshift, SQL Server, Teradata, Oracle, Postgresql) |
scai code | Code operations: extract, convert, add, deploy, find, where |
scai data | Data operations: migrate, validate, worker, orchestrator, diagnostics |
scai license | Install offline license for air-gapped environments |
scai terms | View and accept terms and conditions |
scai settings | View and manage user-level CLI settings |
scai object-selector | Create selector files for filtering objects |
scai test | Generate test cases for migrated stored procedures |
scai logs | Show log directory and recent log files |
scai init¶
Create a new migration project in the specified directory (or current directory if PATH is omitted).
Prerequisites:
- Target directory must not contain an existing project
- Valid source language must be specified
Behavior:
- Creates the project directory structure and configuration files
- When –input-code-path is provided: SqlServer, Redshift, and Teradata run the arrange and parse-and-assess pipeline, promote processed files to source/, and generate a code unit registry; other languages copy source directly to source/
- When –code-already-split is used with –input-code-path (SqlServer, Redshift, and Teradata), skips the arrange/split phase, promotes raw source directly to source/, runs assessment only for code unit registry generation, and marks the project as project type: Full (new folder structure)
- Redshift and Teradata SQL source files (.sql, .ddl, .dml) require paired SC tags (e.g.
-- <sc-table> table_name </sc-table>) for the arrange step. Script files (.bteq, .btq, .fl, .fload, .ml, .mld, .mload, .tp, .tpump, .tpt) are exempt from SC-tag requirements. If validation (ADD0010) or arrange (ADD0011) fails, the project is still created but source code is not added. Recovery: fix source files and runscai code add -i <path>, or use--code-already-splitif the code is already split
Supported Languages:
Full Migration:
- SqlServer
- Redshift
Code Conversion Only:
- Oracle
- Teradata
- BigQuery
- Databricks
- Greenplum
- Sybase
- Postgresql
- Netezza
- Spark
- Vertica
- Hive
- Db2
Options:
| Option | Description | Required | Default |
|---|---|---|---|
[PATH] | Optional directory to create the project in. If omitted, uses the current directory. | No | |
-n, --name <NAME> | Project name. If omitted, defaults to the target folder name. | No | |
-l, --source-language <LANGUAGE> | Source language for the project | Yes | |
-i, --input-code-path <PATH> | Path to source code files to add during initialization. SqlServer, Redshift, and Teradata: processed through the arrange and assess pipeline (same as ‘code add’); other languages: copied directly to source/. | No | |
--code-already-split | Skip the arrange/split phase when source code is already split (SqlServer, Redshift, and Teradata). Proceeds directly to code unit registry generation and marks the project as project type: Full (new folder structure). Requires –input-code-path. | No | false |
-c, --connection <NAME> | Snowflake connection name to save as project default. Precedence: -c option > project connection > default TOML connection. | No |
Project folder structure:
| Path | Description |
|---|---|
.scai/ | Project configuration |
.scai/config/ | project.yml (shared), project.local.yml (workspace-local defaults), and related config |
artifacts/ | Intermediate processing artifacts (source_raw, source_raw_Processed) |
source/ | Processed source code (populated by –input-code-path or ‘code add’) |
snowflake/ | Converted code, reports, and logs |
Examples:
scai project¶
View and manage project configuration.
scai project info¶
Display project details including name, source language, and status.
Prerequisites:
- Must be run from within a migration project directory
Behavior:
- With global –json, prints only the JSON envelope; the result object includes project id, name, source language, project type (raw and display strings), explanations, created metadata, optional description and cloud project id, schema version, connectionDefaults (Snowflake and source defaults split into shared project.yml vs workspace-local project.local.yml), and a localYamlNote string.
Output: Project details displayed
Output fields:
- Project Name: Name of the migration project
- Project ID: Unique identifier (MIGRATION_PROJECT_ prefix)
- Source Language: Source database dialect (e.g., Teradata, Oracle)
- Snowflake Connection: Default connection name (if configured)
- Source Connection: Default source connection name (if configured)
- Project Root: Absolute path to project directory
Examples:
scai project status¶
Show project.yml context and Code Unit Registry snapshot (read-only).
Prerequisites:
- Must be run from within a migration project directory
Behavior:
- Shows project context from project.yml: absolute project root, project id, project type, source dialect, created metadata, optional description and cloud project id, default Snowflake connection
- When environments are defined in project.yml, shows a table with Snowflake database, schema, and description per environment (non-secret)
- When the registry is initialized, reads code units from the Code Unit Registry; when not, prints project context with registry metrics zeroed and an uninitialized-registry warning
- Registry overview: one table with registered, converted, deployable; with –full, inventory adds object types from Target.ObjectType and source locations from Source database/schema
- Deployable counts converted code units that pass registry deploy checks (required registry fields and no issues whose codes are in a small explicit deploy-blocking set; registry severity/level fields are not used). Missing references count reflects assessment failures (migration completeness)
- SQL drift from FindSqlFileChanges: modified tracked SQL vs non-modified file-change types and untracked paths; console warns when the drift query fails
- Registry overview includes a dim one-line EWI/FDM/PRF/OOS instance total (category totals)
- Aggregates conversion issues (EWIs, FDMs, PRFs, OOS) from registry issue entries
- Objects ranked by issue load and most common issue codes appear on the console only with –full (row caps 10 / 12 where documented)
- Ranks code units by total conversion issue instances (sum of Count for issues with non-empty codes); top rows shown with –full
- With global –json, prints only the JSON envelope; the result object has full (boolean, same as –full) and status (aggregated ProjectStatusData: registry snapshot, project context, and metrics) instead of formatted tables.
Options:
| Option | Description | Required |
|---|---|---|
--full | Show extended tables (inventory, issue rankings, most common codes). Default omits these. | No |
Output: Teal header. Bold subsection titles directly above tables (no blank line between title and table). Default: project context, environments, registry overview, code unit registry summary. –full adds inventory (object types / source locations, first 12 each), issue rankings (10 rows), most common codes (10 rows), plus extra SQL drift prose when unsynced. Dim footer notes metrics are from the code unit registry.
Examples:
scai project defaults¶
scai project defaults set¶
Set project-level defaults (Snowflake connection, source connection, warehouse, database, schema). Values are tested before save; saved connection profiles are not modified. Always writes to project.local.yml to prevent credentials from being committed to version control.
Prerequisites:
- A migration project initialized with ‘scai init’
- Connections must exist in connections.toml or config.toml
Behavior:
- Only provided flags are persisted for the project
- Always writes to project.local.yml (gitignored), never to the shared project.yml
- Snowflake fields: loads saved connection profiles, merges existing project Snowflake defaults to your current connection without modifying it, then tests it
- Source (-s): tests the source connection for the project’s source language and defines it as the project’s default source connection (if valid)
Options:
| Option | Description | Required |
|---|---|---|
-c, --connection <NAME> | Snowflake connection profile name to store as project default. | No |
-s, --source-connection <NAME> | Source connection profile name to store as project default. | No |
--warehouse <NAME> | Project default Snowflake warehouse. | No |
--database <NAME> | Project default Snowflake database. | No |
--schema <NAME> | Project default Snowflake schema. | No |
--role <NAME> | Project default Snowflake role. | No |
Examples:
scai project defaults unset¶
Clear project-level defaults for the current project. Always clears from project.local.yml.
Behavior:
- Only flags you pass clear the matching field; other fields are unchanged
- Always clears from project.local.yml (gitignored), never from the shared project.yml
Options:
| Option | Description | Required |
|---|---|---|
--connection | Clear project default Snowflake connection name. | No |
--source-connection | Clear project default source connection name. | No |
--warehouse | Clear project default warehouse. | No |
--database | Clear project default database. | No |
--schema | Clear project default schema. | No |
Examples:
scai project doctor¶
Check project folders, code unit registry, and connection names without connecting to databases.
Prerequisites:
- Must be run from within a migration project directory
Behavior:
- Runs offline only (does not log in to Snowflake or the source database)
- Lists each expected folder and file (required vs optional) with OK, Warning, or Problem
- Checks the code unit registry can load when present
- Checks Snowflake and source connection names exist in local TOML (not a live connection test)
Options:
| Option | Description | Required |
|---|---|---|
--json | Write machine-readable JSON to stdout (no markup). | No |
Output: Table of findings or JSON with json_schema_version and findings[]
Examples:
scai project set-default-connection¶
Set the default Snowflake connection for the current project.
Prerequisites:
- A migration project initialized with ‘scai init’
- Snowflake connection available in connections.toml or config.toml
Behavior:
- Validates the connection exists and works before saving
- Saves the connection name in project.yml
- All project commands will use this connection by default
Options:
| Option | Description | Required |
|---|---|---|
-c, --connection <NAME> | Name of the Snowflake connection to set as the project default. | Yes |
Examples:
scai connection¶
Manage source database connections (Redshift, SQL Server, Teradata, Oracle, Postgresql).
scai connection add-redshift¶
Add a new Redshift source database connection.
Prerequisites:
- Network access to the Redshift cluster/serverless endpoint
- For IAM auth: AWS credentials configured (AWS CLI or environment variables)
- For standard auth: Username and password
Authentication Methods:
- IAM Serverless: AWS IAM with Redshift Serverless
- IAM Provisioned: AWS IAM with Provisioned Cluster
- Standard: Username/password authentication
Operation Modes:
- Interactive: Prompts for all required information (recommended)
- Inline: Use command-line options for automation/CI
Options:
| Option | Description | Required |
|---|---|---|
-s, --source-connection <SOURCE_CONNECTION> | Name for this source connection profile | No |
--auth <AUTH> | Authentication method (iam-serverless, iam-provisioned-cluster, standard) | No |
--user <USER> | Username | No |
--database <DATABASE> | Database name | No |
--connection-timeout <SECONDS> | Connection timeout in seconds | No |
--workgroup <NAME> | Redshift Serverless workgroup name | No |
--cluster-id <ID> | Redshift Provisioned Cluster ID | No |
--region <REGION> | AWS region | No |
--access-key-id <KEY> | AWS Access Key ID | No |
--secret-access-key <KEY> | AWS Secret Access Key | No |
--host <HOST> | Redshift host | No |
--port <PORT> | Port number | No |
--password <PASSWORD> | Password | No |
Output: Connection saved to ~/.snowflake/connections.toml (or project-local)
Examples:
scai connection add-sql-server¶
Add a new SQL Server source database connection.
Prerequisites:
- Network access to the SQL Server instance
- For Windows auth: Valid domain credentials
- For standard auth: SQL Server username and password
Authentication Methods:
- Windows: Windows Authentication (Integrated Security)
- Standard: SQL Server Authentication (username/password)
Operation Modes:
- Interactive: Prompts for all required information (recommended)
- Inline: Use command-line options for automation/CI
Options:
| Option | Description | Required |
|---|---|---|
-s, --source-connection <SOURCE_CONNECTION> | Name for this source connection profile | No |
--auth <AUTH> | Authentication method (windows, standard) | No |
--user <USER> | Username | No |
--database <DATABASE> | Database name | No |
--connection-timeout <SECONDS> | Connection timeout in seconds | No |
--server-url <URL> | SQL Server URL | No |
--port <PORT> | Port number | No |
--password <PASSWORD> | Password | No |
--trust-server-certificate | Trust server certificate | No |
--encrypt | Encrypt connection | No |
Output: Connection saved to ~/.snowflake/connections.toml (or project-local)
Examples:
scai connection add-postgresql¶
Add a new PostgreSQL source database connection.
Prerequisites:
- Network access to the PostgreSQL host (TCP, default port 5432)
- A PostgreSQL role with CONNECT + USAGE on the target database and SELECT on pg_catalog
- Username and password for standard authentication
Authentication Methods:
- Standard: Username/password authentication (MVP — only method supported)
SSL Modes:
- Disable: No SSL (local / loopback only)
- Prefer: SSL if available, plaintext otherwise
- Require: SSL required, server certificate not verified (default)
- VerifyCA: SSL required, CA validated against trust store
- VerifyFull: SSL required, CA + hostname validated
Operation Modes:
- Interactive: Prompts for all required information (recommended)
- Inline: Use command-line options for automation/CI
Options:
| Option | Description | Required |
|---|---|---|
-s, --source-connection <SOURCE_CONNECTION> | Name for this source connection profile | No |
--auth <AUTH> | Authentication method (standard) | No |
--user <USER> | Username | No |
--host <HOST> | PostgreSQL host | No |
--database <DATABASE> | Database name | No |
--port <PORT> | Port number (default: 5432) | No |
--password <PASSWORD> | Password | No |
--ssl-mode <SSL_MODE> | SSL mode (default: Require). Values: Disable, Prefer, Require, VerifyCA, VerifyFull | No |
--connection-timeout <SECONDS> | Connection timeout in seconds (default: 30) | No |
Output: Connection saved to ~/.snowflake/connections.toml (or project-local)
Examples:
scai connection set-default¶
Set the default source connection for a database type.
Prerequisites:
- Connection already added with ‘scai connection add-redshift’, ‘scai connection add-sql-server’, ‘scai connection add-teradata’, ‘scai connection add-oracle’, or ‘scai connection add-postgresql’
Behavior:
- Marks a configured connection as the default for extraction and validation
- Default source connection is used when no -s/–source-connection option is specified on commands that need a source database
Options:
| Option | Description | Required |
|---|---|---|
-l, --source-language <LANGUAGE> | Database type of the connection | Yes |
-s, --source-connection <SOURCE_CONNECTION> | Name of the source connection profile to set as default | Yes |
Examples:
scai connection list¶
List connections for a given source database.
Behavior:
- Without –source-language: shows Snowflake connections (from Snowflake CLI config) and configured source connections per supported database type.
- With global –json and no –source-language: prints only the JSON envelope; result uses mode summary with hasAnyConnections, snowflake (default name, connection rows, distinct config paths), and sources (per dbType: configPath, defaultConnectionName, connection name rows).
- With –source-language and –json: result uses mode detailed with connections (masked credentials JSON per profile), config path, and default name.
Supported Languages:
- SqlServer
- Redshift
Options:
| Option | Description | Required |
|---|---|---|
-l, --source-language <LANGUAGE> | Source language of the connection. If omitted, shows a summary of all connections. | No |
Output: Without –json: tables (summary) or detailed rows. With –json: see behavior for envelope result shapes.
Examples:
scai connection test¶
Test a source database connection.
Prerequisites:
- Connection already configured
- Network access to the database
Behavior:
- Attempts to connect to the database
- Verifies credentials and network connectivity
- Reports connection success or failure details
- Exits with a non-zero code when the connection test fails so scripts and CI/CD can detect failures
- With global –json on success: prints only the JSON envelope; result includes connectionName, dbType, credentialsMaskedJson (JSON document as a string, secrets redacted), and success true. On failure, errors appear on the envelope and the result table is not used.
- With global –json, the ‘using default connection’ line is omitted to keep stdout as a single JSON document.
Supported Languages:
- SqlServer
- Redshift
Options:
| Option | Description | Required |
|---|---|---|
-l, --source-language <LANGUAGE> | Source language of the connection. Supported languages: SqlServer and Redshift. | Yes |
-s, --source-connection <SOURCE_CONNECTION> | Name of the source connection profile to test | No |
Examples:
scai code¶
Code operations: extract, convert, add, deploy, find, where.
scai code extract¶
Extract code from the source database.
Prerequisites:
- A migration project initialized with ‘scai init’
- Source database connection configured (use ‘scai connection add-redshift’, ‘scai connection add-sql-server’, ‘scai connection add-teradata’, ‘scai connection add-oracle’, or ‘scai connection add-postgresql’)
- Network access to the source database
Behavior:
- Connects to the configured source database connection
- Extracts DDL and writes to source/ folder
Supported Languages:
- SqlServer
- Redshift
- Postgresql
Interactive Mode:
Requirement: Requires an interactive terminal. In non-interactive or CI environments use –schema, –object-type, and –name instead.
- Pre-fetch: prompt for schema (or leave empty for all) and multi-select object types to scope the catalog query.
- Post-fetch: multi-select schemas to include, optional name filter (wildcard * supported), summary table, then confirm extraction.
Options –schema, -t/–object-type, and -n/–name pre-fill the interactive prompts when used with -i.
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-s, --source-connection <NAME> | Name of the source connection to extract code from | No | |
--schema <SCHEMA> | Schema name to extract code from | No | |
-t, --object-type <TYPES> | Object types to extract (comma-separated). E.g., TABLE,VIEW,PROCEDURE | No | |
-n, --name <PATTERN> | Filter objects by name. Supports substring match or wildcard patterns with * (e.g., ‘emp’ or ‘Get*Data’) | No | |
-i, --interactive | Interactive mode: browse and select schemas, object types, and filter by name | No | false |
--source-id <SOURCE_ID> | Identifier for the source system where the code is extracted from. Recorded in the code unit registry under codeStatus.registration.sourceId. Defaults to the server hostname resolved from the source connection if not provided. | No |
Output: Extracted SQL files organized by database
Examples:
scai code convert¶
Transform source database code to Snowflake SQL.
Additional dialect-specific options are dynamically loaded based on the project’s source language. Run ‘scai code convert –help’ within a project to see all available options for that dialect.
Prerequisites:
- A migration project initialized with ‘scai init’
- Source code in the ‘source/’ folder (from ‘scai code extract’, ‘scai code add’, or manual copy)
Behavior:
- Reads SQL files from source/ folder
- Transforms code to Snowflake-compatible SQL
- Writes converted code and reports to snowflake/ folder
Options:
| Option | Description | Required |
|---|---|---|
-h, --help | Display all the conversion settings available for the specified source language | No |
-e, --etl-replatform-sources-path <PATH> | Path to ETL replatform source files for cross-project code analysis. Must be provided for each conversion run. | No |
--simplify-ssis-dataflows | If set, simple SSIS data flows will be converted to inline Snowflake SQL instead of dbt projects. The DataFlow needs to have a transformation count of less than or equal to 10 and can only have the following transformation types: Sources, Targets, Derived Column, Row Count, and Conditional Split. | No |
--consolidate-dbt-model-chains | If set, consolidates dbt model chains when converting Informatica to dbt to reduce the number of generated dbt model files. | No |
-p, --powerbi-repointing <PATH> | Path to Power BI files for input repointing. Must be provided for each conversion run. | No |
-x, --show-ewis | Show detailed EWI (Early Warning Issues) table instead of summary | No |
--context-path <PATH> | Path to read migration context from. Defaults to .scai/conversion-context. Generated context is always written to .scai/conversion-context. | No |
--overwrite-working-directory | Overwrite the output files in the snowflake/ directory and the Code Unit Registry Files. Off by default. | No |
--where <WHERE> | SQL-like filter to select which code units to convert (e.g. “objectType = ‘procedure’”). Only matched units are transformed; dependencies are still parsed for symbol resolution. | No |
Output: Converted Snowflake SQL files and reports
Examples:
scai code add¶
Add source code from an input file or directory to the project’s Source folder.
Prerequisites:
- A migration project initialized with ‘scai init’
- Input must be a valid SQL source file or a directory containing SQL source files
Behavior:
- Copies the specified file, or all files and directories from the input path, to artifacts/source_raw/
- SqlServer, Redshift, and Teradata: runs arrange-only, produces artifacts/source_raw_Processed/, merges into source/
- Other languages: copies source directly into source/
- When –code-already-split is used (SqlServer, Redshift, and Teradata), skips the arrange/split phase, promotes raw source directly to source/, runs assessment only for code unit registry generation, and marks the project as project type: Full (new folder structure)
- Checks for conflicting files when destination folders are non-empty (unless –overwrite is set)
- Reports up to 10 conflicting file names if conflicts are detected
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-i, --input-path <PATH> | Path to a source code file or directory to add to the project | Yes | |
--overwrite | Overwrite existing files in the project’s Source folder if they conflict with files being added | No | false |
--code-already-split | Skip the arrange/split phase when source code is already split (SqlServer, Redshift, and Teradata). Proceeds directly to code unit registry generation and marks the project as project type: Full (new folder structure). | No | false |
--source-id <SOURCE_ID> | Identifier for the source system where the code originates (e.g., server hostname or instance name). Recorded in the code unit registry under codeStatus.registration.sourceId. Defaults to the local machine name if not provided. | No |
Output: Original input in artifacts/source_raw/; source/ contains arranged output (SqlServer, Redshift, and Teradata) or copied source (other languages)
Examples:
scai code accept¶
Accept the latest converted artifact versions into the snowflake output folder.
Prerequisites:
- A migration project initialized with ‘scai init’
- Source code must be split and registry files must be generated (run ‘scai code add’)
- At least one code conversion run with ‘scai code convert’
Behavior:
- Scans the artifacts directory for timestamped conversion outputs
- For each code unit, selects the most recent version based on the timestamp folder name (yyyyMMdd.HHmmss)
- Copies the latest .sql files into the snowflake folder, preserving the directory structure
- Skips source_raw and source_raw_Processed directories
Options:
| Option | Description | Required |
|---|---|---|
--where <WHERE> | Filter expression to select which objects to accept. Run ‘scai code where’ for syntax reference. | No |
Output: Updated snowflake folder with latest artifact versions
Examples:
scai code deploy¶
Deploy converted SQL code to Snowflake.
Prerequisites:
- Converted code in ‘snowflake/Output/’ (from ‘scai code convert’)
- Snowflake connection configured (set with ‘scai init -c’ or project settings)
- Appropriate Snowflake privileges (CREATE TABLE, CREATE VIEW, etc.)
Behavior:
- Executes successfully converted objects (tables, views, procedures, functions)
- Uses Snowflake connection from connections.toml, config.toml, or project default
- –warehouse, –schema, –role temporarily set missing connection fields (in-memory only, TOML is not modified)
- If the connection already has a value for an overridden field, an error is returned
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-c, --connection <NAME> | The name of the Snowflake connection to use. Uses default if not specified. | No | |
-d, --database <NAME> | Target database name for deployment. Also sets the connection database if not already configured. Uses converted database name if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use for the Snowflake connection. Only applied if the connection does not already have a warehouse configured. | No | |
--schema <SCHEMA> | Schema to use for the Snowflake connection. Only applied if the connection does not already have a schema configured. | No | |
--role <ROLE> | Role to use for the Snowflake connection. Only applied if the connection does not already have a role configured. | No | |
--where <WHERE> | SQL-like WHERE clause to filter objects to deploy. Run ‘scai code where’ for syntax reference. | No | |
-a, --all | Deploy all successfully converted objects without selection prompt. | No | false |
-r, --retry <N> | Number of retry attempts for failed object deployments. | No | 1 |
--continue-on-error | Continue deploying remaining objects even if some fail. | No | true |
--include-dependencies | When used with –where, also deploy the dependencies of the filtered code units. Has no effect without –where, since all code units are already included. | No | false |
Output: Console output shows deployment progress and results for each object. Objects are created in the target Snowflake database/schema.
Examples:
scai code sync¶
Import a legacy migration project (.snowct) into the new SnowConvert AI Structure (Code Unit Registry).
Prerequisites:
- Existing source code directory with SQL files
- Existing converted Snowflake code directory
- Target project directory must not exist or must be empty
- Source language must be SqlServer or Redshift
Behavior:
- Creates a new SnowConvert project at the specified path
- Copies source code to the project’s source/ folder
- Validates the code unit registry for duplicate source file paths
- Runs a code conversion to generate full registry information
- Copies converted code to the project’s snowflake/ folder
- If any step fails, the project directory is deleted (rolled back)
Supported Dialects:
- SqlServer
- Redshift
Options:
| Option | Description | Required |
|---|---|---|
<PROJECT_PATH> | Directory where the new project will be created | Yes |
-l, --language <SOURCE_LANGUAGE> | Source dialect (sqlserver or redshift) | Yes |
-i, --input <SOURCE_FOLDER> | Path to existing source code directory | Yes |
--snowflake <CONVERTED_FOLDER> | Path to existing converted Snowflake code directory | Yes |
-c, --connection <CONNECTION> | Snowflake connection name (uses default if not specified) | No |
Output: Project directory with source/, snowflake/, .scai/, artifacts/, reports/, and logs/ folders.
Examples:
scai code where¶
Show WHERE clause query reference for code unit filtering.
Behavior:
- Displays all queryable fields, supported operators, and usage examples for WHERE clause filtering
- Does not require a project directory
- Works offline without network access
- When online, Snowflake is optional: account and user are read from local project configuration first when available, with a live connection test as a fallback when metadata is incomplete
- The reference is loaded dynamically from the CodeUnitRegistry native library (field list is auto-generated from the code-unit JSON schema)
Commands that support WHERE:
scai code accept --where <EXPRESSION>scai code convert --where <EXPRESSION>scai code deploy --where <EXPRESSION>scai code find --where <EXPRESSION>scai data migrate --where <EXPRESSION>scai data validate --where <EXPRESSION>
Output: Printed reference guide including syntax, operators, queryable fields with types and allowed values, and example WHERE expressions. The content is generated at runtime from the CodeUnitRegistry; run the command to see the current field list.
Examples:
scai code find¶
Find code units from project’s Code Unit Registry.
Prerequisites:
- A migration project initialized with ‘scai init’
- An initialized Code Unit Registry (generated after ‘scai code convert’)
Behavior:
- Reads code unit information from the Code Unit Registry
- Displays code units in a table with Id, Fully Qualified Name, and Object Type
- Results are limited to 100 by default; use –no-limit to show all
- Can be filtered using a SQL-like WHERE clause
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--where <WHERE> | SQL-like WHERE clause to filter objects to find. Run ‘scai code where’ for syntax reference. | No | |
--no-limit | Disables the limit on the number of objects to display. By default, the number of objects is limited to 100. | No | false |
Output: Console output shows code unit information in a table format.
Examples:
scai code resync¶
Re-scan modified converted files and update issue metadata in the Code Unit Registry.
Prerequisites:
- A migration project initialized with ‘scai init’
- Code converted with ‘scai code convert’
Behavior:
- Detects code units whose converted files have been modified
- Re-scans each modified file for SnowConvert issue codes (EWI, FDM, OOS, PRF)
- Updates the issue metadata in the registry
Output: Console output shows the number of modified files resynced
Examples:
scai data¶
Data operations: migrate, validate, worker, orchestrator, diagnostics.
scai data migrate¶
scai data migrate start (Preview)¶
Migrate data from the source system into a Snowflake account.
Prerequisites:
- Data migration configuration file (YAML); if –config is omitted, an ephemeral default config is auto-generated under the OS temp directory with a unique per-run affinity
- Snowflake connection with appropriate privileges
Behavior:
- Reads the migration configuration and runs the data migration workflow
- When –config is omitted, the generated workflow config is written to the OS temp directory and deleted when the run finishes
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--config | Path to the YAML configuration file. If omitted, an ephemeral default config is auto-generated under the OS temp directory with a unique per-run affinity and deleted when the run finishes. | No | data-migration-config.yaml |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Returns a WORKFLOW_ID for tracking progress
Examples:
scai data migrate create-workflow (Preview)¶
Create a cloud data migration workflow in Snowflake.
Prerequisites:
- Data migration configuration file (YAML); if –config is omitted, defaults to data-migration-config.yaml
- Orchestrator setup completed (run ‘scai data orchestrator setup’ first)
- Snowflake connection with appropriate privileges
Behavior:
- Validates the configuration and creates a Data Migration workflow in Snowflake
- By default, returns immediately after creating the workflow
- Use -w|–watch to wait for the workflow to complete
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--config | Path to the YAML configuration file. If omitted, defaults to data-migration-config.yaml. | No | data-migration-config.yaml |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No | |
-w, --watch | Wait for the workflow to complete. | No | false |
Output: Returns a WORKFLOW_ID for tracking progress
Examples:
scai data migrate status (Preview)¶
Check the status of a Cloud Data Migration workflow.
Prerequisites:
- A workflow started with ‘scai data migrate start’ or ‘scai data migrate create-workflow’
- Snowflake connection with access to the workflow
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-c, --connection <CONNECTION> | The Snowflake connection name to use. | No | |
-w, --watch | Display progress and poll for updates until workflow completes. | No | false |
Output: Progress bars for table preprocessing and partition processing. Error details if workflow failed.
Examples:
scai data migrate list (Preview)¶
List all Cloud Data Migration workflows.
Prerequisites:
- Snowflake connection with access to the SNOWCONVERT_AI database
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-c, --connection <CONNECTION> | The Snowflake connection name to use. | No | |
-s, --status <STATUS> | Filter workflows by status (pending, initializing, running, finished, failed). | No | |
--limit <LIMIT> | Maximum number of workflows to display. | No | 20 |
Output: A table with workflow name, status, creation time, end time, and error message.
Examples:
scai data migrate generate-config (Preview)¶
Generate a YAML configuration file for data migration.
Prerequisites:
- A migration project initialized with ‘scai init’
- Code added and converted (‘scai code add’ and ‘scai code convert’)
Behavior:
- Resolves source and target table names from the Code Unit Registry
- Generates a YAML config for ‘scai data migrate start’ (–config optional; defaults to data-migration-config.yaml)
- Sets synchronization strategy to ‘none’ and extraction strategy to ‘regular’
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--where <WHERE> | SQL-like WHERE clause to filter tables from the Code Unit Registry. Run ‘scai code where’ for syntax reference. | No | |
-o, --output | Output file path for the generated YAML configuration. Defaults to data-migration-config.yaml in the current directory. | No | data-migration-config.yaml |
--affinity | Affinity group for the workflow. The orchestrator only picks up workflows whose affinity matches its own. Supports wildcards. | No |
Output: A YAML file (default: data-migration-config.yaml) with source/target table mappings.
Examples:
scai data migrate pause (Preview)¶
Pause a running data migration workflow.
Prerequisites:
- An active workflow in ‘executing’ or ‘pending’ state
- Snowflake connection with appropriate privileges
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to pause. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was paused.
Examples:
scai data migrate resume (Preview)¶
Resume a paused data migration workflow.
Prerequisites:
- A workflow in ‘paused’ state
- Snowflake connection with appropriate privileges
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to resume. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was resumed.
Examples:
scai data migrate cancel (Preview)¶
Cancel a data migration workflow.
Prerequisites:
- A workflow that is not yet completed or already cancelled
- Snowflake connection with appropriate privileges
Behavior:
- Prompts for confirmation unless -y is passed
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to cancel. | Yes |
-y, --yes | Skip the confirmation prompt. | No |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was cancelled.
Examples:
scai data validate¶
scai data validate start (Preview)¶
Validate data between source and Snowflake.
Prerequisites:
- Data validation configuration file (JSON); if –config is omitted, an ephemeral default config is auto-generated under the OS temp directory with a unique per-run affinity
- Snowflake connection with appropriate privileges
Behavior:
- Reads the validation configuration and runs the data validation workflow
- When –config is omitted, the generated workflow config is written to the OS temp directory and deleted when the run finishes
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--config | Path to the JSON configuration file. If omitted, an ephemeral default config is auto-generated under the OS temp directory with a unique per-run affinity and deleted when the run finishes. | No | data-validation-config.json |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Returns a WORKFLOW_ID for tracking progress
Examples:
scai data validate create-workflow (Preview)¶
Create a cloud data validation workflow in Snowflake.
Prerequisites:
- Data validation configuration file (JSON); if –config is omitted, defaults to data-validation-config.json
- Snowflake connection with appropriate privileges
Behavior:
- Validates the configuration and creates a Data Validation workflow in Snowflake
- By default, returns immediately after creating the workflow
- Use -w|–watch to wait for the workflow to complete
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--config | Path to the JSON configuration file. If omitted, defaults to data-validation-config.json. | No | data-validation-config.json |
--custom-image | Custom container image path to use instead of auto-resolving the latest. Format: /db/schema/repo/image_name:tag | No | |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No | |
-w, --watch | Wait for the workflow to complete. | No | false |
Output: Returns a WORKFLOW_ID for tracking progress
Examples:
scai data validate status (Preview)¶
Check the status of a Cloud Data Validation workflow.
Prerequisites:
- A workflow started with ‘scai data validate start’ or ‘scai data validate create-workflow’
- Snowflake connection with access to the workflow
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-c, --connection <CONNECTION> | The Snowflake connection name to use. | No | |
-w, --watch | Display progress and poll for updates until workflow completes. | No | false |
Output: Per-table validation status showing schema, metrics, and row validation results.
Examples:
scai data validate list (Preview)¶
List all Cloud Data Validation workflows.
Prerequisites:
- Snowflake connection with access to the SNOWCONVERT_AI database
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-c, --connection <CONNECTION> | The Snowflake connection name to use. | No | |
-s, --status <STATUS> | Filter workflows by status (pending, initializing, running, finished, failed). | No | |
--limit <LIMIT> | Maximum number of workflows to display. | No | 20 |
Output: A table with workflow name, status, creation time, end time, and error message.
Examples:
scai data validate generate-config (Preview)¶
Generate a JSON configuration file for data validation.
Prerequisites:
- A migration project initialized with ‘scai init’
- Code added and converted (‘scai code add’ and ‘scai code convert’)
Behavior:
- Resolves source and target table names from the Code Unit Registry
- Generates a JSON config for ‘scai data validate start’ (–config optional; defaults to data-validation-config.json)
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--where <WHERE> | SQL-like WHERE clause to filter tables from the Code Unit Registry. Run ‘scai code where’ for syntax reference. | No | |
-o, --output | Output file path for the generated JSON configuration. Defaults to data-validation-config.json in the current directory. | No | data-validation-config.json |
Output: A JSON file (default: data-validation-config.json) with source/target table mappings.
Examples:
scai data validate pause (Preview)¶
Pause a running data validation workflow.
Prerequisites:
- An active workflow in ‘executing’ or ‘pending’ state
- Snowflake connection with appropriate privileges
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to pause. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was paused.
Examples:
scai data validate resume (Preview)¶
Resume a paused data validation workflow.
Prerequisites:
- A workflow in ‘paused’ state
- Snowflake connection with appropriate privileges
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to resume. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was resumed.
Examples:
scai data validate cancel (Preview)¶
Cancel a data validation workflow.
Prerequisites:
- A workflow that is not yet completed or already cancelled
- Snowflake connection with appropriate privileges
Behavior:
- Prompts for confirmation unless -y is passed
Options:
| Option | Description | Required |
|---|---|---|
<WORKFLOW_NAME> | The name of the workflow to cancel. | Yes |
-y, --yes | Skip the confirmation prompt. | No |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
Output: Confirmation that the workflow was cancelled.
Examples:
scai data worker¶
scai data worker setup (Preview)¶
Create the Data Exchange Worker SPCS service on the specified compute pool.
Prerequisites:
- Snowflake compute pool created and accessible
- Snowflake connection with appropriate privileges
Behavior:
- Creates the DEW SPCS service if it does not exist (idempotent)
- Waits for the service to reach a running state
Options:
| Option | Description | Required |
|---|---|---|
-p, --compute-pool | Name of the compute pool on which the Data Exchange Worker service will run. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
--custom-image | Custom container image path to use instead of auto-resolving the latest. Format: /db/schema/repo/image_name:tag | No |
Output: Status messages indicating progress of each setup step.
Examples:
scai data worker start (Preview)¶
Resume the Data Exchange Worker SPCS service, or run the local worker process when –local is passed.
Prerequisites:
- DEW service previously bootstrapped with ‘scai data worker setup’ (cloud mode)
- Python 3.11 or higher installed (local mode)
- A valid data exchange agent configuration file (local mode)
Behavior:
- Default (cloud): issues ALTER SERVICE … RESUME on the DEW SPCS service
- –local: installs the data exchange agent (if needed) and starts it as a foreground process
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--local | Run the data exchange worker as a local process (requires a DEW config file) instead of resuming the SPCS service. | No | false |
--auto-config <PATH> | Automatically generates the configuration file for the data exchange agent. Optionally accepts a target path; defaults to ~/.snowflake/scai/dew_configuration.toml. Cannot be used with CONFIG_FILE. | No | |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Status message (cloud) or real-time agent output (local mode).
Examples:
scai data worker stop (Preview)¶
Suspend or drop the Data Exchange Worker SPCS service.
Prerequisites:
- Snowflake connection with appropriate privileges
Behavior:
- By default, suspends the DEW service (can be resumed later)
- Use –drop to permanently remove the service
- –local is advisory only (local worker is a foreground process; use Ctrl-C to stop it)
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--drop | Drop the service instead of suspending it. Suspending is the default behavior. | No | false |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Status message indicating whether the service was suspended or dropped.
Examples:
scai data orchestrator¶
scai data orchestrator setup (Preview)¶
Start the Data Migration Service on a compute pool and wait for infrastructure to be ready.
Prerequisites:
- Snowflake compute pool created and accessible
- Snowflake connection with appropriate privileges
Behavior:
- Creates the SNOWCONVERT_AI.DATA_MIGRATION schema if needed
- Starts the Data Migration Service on the specified compute pool
- Waits for the Data Migration Service to set up the objects in the SNOWCONVERT_AI.DATA_MIGRATION schema
Options:
| Option | Description | Required |
|---|---|---|
-p, --compute-pool | Name of the compute pool that the Data Migration Service will run on. | Yes |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
--custom-image | Custom container image path to use instead of auto-resolving the latest. Format: /db/schema/repo/image_name:tag | No |
Output: Status messages indicating progress of each setup step.
Examples:
scai data orchestrator start (Preview)¶
Resume the cloud Data Migration Service (SPCS), or run the orchestrator locally when –local is passed.
Prerequisites:
- Service previously bootstrapped with ‘scai data orchestrator setup’
- Snowflake connection with appropriate privileges
Behavior:
- Default (cloud): issues ALTER SERVICE … RESUME on the Data Migration SPCS service
- –local: starts the orchestrator as a foreground process using the resolved Snowflake connection
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--local | Run the orchestrator as a local process instead of resuming the SPCS service. | No | false |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Status message indicating whether the service was resumed.
Examples:
scai data orchestrator stop (Preview)¶
Suspend or drop the Data Migration Service.
Prerequisites:
- Snowflake connection with appropriate privileges
- Orchestrator previously started with ‘scai data orchestrator setup’ or ‘scai data migrate start –start-service’
Behavior:
- By default, suspends the Data Migration Service (can be resumed later)
- Use –drop to permanently remove the service instead of suspending it
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--drop | Drop the service instead of suspending it. Suspending is the default behavior. | No | false |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from connections.toml). Uses default if not specified. | No | |
--warehouse <WAREHOUSE> | Warehouse to use. Overrides the value specified for the Snowflake connection. | No | |
--role <ROLE> | Role to use. Overrides the value specified for the Snowflake connection. | No |
Output: Status message indicating whether the service was suspended or dropped.
Examples:
scai data diagnostics (Preview)¶
Run diagnostic checks to verify Snowflake permissions for cloud data operations.
Behavior:
- Connects to Snowflake and inspects the role’s effective grants
- Follows the role hierarchy to detect inherited privileges
- Does not create or modify any objects
- Reports PASS, FAIL, WARN, or SKIP for each check
Checks:
- SNOWCONVERT_AI database exists or can be created
- DATA_MIGRATION schema exists or can be created
- Required schema privileges (CREATE TABLE, CREATE STAGE, CREATE FILE FORMAT, CREATE PROCEDURE, CREATE VIEW, CREATE SEQUENCE, USAGE)
- Optional privileges (CREATE STREAMLIT for the migration dashboard)
- DATA_VALIDATION schema exists and USAGE privilege is granted
Options:
| Option | Description | Required |
|---|---|---|
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (from config.toml or connections.toml). Uses default if not specified. | No |
Output: Per-check PASS/FAIL/WARN/SKIP results for Snowflake permission verification.
Examples:
scai license¶
Install offline license for air-gapped environments.
scai license install¶
Install an offline license for running conversions without online activation.
Prerequisites:
- A valid offline license file (.lic) from Snowflake
Behavior:
- Validates the license file
- Installs it for use by conversion commands
Use cases:
- Running in air-gapped environments without internet
- CI/CD pipelines that can’t use online activation
- Environments with restricted network access
Options:
| Option | Description | Required |
|---|---|---|
-p, --path <LICENSE_PATH> | Path to the license file to install | Yes |
Examples:
scai terms¶
Display the terms and conditions text. You must accept the terms before using most CLI commands.
Behavior:
- Displays the full terms and conditions text in a styled panel
- Does not prompt for acceptance; use ‘scai terms accept’ to accept
Examples:
scai terms accept¶
Display terms and conditions and prompt for acceptance.
Behavior:
- Displays the full terms and conditions text
- Prompts: Do you accept the terms and conditions?
- Records acceptance to ~/.scai/license-agreement.json when accepted
- If already accepted, reports success without prompting
CI/CD:
For CI/CD or non-interactive environments, set SCAI_ACCEPT_TERMS=true (or 1) to accept automatically without running this command.
Examples:
scai settings¶
View and manage user-level CLI settings stored in ~/.snowflake/scai/settings.json.
Behavior:
- Resolution order (precedence): SCAI_* environment variables, then ~/.snowflake/scai/settings.json, then built-in defaults from appsettings.json. When no layer supplies a value the source is reported as ‘unset’ (e.g. channel when no built-in is shipped).
- Writes are atomic: the file is replaced via a temp-file move so a partial write cannot leave invalid JSON on disk
Available Keys:
| Key | Description | Values | Env Var |
|---|---|---|---|
channel | Update channel to use. Auto-update will pull releases from the chosen channel. | stable | preview | dev | SCAI_CHANNEL |
autoUpdate | Enable or disable CLI auto-update. | true | false | SCAI_AUTO_UPDATE |
scai settings list¶
List all settings, their resolved values, and sources.
Behavior:
- Displays every known CLI setting with its currently resolved value and the source that produced it
- Surfaces active SCAI_* environment variable overrides explicitly
- Resolution order: SCAI_* env vars, then ~/.snowflake/scai/settings.json, then built-in defaults from appsettings.json. Source is reported as ‘unset’ when no layer supplies a value.
Options:
| Option | Description | Required |
|---|---|---|
--json | Emit the result as a structured JSON envelope (agent-friendly, stable schema). | No |
Output: Table with key, resolved value, and source for each setting. With –json, a structured envelope with a stable schema.
Examples:
scai settings get¶
Read a single setting’s resolved value and source.
Behavior:
- Reads the resolved value for KEY and reports the source that produced it
- Returns a non-zero exit code when KEY is unknown
- In –json mode emits a single-entry envelope with the same shape as ‘settings list’
- Resolution order: SCAI_* env vars, then ~/.snowflake/scai/settings.json, then built-in defaults from appsettings.json. Source is reported as ‘unset’ when no layer supplies a value.
Options:
| Option | Description | Required |
|---|---|---|
<KEY> | Setting key to read. | Yes |
--json | Emit the result as a structured JSON envelope. | No |
Output: Bare resolved value (pipe-friendly), or a single-entry JSON envelope when –json is set.
Examples:
scai settings set¶
Set one or more settings atomically (validate-then-write).
Behavior:
- All KEY=VALUE pairs are validated before any write
- If any pair is invalid, no changes are persisted (validate-then-mutate guarantee)
- Each KEY may appear at most once per invocation
- The file is written via a single atomic replace
- SCAI_* environment variables override the file, so a successful ‘set’ may not change the resolved value for the current process
Options:
| Option | Description | Required |
|---|---|---|
<KEY=VALUE> | One or more ‘key=value’ assignments to apply atomically. Each key may appear at most once. | Yes |
--json | Emit the result as a structured JSON envelope. | No |
Output: Per-key change report (Updated, Already set). With –json, a structured envelope listing requested, applied, and no-op changes.
Examples:
scai settings unset¶
Clear one or more settings from the file.
Behavior:
- All keys are validated before any write
- Unknown keys fail the whole batch and the file is left untouched
- Already-absent keys are reported as no-ops and skip the write
- Each KEY may appear at most once per invocation
- Built-in defaults take effect once a value is cleared, unless an SCAI_* environment variable is also set
- Surfaces active SCAI_* overrides so the resolved value is never a surprise
Options:
| Option | Description | Required |
|---|---|---|
<KEY> | One or more setting keys to clear from the file atomically. Each key may appear at most once. | Yes |
--json | Emit the result as a structured JSON envelope. | No |
Output: Per-key clear report (Cleared, was not set). With –json, a structured envelope listing requested, applied, and no-op clears.
Examples:
scai object-selector¶
Create selector files for filtering objects.
scai object-selector create¶
Create a selector file to filter objects for data migration.
Prerequisites:
- Code converted with ‘scai code convert’ (generates TopLevelCodeUnits report)
Behavior:
- Reads the TopLevelCodeUnits report from conversion
- Creates a YAML selector file for filtering objects
- Allows filtering by database, schema, and object type
Options:
| Option | Description | Required |
|---|---|---|
-d, --database <NAME> | Filter objects by source database name. | No |
-s, --schema <NAME> | Filter objects by source schema name. | No |
-t, --type <TYPES> | Filter objects by type (comma-separated, e.g., table,view,procedure). | No |
-n, --name <NAME> | Label for the selector file (becomes <name>.<timestamp>.yml), if not provided, it will be called object-selector.<timestamp>.yml. | No |
Output: selector.yml file with object definitions
Examples:
scai query¶
Execute SQL queries on source database systems.
Prerequisites:
- Source database connection configured via ‘scai connection add-sql-server’, ‘scai connection add-redshift’, ‘scai connection add-teradata’, ‘scai connection add-oracle’, or ‘scai connection add-postgresql’
- Network access to the source database
Behavior:
- Connects to the specified source database connection
- Executes the provided SQL query
- Displays query results in a formatted table
- Limits output to 1000 rows for readability
Options:
| Option | Description | Required |
|---|---|---|
-q, --query <QUERY> | SQL query to execute on the source system. | Yes |
-s, --source-connection <CONNECTION> | Name of the source connection to use for query execution. | Yes |
-l, --source-language <LANGUAGE> | Source database type (SqlServer, Redshift). If omitted, auto-detected from the connection name. | No |
Output: Query results printed as a formatted table in the terminal
Examples:
scai logs¶
Display the location of CLI log files and list recent entries.
Behavior:
- Shows the log directory path
- Lists the N most recent log files with size and age
- Use –open to open the directory in your file explorer
- Works offline without network access
- When online, Snowflake is optional: account and user are read from local project configuration first when available, with a live connection test as a fallback when metadata is incomplete
Options:
| Option | Description | Required | Default |
|---|---|---|---|
--last <COUNT> | Number of recent log files to display. | No | 5 |
--open | Open the log directory in the system file explorer. | No | false |
Output: Table of recent log files with name, size, and age. Total log file count.
Examples:
Supported Languages¶
scai supports two project types depending on the source language.
Full Migration¶
These languages support the complete migration workflow: code extraction from a live source database, conversion, AI improvement, deployment, data migration, and validation.
| Language |
|---|
| SqlServer |
| Redshift |
Code Conversion Only¶
These languages support code conversion from files on disk. Source code is added manually via scai code add or scai init -i.
| Language |
|---|
| Oracle |
| Teradata |
| BigQuery |
| Databricks |
| Greenplum |
| Sybase |
| Postgresql |
| Netezza |
| Spark |
| Vertica |
| Hive |
| Db2 |
Workflows¶
Full (SqlServer/Redshift/Teradata/Oracle)¶
Complete migration workflow for Full project type (SqlServer, Redshift, Teradata, Oracle).
Code conversion only (Other Languages)¶
Workflow for Code conversion only project type (no extract from source DB).
Snowflake Connection¶
SnowConvert AI uses the Snowflake CLI for Snowflake connections. This is separate from the scai CLI.
Configuration:
Usage in scai:
Connection precedence (highest to lowest):
-c/--connectionoption on thescaicommand- Project connection (set by
scai project set-default-connectionorscai init -c) - Default TOML connection (set by
snow connection set-default)
For more details on configuring Snowflake connections, see the Snowflake CLI connection documentation.
Test Commands¶
Generate test cases for migrated stored procedures.
scai test seed¶
Generate YAML test case files for converted stored procedures.
Prerequisites:
- A migration project initialized with ‘scai init’
- Code converted with ‘scai code convert’
- Optional: an execution log file produced by running the original stored procedures
Behavior:
- When –execution-log is provided: reads it, matches procedure calls to their converted counterparts, and generates one YAML per procedure with up to –max-cases test cases (default: 10)
- When –execution-log is omitted: generates a stub YAML with a commented test_cases placeholder for every converted code unit
- Validates source connection (–source-connection or default source connection)
- Validates Snowflake connection (–connection, project connection, or default connection)
- By default, existing test files are overwritten (use –append to add instead)
Options:
| Option | Description | Required | Default |
|---|---|---|---|
-s, --source-connection <SOURCE_CONNECTION> | Name of the source connection to use (from configured source connections). Uses default if not specified. | No | |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use. Uses project/default connection if not specified. | No | |
-m, --max-cases <MAX_CASES> | Maximum number of test cases to generate per procedure. | No | 10 |
-a, --append | Append test cases to existing test files instead of replacing them. | No | |
-e, --execution-log <EXECUTION_LOG> | Path to the execution log file produced by running the original stored procedures. Optional — when omitted, every code unit gets a stub YAML with a commented test_cases placeholder. | No |
Output: One YAML test case file per procedure, nested under the artifacts folder
Examples:
scai test capture¶
Capture test baselines from the source database.
Prerequisites:
- A migration project initialized with ‘scai init’
- Test YAML files in artifacts/**/test/*.yml (generated by ‘scai test seed’)
- A configured source database connection
- A Snowflake connection (unless –keep-baselines is set)
Behavior:
- Executes each test case on the source database
- By default, uploads baselines to the Snowflake stage @
<db>.VALIDATION.BASELINES and keeps no copy on disk - With –keep-baselines, also persists baselines locally under artifacts/**/baselines/
<YYYYMMDD>/
Options:
| Option | Description | Required |
|---|---|---|
-s, --source-connection <SOURCE_CONNECTION> | Name of the source connection to use (from configured source connections). Uses default if not specified. | No |
-c, --connection <CONNECTION> | Name of the Snowflake connection to use (for baseline stage upload). Uses project/default connection if not specified. | No |
--keep-baselines | Also persist baselines locally under artifacts/**/baselines/<YYYYMMDD>/. Default: baselines are uploaded to Snowflake only and not written to disk. When set without -c/–connection, capture runs fully offline. | No |
Output: By default, baseline JSON files are uploaded to @<db>.VALIDATION.BASELINES and removed from disk. With –keep-baselines, copies remain under artifacts/**/baselines/<YYYYMMDD>/.
Examples:
scai test validate¶
Validate Snowflake procedures against captured baselines.
Prerequisites:
- A migration project initialized with ‘scai init’
- Baselines captured with ‘scai test capture’
- A configured Snowflake connection
Behavior:
- Discovers test YAML files with target steps
- Loads baselines from the implicit Snowflake stage @
<db>.VALIDATION.BASELINES (or –baseline-stage) - Executes each test case on Snowflake and compares results
- Reports pass/fail/error status for each test case
Options:
| Option | Description | Required |
|---|---|---|
-c, --connection <CONNECTION> | Name of the Snowflake connection to use. Uses project/default connection if not specified. | No |
--baseline-stage <BASELINE_STAGE> | Snowflake stage containing baselines. Uses implicit default stage if not specified. | No |
--create-schema | Create the VALIDATION schema and objects before running. | No |
Output: Pass/fail/error status report for each test case
Examples: