What is SnowConvert CLI?¶
SnowConvert AI CLI (scai) encapsulates all SnowConvert functions into a single command line tool dedicated to increasing the speed of migrations from various source platforms into Snowflake.
With the SnowConvert AI CLI, migration engineers can:
- extract code from their source platform
- run a deterministic conversion on that code
- deploy that code to Snowflake
- migrate data from the source system to Snowflake
- validate that data between the two systems
The CLI will also allow developers to create skills and agents that utilize the tool to automate their process.
Prerequisites¶
-
macOS, Windows, or Linux
-
SnowflakeCLI: recommended for Snowflake connection configuration SnowCLI Install Guide
-
A source database to extract from, or a set of code to use
Snowflake Connection Setup¶
The SnowConvert AI CLI (scai) reuses your Snowflake CLI connection configuration. The connection is used for deploy and the cloud versions of data migration and validation. Your Snowflake account also authenticates you for SnowConvert, skipping the need for an access code that was necessary in prior versions.*
Snowflake Account Requirement
Before using scai init, scai code convert, scai code extract, or scai code deploy, ensure that you:
Can connect to Snowflake with snow connection test Your Snowflake CLI has a default connection configured (this is used when you don’t specify a name).
To configure a Snowflake connection:
Once this is configured, commands needing a connection to Snowflake will use your Snowflake CLI connection automatically.
Installation¶
Installer scripts (recommended)¶
macOS and Linux¶
Windows¶
Homebrew Installation (macOS only - legacy)¶
If you do not have homebrew installed, follow the instructions here.
There are two public channels for builds, Preview and GA.
Stable Version (recommended)
Install the stable production (GA) release:
Preview Version
Install the Preview (pr) version with pre-release features from the beta/staging environment:
Usage
After installation, you can use the SnowConvert CLI:
Managing Installations
View installed Version
Switch between versions
Update to latest version
Important: you must run brew update first to sync the tap with the latest cask definitions:
Why both commands? brew update synchronizes your local tap with the latest cask definitions from GitHub. Without it, brew upgrade won’t see new versions even if they exist on the server.
Installer Packages (macOS, Linux, Windows - legacy)¶
GA Releases
OS | Installer |
|---|---|
| macOS | Apple Silicon |
| macOS | Intel |
| Linux | arm64 .pkg |
| Linux | arm64 .deb |
| Linux | x64 .rpm |
| Linux | x64 .deb |
| Linux | x64 .tar.gz |
| Linux | arm64 .tar.gz |
| Windows | arm64 .msi |
| Windows | x64 .msi |
Preview Releases
OS | Installer |
|---|---|
| macOS | Apple Silicon |
| macOS | Intel |
| Linux | arm64 .pkg |
| Linux | arm64 .deb |
| Linux | x64 .rpm |
| Linux | x64 .deb |
| Linux | x64 .tar.gz |
| Linux | arm64 .tar.gz |
| Windows | arm64 .msi |
| Windows | x64 .msi |
Accept Terms and Conditions¶
Issuing the following command will display the license terms for using the SnowConvert AI CLI. It is required that you do this in order to use the product.
Understanding Projects¶
A project is required before you can use any other scai command. This is similar to how Git requires you to run git init before using other Git commands.
A project:
- Organizes your migration work in a dedicated folder structure
- Tracks your source dialect (Oracle, SQL Server, Teradata, etc.)
- Stores configuration, source code, converted code, and reports
When you run scai init, it creates this folder structure in the target directory.
- If you pass a PATH, scai will create that folder (if it doesn’t exist) and initialize the project inside it.
- If you omit PATH, scai initializes the current directory (which must be empty).
The following folder structure:
Important: after creating a project, run all subsequent scai commands from within the project folder (where the .scai directory is).
CLI Logs are written to ~/.scai/logs/jobs.log by default
Quick Start: Code Conversion Only¶
Use this workflow when you have existing SQL files to convert. Works with all supported dialects.
[!IMPORTANT] You must already be in an empty directory to create a project.
#1. Create a project folder and initialize it (project name is inferred from folder name)
#2. Add your source code
#3. Convert to Snowflake SQL
#4. Deploy to Snowflake
Your converted code will be in the snowflake/ folder, and conversion reports in reports/.
Quick Start: End-to-End Migration¶
Use this workflow to extract code directly from your source database. Available for source platforms that support extraction (see Supported Source Dialects below).
Step 1: Create Project # Create a project folder and initialize it (project name is inferred from folder name)
Step 2: Configure Source Connection
The interactive mode will prompt you for connection details.
Set a default source connection (used with scai code extract runs without -source-connection)
Or
Step 3: Extract, Convert, Deploy
#extract code from source database
#convert to Snowflake SQL
#deploy to Snowflake
Filtering Objects with the --where Clause¶
Many scai commands operate on the Code Unit Registry – a local index of every code unit (table, view, procedure, function, etc.) in your project. The --where flag lets you filter which objects a command acts on, using a SQL-like expression against that registry.
This section covers how the WHERE clause works, which commands support it, and how to use it effectively.
How the Code Unit Registry works¶
- When you run
scai code addorscai code extract, source code is added to your project and split into individual code units. - When you run
scai code convert, the CLI builds a registry entry for every code unit, tracking its source/target metadata, object type, and conversion status. - When you pass
--whereto a supported command, the CLI queries that registry and applies the operation only to matching objects.
The registry must exist before --where can be used. If you haven’t run at least scai code add (or scai code extract) yet, --where will fail with a “registry not found” error.
Discovering queryable fields: scai code where¶
Run scai code where to see the full, up-to-date reference of all queryable fields, supported operators, and usage examples. The output is generated from the actual registry library, so it is always current.
The most commonly used fields (all field names are camelCase, all enum values are lowercase):
| Field | Description | Example values |
|---|---|---|
source.name | Object name in the source database | 'my_procedure' |
source.objectType | Object type in source | 'table', 'procedure', 'view', 'function' |
source.database | Source database name | 'my_db' |
source.schema | Source schema name | 'dbo', 'public' |
target.name | Object name in Snowflake | 'MY_PROCEDURE' |
target.objectType | Object type in Snowflake | 'table', 'procedure', 'view', 'function' |
target.database | Target database name | 'MY_DB' |
target.schema | Target schema name | 'PUBLIC' |
codeStatus.conversion.status | Conversion result | 'pending', 'completed', 'failed', 'excluded' |
codeStatus.registration.status | Registration/extraction result | 'pending', 'completed', 'failed', 'excluded' |
Previewing results: scai code find¶
Before running a destructive or long-running operation, use scai code find to test your filter and see which objects match:
scai code find accepts the same --where syntax as all other commands that support it. Use it as a dry-run before committing to an operation.
Commands that support --where¶
The following table summarizes every scai command that accepts the --where flag:
| Command | Purpose | --where notes |
|---|---|---|
scai code find | Preview/query code units in the registry | Primary tool for testing filters before using them elsewhere |
scai code convert | Convert source code to Snowflake SQL | Only matched units are transformed; dependencies are still parsed for symbol resolution |
scai code deploy | Deploy converted code to Snowflake | Also supports --include-dependencies to automatically include objects that filtered objects depend on |
scai code accept | Accept latest artifact versions into the snowflake folder | |
scai data migrate generate-config | Filter tables written into a data migration config | Selects tables from the Code Unit Registry |
scai data validate generate-config | Filter tables written into a data validation config | Selects tables from the Code Unit Registry |
Each of these commands uses the same WHERE clause syntax. The recommended workflow is:
scai code find --where¶
Query the Code Unit Registry and display matching objects. This is the safest way to test a filter before using it with a command that makes changes.
| Flag | Description |
|---|---|
--where <WHERE_CLAUSE> | SQL-like WHERE clause to filter objects |
--no-limit | Show all results (default limit is 100) |
Examples:
scai code convert --where¶
Convert only a filtered subset of code units to Snowflake SQL. Objects that don’t match the filter are still parsed for dependency and symbol resolution, but only matched units produce converted output.
| Flag | Description |
|---|---|
--where <WHERE_CLAUSE> | SQL-like filter to select which code units to convert |
--overwrite-working-directory | Overwrite existing output files in the snowflake/ directory |
-x, --show-ewis | Show detailed EWI table instead of summary |
Examples:
Note: Even when filtering, the converter still parses all source files for symbol resolution. This ensures that cross-object references (e.g., a procedure referencing a table) are resolved correctly, even if the referenced object is not in the
--wherefilter.
scai code deploy --where¶
Deploy a filtered subset of converted objects to Snowflake, instead of deploying everything.
| Flag | Description |
|---|---|
--where <WHERE_CLAUSE> | SQL-like WHERE clause to filter objects to deploy |
--include-dependencies | Also deploy the dependencies of the filtered code units. Has no effect without --where, since all code units are already included. |
-c, --connection <CONNECTION> | Snowflake connection to use |
-d, --database | Target database name for deployment |
-a, --all | Deploy all successfully converted objects without selection prompt |
-r, --retry | Number of retry attempts for failed deployments (default: 1) |
--continue-on-error | Continue deploying remaining objects even if some fail (default: True) |
--warehouse <WAREHOUSE> | Warehouse override (in-memory only, applied if connection has none) |
--schema <SCHEMA> | Schema override (in-memory only) |
--role <ROLE> | Role override (in-memory only) |
Examples:
Why --include-dependencies matters: When you filter with --where, you may select procedures that depend on tables or views. Without --include-dependencies, those dependent objects won’t be deployed, and the procedures may fail at runtime. Use this flag to automatically pull in everything the filtered objects need.
scai code accept --where¶
Accept the latest artifact versions into the snowflake output folder for a filtered subset of objects. Without --where, all objects are accepted.
| Flag | Description |
|---|---|
--where <WHERE_CLAUSE> | Filter expression to select which objects to accept |
Examples:
scai data migrate generate-config --where / scai data validate generate-config --where¶
For data migration and validation, --where is applied when you generate the workflow config — it selects which tables from the Code Unit Registry are written into the YAML that scai data migrate / scai data validate then run.
| Flag | Description |
|---|---|
--where <WHERE> | SQL-like WHERE clause to filter tables from the Code Unit Registry |
-o, --output <PATH> | Output path for the generated YAML config (defaults under .scai/config/) |
--affinity <AFFINITY> | (migrate only) Affinity group for the workflow |
Examples:
Note:
--wherefilters tables at config-generation time. For code-conversion-only projects (no registry), build the table list withscai object-selector createinstead.
Common --where scenarios¶
Inspect objects that failed conversion¶
After running scai code convert, some objects might have failed. Find just those to review:
Focus on a specific object type in a specific schema¶
Deploy only tables, then only procedures with dependencies¶
Incremental deployment of a single schema¶
Things to keep in mind¶
- Filtering data-migration tables: use
scai data migrate generate-config --where(registry-backed, full-migration projects) orscai object-selector create(code-conversion-only projects). - The registry must exist. You need to have run at least
scai code addorscai code extractbefore--wherewill work. Otherwise you’ll get a “registry not found” error. - Use
scai code findto preview. Always test your filter withscai code find --where "..."before running a deployment job. scai code whereis the definitive reference. The field list in this document covers the most common fields. Runscai code wherefor the full, always-up-to-date list of fields, operators, and examples.
Workflow Examples¶
Example 1: Migrate Oracle Stored Procedures¶
Example 2: SQL Server End-to-End with Specific Schema¶
Example 3: Selective Migration Using --where¶
Getting Help¶
Use –help with any command to see available options:
Troubleshooting¶
“Project file not found” You must run commands from within a project directory. Navigate to your project folder (where the .scai/ directory exists) before running commands:
“Connection not found” (source database)
- List your connections: scai connection list -l <language>
- Add a connection if needed: scai connection add-sql-server or scai connection add-redshift
- Or set a default: scai connection set-default -l <language> -s <name>
“Authentication failed” for Snowflake
The SCAI CLI uses your Snowflake CLI configuration. Ensure your connection is working:
Make sure you have a default Snowflake connection configured in the Snowflake CLI (used when no connection name is specified).
“Registry not found” when using --where
The --where flag requires a Code Unit Registry, which is created when you run scai code add or scai code extract. Make sure you’ve run one of those commands before using --where:
Supported Source Dialects¶
| Dialect | Extract | Convert | Deploy |
|---|---|---|---|
| SQL Server | X | X | X |
| Redshift | X | X | X |
| Teradata | X | X | X |
| Oracle | X | X | X |
| PostgreSQL | X | X | X |
| BigQuery | X | X | X |
| Azure Synapse | X | X | X |
| Databricks | X | ||
| Greenplum | X | ||
| Sybase | X | ||
| Netezza | X | ||
| Spark | X | ||
| Vertica | X | ||
| Hive | X | ||
| DB2 | X |
Extract =
scai code extract(live DDL extraction from a source connection). Convert =scai code convert(deterministic conversion to Snowflake SQL). Deploy =scai code deploy(deploy converted DDL into Snowflake). Redshift, SQL Server, and Teradata additionally support deploying back to the source platform withscai code deploy -t source.
Complete CLI Reference¶
For quick reference, here is every top-level command and subcommand available in the scai CLI:
| Command | Subcommands | Description |
|---|---|---|
scai init | Create a new migration project | |
scai project | info, status, doctor, defaults set, defaults unset | View and manage project configuration |
scai connection | add-sql-server, add-redshift, add-teradata, add-oracle, add-postgresql, add-azuresynapse, add-bigquery, set-default, list, test, remove | Manage source database connections |
scai code | extract, convert, add, deploy, find, accept, where, sync, resync | Manage code migration operations |
scai data | migrate, validate, worker, orchestrator, doctor | Data migration and validation |
scai assessment | object-exclusion, waves | Generate migration planning insights from source code and SnowConvert reports |
scai test | seed, capture, validate, etl-validate, doctor | Generate and run test cases for stored procedures |
scai object-selector | create | Generate selector files for filtering objects |
scai query | Execute SQL queries on source database systems | |
scai settings | list, get, set, unset | View and manage user-level CLI settings |
scai versions | remove | List and remove locally installed CLI versions |
scai license | install | Install offline license for air-gapped environments |
scai terms | accept | View and accept terms and conditions |
scai logs | Show log directory and recent log files | |
scai update | Force an immediate self-update on the current channel |