SchemaSmith Documentation

Console & Commands

46 tools available in single-command and interactive REPL modes — no LLM subscription required for direct tool invocation.

Ask Forge Console and Commands

Two Usage Modes

Every tool works the same way in both modes. The difference is session management: single-command mode runs one tool and exits, while the REPL keeps your context loaded across multiple commands.

Run a tool and exit. Provide --product and --template on every invocation. Ideal for scripting, automation, and one-off operations.

ask-forge <command> [options]

Examples:

# List all tables in a template
ask-forge list-tables --product ./MyProduct --template Default

# Review schema for issues
ask-forge review-schema --product ./MyProduct --template Default

# Show a specific table's structure
ask-forge show-table --product ./MyProduct \
  --template Default --table Users

# Output as JSON for scripting
ask-forge list-tables --product ./MyProduct \
  --template Default --json

Launch with no arguments. The --product and --template context persists across commands. If an LLM is configured, natural-language questions work too.

ask-forge

Example session:

> navigate-context --product ./MyProduct --template Default
> list-tables
> show-table --table Users
> show-dependencies --table Users
> review-schema --tables "Users,Orders"

# Natural language (requires LLM provider)
> What tables reference the Users table?
> Show me missing indexes on Orders
All 46 tools work without an LLM provider. Natural-language queries in the REPL require an LLM — see LLM Providers for setup.

Tool Naming Conventions

The same tool has three name formats depending on where you use it:

Context Format Example
Internal / code registry snake_case list_tables
CLI & REPL kebab-case list-tables
MCP server forge_ prefix + snake_case forge_list_tables

In the CLI and REPL, always use kebab-case. The MCP server uses the forge_ prefix to avoid tool-name collisions with other MCP servers.

Commands by Tier

All 46 tools are organized into four tiers based on their impact level. Access is controlled by trust levels.

Tier 1: Read-Only (24 tools) Full Reference

Available at all trust levels. Read and analyze schema data without making changes.

CommandDescription
show-contextShow current product, template, and table selection
show-tableShow table structure including columns, keys, and indexes
list-tablesList all tables in the current template
list-templatesList all templates in the current product
list-foldersList all script folders with summary info
list-scriptsList scripts in a specified folder
show-configShow current configuration including connections and tool paths
list-connectionsList configured database connections
show-platform-capabilitiesShow platform feature support and naming rules
check-nullsGenerate query to check for NULL values in a column
check-orphansGenerate query to check for orphaned FK references
check-duplicatesGenerate query to check for duplicate values
check-namingCheck naming conventions against platform rules
show-dependenciesShow FK dependency graph for a table
show-all-dependenciesShow all FK relationships across the template
analyze-dependency-graphDetect circular dependencies, topological ordering, cascade impact
show-conventionsDetect and display naming conventions from the template
diff-tablesCompare two table definitions and show differences
review-schemaComprehensive schema review with severity and recommendations
analyze-indexesAnalyze index coverage, missing FK indexes, redundant indexes
plan-migrationCompare schema between git refs and produce a migration plan
search-knowledgeSearch the knowledge base for articles and best practices
search-schemasSearch columns across all tables by name, type, or table
validate-jsonValidate table or template JSON structure
Tier 2: Generate (9 tools) Full Reference

Requires Assistant trust level. Generate scripts, schemas, and configuration changes without modifying existing files.

CommandDescription
generate-migrationGenerate SQL migration script for a schema change
suggest-changesAnalyze a proposed change with risk assessment and recommendations
generate-schemaGenerate platform-specific table JSON from a blueprint spec
save-scriptSave a SQL script to a script folder
save-migrationSave a migration plan to disk as markdown and SQL files
set-connectionSet or update the database connection for a platform
set-tool-pathSet the path to a SchemaSmith tool for a platform
clear-connectionRemove the database connection for a platform
clear-tool-pathRemove a tool path configuration for a platform
Tier 3: Modify (9 tools) Full Reference

Requires Operator trust level. Modify schema JSON files on disk. All tools prompt for confirmation before execution.

CommandDescription
navigate-contextChange the current product, template, or table selection
apply-changeModify schema JSON files to apply column, index, or FK changes
create-tableCreate a new table with platform-correct conventions
rename-columnRename a column with full cascade through indexes and FKs
rename-tableRename a table with cascade through FK references
apply-generated-schemaWrite generated schema tables to template directory
create-packageCreate a deployment package (zip) with schema and scripts
add-folderCreate a new script folder with QuenchSlot registration
manage-tokensManage script tokens: list, add, update, remove, scan, suggest
Tier 4: External (4 tools) Full Reference

Requires Operator trust level. Run external SchemaSmith applications that interact with live databases. All tools prompt for confirmation.

CommandDescription
run-schema-tongsExtract schema from a database to JSON files
run-schema-quenchApply schema JSON to a database (defaults to dry-run)
run-data-tongsExtract table data to JSON content files and MERGE scripts
view-logView or open external tool log files

Global CLI Options

These options are available on all commands:

Option Short Description
--product <path> -p Path to the SchemaSmith product directory. Persists across commands in REPL mode.
--template <name> -t Template name within the product. Persists across commands in REPL mode.
--json Output results as JSON instead of formatted text. Useful for scripting and automation.
--yes -y Skip confirmation prompts. Applies to single-command mode only (not REPL).
--trust-level Override the trust level for the session (observer, assistant, operator).
--platform Override the target database platform (mssql, postgres, mysql).

File Input with @file

Parameters that accept large JSON or multi-line content can load from files using the @ prefix:

ask-forge apply-change --table Users --definition @column-def.json
ask-forge save-script --content @migration.sql --folder Migrations \
  --filename update.sql

Getting Help

# List all commands
ask-forge --help

# Help for a specific command
ask-forge list-tables --help

# Check installed version
ask-forge --version