The ask-forge command line: a REPL for conversation, a subcommand for every tool, global options for scripted runs, JSON output, sessions, and the exit codes it returns.
By the SchemaSmith Team · Last reviewed
Launch ask-forge from a schema product directory and have a conversation.
The standalone command-line interface, ask-forge, offers an interactive REPL, covered here, along with direct subcommands and a one-shot question, covered below. In the REPL, the AI chains tools together, asks clarifying questions and remembers context across turns.
Run ask-forge with no command to start it. Name your schema package with --product, or launch from the package's folder and Ask Forge finds the package itself:
ask-forge --product C:\path\to\my-product
ask-forge --product /path/to/my-product
Inside the REPL, anything that is not one of these commands is a question for Ask Forge. Answering one needs an LLM provider, and the agent that answers works within your trust level. With no provider set up, a question gets the built-in hints instead.
| Command | What it does |
|---|---|
product <path> |
Load a schema product directory |
template <name> |
Select a template; template none goes back to the product |
table <name> |
Select a table; table none goes back to the template |
clear |
Clear all context |
<command> [options] |
Run any tool command; <command> --help shows its options |
learn, learn <category>, learn <topic> |
List the knowledge base categories with article counts, browse the articles in a category, or search articles by topic |
llm |
Show LLM status and providers |
llm setup, llm use <name>, llm test |
Run the interactive setup wizard, switch to a different provider, or test the connection to the active provider |
llm models, llm set <property> <value> |
List available models, or set the model, endpoint, or API key |
config, config agent |
Show all configuration, or the agent settings |
config agent <property> <value> |
Set an agent setting, such as config agent trustLevel operator |
config connection, config connection <platform> |
Show the configured connections, or one platform's |
config tools |
Show where Ask Forge found the SchemaSmith Community tools |
session … |
Show, save, load, list, clear and delete conversations (see Sessions) |
cls |
Clear the screen |
help |
Show every command |
exit |
Leave the REPL; quit does the same |
Connections are set with the manage-connection tool command, the same in the REPL as on the command line. Configuration lists the connection fields and the agent settings.
Type any subcommand by name, with the options it takes on the command line. The product and template you selected are used, so you do not repeat --product:
template Main
list-tables
show-table --table Customers
review-schema --help
Ask Forge keeps the product, template and table you select for the next run, and a subcommand given no product picks them up, as described under Direct Subcommands.
The REPL maintains conversation context, product/template selection, and tool state across turns. To keep a conversation for later, save it as a session:
| Command | What it does |
|---|---|
session |
Show the current session |
session save <name> |
Save the conversation under a name |
session load <name>, session load last |
Load a saved session, or the most recent one |
session list |
List saved sessions |
session clear |
Clear the conversation memory |
session delete <name> |
Delete a saved session |
Named sessions are written to the session directory: ~/.schemasmith/sessions, unless the sessionDirectory setting in askforge.json names another. Turn on autoSaveSession, in the file or with config agent autoSaveSession true in the REPL, and the conversation is saved after every reply, to the directory's auto/ subfolder, where the ten most recent are kept.
A saved session is a transcript, so treat it as sensitive. Values that Ask Forge passes to a tool are masked before they are written. What you type is not masked: your own words reach the file unchanged. The CLI says so when you turn auto-save on, at launch when it is already on, and when you run session save. Keep credentials out of the conversation and supply them as tool arguments or environment variables.
To end the exposure, delete the files: session delete for a named session, or remove the auto/ subfolder of the session directory for the auto-saves. Turning autoSaveSession off stops new writes but leaves the existing files in place. Configuration covers moving the session directory.
Every tool is also a direct command, and none needs an LLM. Use them in scripts and CI pipelines, or when you know exactly what you want. A subcommand's name is the tool's name in kebab-case, without the schemasmith_ prefix the MCP server adds, so schemasmith_review_schema over MCP is review-schema here:
ask-forge review-schema --product ./my-product
ask-forge list-tables --product ./my-product
ask-forge search-knowledge --query "migration scripts"
--help on its own lists every subcommand and the global options. Add it to a subcommand to see that command's own options:
ask-forge review-schema --help
Each parameter of a tool is an option of its own, named in kebab-case: the tool's change_type parameter is --change-type on the command line. Every subcommand also takes --json, which prints the result as JSON (see Global Options), and --yes (-y), which skips confirmation for that run.
A text option whose value is @ followed by a path reads the file at that path, so a long JSON value can live in a file. Join the value to its option with =:
ask-forge create-table --table Widgets --columns=@columns.json
If the file is not there, the command stops with File parameter error and exits with 1.
A Modify or External command asks before it changes anything. The confirmationLevel setting in the agent section of askforge.json decides when: always (the default) asks before every Tier 3 (Modify) and Tier 4 (External) command, external asks only before Tier 4, and never does not ask. The prompt offers yes this once, yes always for this session, or no. --yes skips it for one run.
When there is no terminal to ask in, as in a CI job, a command that needs confirmation stops without writing anything and exits with 1. Pass --yes there.
ask-forge execute-tool checks the tool it resolves to, so a Tier 3 or Tier 4 target prompts, and the prompt is prefixed [execute_tool -> <target>] so you can see what you are approving. Trust levels do not apply to subcommands; they bound only the conversational agent.
When no --product is given, Ask Forge resolves the working context in this order:
-p) and --template (-t).--product-path, then SCHEMASMITH_PRODUCT_PATH: preloads a schema product at launch; the environment variable is used when the option isn't given.Product.json in the current directory or a directory above it.A command that needs a template, when none is selected, stops with No template selected and exits with 1.
These options apply to the REPL and to every subcommand, before or after the command name, so ask-forge --quiet list-tables and ask-forge list-tables --quiet behave identically:
| Option | What it does |
|---|---|
--product <path>, -p |
Path to the schema product directory |
--template <name>, -t |
Template name within the product |
--product-path <path> |
Path to a schema product to preload at launch (also SCHEMASMITH_PRODUCT_PATH) |
--config <path> |
Read and write settings at this path instead of ~/.schemasmith/askforge.json |
--verbose |
Raise the log level from warnings to debug detail |
--quiet |
Suppress the banner and informational output |
--no-color |
Disable ANSI colour so CI logs are not mangled |
--format text|json |
Output format for tool results; text is the default |
--config plays the same role for ask-forge that --ConfigFile plays for SchemaQuench, SchemaTongs, and DataTongs. Point it at a settings file committed alongside your schema package and a CI job reads that file instead of whatever happens to be in the build agent's home directory. LLM providers, connections and agent settings all follow the override:
ask-forge --config ./ci/askforge.json review-schema --product ./MyProduct
The first run under --config also writes a small record beside that file, under its name: --config ./ci/askforge.json writes ./ci/askforge.session-directory.json. Your settings file stays byte-for-byte unchanged, but a pipeline step that checks for a clean working tree will flag the new file. It is disposable, so add *.session-directory.json to that repository's ignore list.
--quiet removes launch chatter: the banner, the "Licensed to:" line, the context-loading notices, and the routine LLM status line. It is not a mute switch. These still print:
logHygiene block cannot be used whole, in askforge.json or a product's SchemaQuench.settings.json.--verbose and --quiet contradict each other. Passing both is reported as an error and exits with 1 rather than silently picking one.
list-tables, list-indexed-views, and list-materialized-views have their own --verbose flag, which means "include more detail in the result" and has nothing to do with logging. On those commands a trailing --verbose is the command's own flag, and the global one goes before the command name:
# include column counts; log level unchanged
ask-forge list-tables --verbose
# raise the log level
ask-forge --verbose list-tables
Everywhere else the position makes no difference.
--format json makes every tool subcommand emit the JSON envelope instead of the default text output. The per-command --json flag is an alias for it, and either one switches a command to JSON. Add --quiet as well, so that the "Licensed to:" line does not come ahead of the envelope on standard output:
ask-forge --quiet --format json list-tables --product ./my-product
A result that succeeds goes to standard output. data is present when the tool returns structured data:
{
"success": true,
"message": "The tool's result, as text",
"data": {}
}
A failure goes to standard error, and the command exits with 1:
{
"success": false,
"error": "What went wrong"
}
Put a question in quotes after ask-forge to ask it without starting the REPL. Ask Forge answers it and exits:
ask-forge "How do I make a column non-nullable?"
With no LLM provider set up, the answer is the built-in hints, and the exit code is 0. The global options apply here too.
The CLI returns:
| Code | Meaning |
|---|---|
0 |
Success: the command, the REPL session or the question completed |
1 |
The command did not succeed. A tool execution error is one cause; others include an unknown option, a missing required option, a file named with @ that is not there, --verbose with --quiet, a settings file that exists but cannot be read, and a confirmation that was declined or could not be asked |
2 |
License error: no license file found, a license expired beyond its grace period, or no active Ask Forge add-on |
Every run checks the license first, --help and --version included, so a license error comes before anything else.
In the REPL, a command that fails reports its error and the session goes on. Leaving with exit returns 0.
Free schema-as-code for SQL Server, PostgreSQL, MySQL, and MariaDB.
The source is on GitHub for anyone to read.
Get Started on GitHub