SchemaSmith Documentation

Console & Commands

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

By the SchemaSmith Team ยท Last reviewed

Ask Forge Console and Commands

Launch ask-forge from a schema product directory and have a conversation.

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
> 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 47 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 schemasmith_ prefix + snake_case schemasmith_list_tables

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

Commands by Tier

All 47 tools are organized into four tiers based on their impact level. Access is governed by three trust levels — Observer, Assistant, and Operator — each unlocking progressively more powerful tiers.

Tier 1: Read-Only (28 tools)

Full Reference

Available at all trust levels (Observer and up). Read and analyze schema data without making changes.

CommandDescription
navigate-contextSet the active product, template, or table (required before inspecting tables)
show-contextShow the active product, template, and table selection
list-tablesList all table names 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
list-connectionsList configured database connections
show-tableShow full table JSON: columns, indexes, and foreign keys
show-configShow current configuration and database connections
show-conventionsDetect naming conventions from the current template
show-platform-capabilitiesShow platform capabilities, naming rules, and feature support
check-dataGenerate SQL to check data quality: nulls, orphans, or duplicates
dependenciesAnalyze the FK dependency graph: list, circular references, topological sort, or cascade impact
review-schemaAnalyze schema for naming, indexing, nullability, and relationship issues
validate-jsonValidate table JSON against platform schema rules
diff-tablesCompare two table definitions and show differences
plan-migrationGenerate a migration plan comparing two git refs
search-schemasSearch columns across all tables by name, type, or properties
search-knowledgeSearch knowledge base articles for best practices
list-materialized-viewsList materialized views in the current template (PostgreSQL only)
show-materialized-viewShow a materialized view definition (PostgreSQL only)
diff-materialized-viewsCompare two materialized view definitions (PostgreSQL only)
list-indexed-viewsList indexed views in the current template (SQL Server only)
show-indexed-viewShow an indexed view definition (SQL Server only)
diff-indexed-viewsCompare two indexed view definitions (SQL Server only)
discover-toolsFind specialized tools by describing what you want to do
execute-toolRun a tool by name with arguments (use after discover-tools)
view-logView or open external tool log files

Tier 2: Generate (3 tools)

Full Reference

Requires Assistant trust level or higher. Produce new content — schemas, change analysis, connection config — without altering existing files.

CommandDescription
generate-schemaGenerate platform-specific table JSON from a natural-language or structured blueprint
suggest-changesAnalyze a proposed change and generate migration scripts with risk assessment
manage-connectionSet or clear a database connection for a platform

Tier 3: Modify (13 tools)

Full Reference

Requires Operator trust level. Create or change files in your schema package. All tools prompt for confirmation before writing.

CommandDescription
apply-changeModify schema JSON files to apply changes
create-tableCreate a new table with platform-correct conventions and an auto-generated PK
rename-columnRename a column with cascade through indexes, FKs, and constraints
rename-tableRename a table with FK cascade and script scanning
apply-generated-schemaWrite generated schema tables to the template directory as JSON files
save-scriptSave a SQL script to a product/template script folder
save-migrationSave a migration plan as a markdown summary and SQL scripts
create-packageCreate a deployment package (zip) from schema files
add-folderCreate a script folder with QuenchSlot inference, or a subfolder
manage-tokensManage script tokens: list, add, update, remove, scan, or suggest
configure-data-deliveryConfigure data delivery settings for a table
create-materialized-viewCreate a materialized view definition file (PostgreSQL only)
create-indexed-viewCreate an indexed view definition file (SQL Server only)

Tier 4: External (3 tools)

Full Reference

Requires Operator trust level. Run the SchemaSmith CLI tools as subprocesses against 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 (always defaults to dry-run mode)
run-data-tongsExtract table data to JSON content and MERGE scripts

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 rich formatting. Useful for scripting and automation.
--yes -y Skip confirmation prompts for this invocation (applies to Modify and External commands).

There is no --trust-level flag and no global --platform flag. Trust level is set in your config file (agent.trustLevel) or the REPL (config set trustlevel) — see Trust Levels. Platform is a per-command parameter on connection and external commands (values SqlServer, PostgreSQL, MySQL), auto-detected from product context when omitted.

Getting Help

# List all commands
ask-forge --help

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

# Check installed version
ask-forge --version