Command-line interface

dbForge Studio for SQL Server provides a command-line interface (CLI) that enables you to automate and schedule documentation generation tasks without using the graphical user interface.

What you can do with the command-line interface

  • Automate documentation generation from the command line.
  • Automate documentation generation using a template file.
  • Schedule documentation generation.

Availability

The command-line interface is available in the Professional and Enterprise editions of dbForge Studio for SQL Server.

Access to the command-line interface

To run dbForge Studio CLI commands, open Command Prompt and navigate to the folder that contains dbforgesql.com. The default path to this executable depends on where dbForge Studio for SQL Server is installed. If you installed dbForge Studio:

  • As a standalone tool
cd C:\Program Files\Devart\dbForge Studio for SQL Server
  • As part of the dbForge Edge bundle
cd C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server

Command-line syntax

The /document command initiates documentation generation from the command line.

dbforgesql.com /document [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]

Command-line switches

The following command enables you to view the switches available for /document.

dbforgesql.com /document /?

For the complete list of switches, see Command-line switches.

Example

You can specify the required arguments directly in the command line.

dbforgesql.com /document /connection:"Data Source=<server_name>;Integrated Security=False;User ID=<user_name>" /database:<database_name> /output:<folder_path>

where:

  • /database:<database_name> – The database name for which the documentation project is generated.
  • /output:<folder_path> – The full path to the folder that will store the generated HTML or Markdown documentation.

Note

For PDF documentation, the /output parameter must specify a full file path, for example, /output:"D:\Docs\MyDatabase.pdf". This differs from HTML or Markdown generation, where the /output parameter specifies a folder path.

Alternatively, you can define documentation generation settings in a template file (.ddoc), which the command references when running the script.

dbforgesql.com /document /projfile:"D:\DocumentationTemplateFile.ddoc"

where:

  • /projfile:"D:\DocumentationTemplateFile.ddoc" – The full path to a template file (.ddoc).

For detailed automation scenarios, see:

  • Automate documentation generation from the command line
  • Schedule documentation generation

Command-line exit codes

The /document command returns exit codes that indicate the operation status.

For the complete list of exit codes, see Command-line exit codes.

Command-line wizard

dbForge Studio provides a built-in command-line wizard that helps you generate reusable command-line commands based on actions configured in the graphical user interface.

Instead of writing command-line syntax manually, you can configure documentation generation settings in the command-line wizard. The wizard then generates the corresponding command-line syntax, which you can review, edit, and save as a .bat file for reuse or scheduling.

Command-line wizard for documentation generation