Skip to main content
Geni registers a suite of Artisan commands under the geni:* namespace. Use these commands to export OpenAPI specifications to disk, detect drift between your codebase and a committed spec, diagnose unresolved type inferences, generate and serve Model Context Protocol (MCP) manifests, and manage the generated spec cache. All commands run without a database connection or application boot — Geni works entirely from static analysis.

geni:export

Export your OpenAPI 3.1.0 specification to a file on disk. Run this command after making changes to routes or controllers to refresh a committed spec artifact.
string
Relative or absolute path where the JSON specification file will be written. Defaults to openapi.json in the project root.
string
Name of a specific API version configured under apis in config/geni.php. When omitted, Geni exports the default root API.

geni:check

Compare the OpenAPI specification generated from your current codebase against a committed spec file and exit with a non-zero status code if drift is detected. Add this command to your CI pipeline to catch undocumented breaking changes before they reach production.
string
Path to the committed OpenAPI JSON file to compare against. Defaults to openapi.json in the project root.
string
Name of a specific API version to check. When omitted, Geni checks the default root API.

Return Codes

In CI, treat a 1 exit code as a build failure. This enforces that developers run geni:export and commit the updated spec whenever they change routes or request/response shapes.

geni:analyze

Inspect all unresolved inference diagnostics across your application. Use this command when geni:export produces incomplete schemas — it surfaces the exact file, line number, and reason Geni could not resolve a type.
boolean
Output diagnostics as a JSON array instead of a formatted terminal table. Useful for piping results into other tools or scripts.
string
Analyze a specific named API version. When omitted, Geni analyzes the default root API.

Diagnostic Output Example

By default, geni:analyze renders a table showing every location where inference was incomplete:
Each row points you directly to the source location you need to fix — either by simplifying the expression so Geni can parse it statically, or by adding a schema_overrides entry in config/geni.php.

geni:mcp

Generate a Model Context Protocol (MCP) tool manifest or a ready-to-paste client configuration snippet. Use this command to wire Geni-generated tools into AI desktop clients like Claude.
string
Destination file path for the generated output. When omitted, Geni prints the manifest directly to standard output.
string
Output format. Choose one of:
  • json — Standard MCP tool manifest listing all discoverable API tools.
  • claude-desktop — A mcpServers JSON block ready to paste into claude_desktop_config.json.
Defaults to json.
string
Base URL used for HTTP tool execution. Defaults to config('app.url').
string
Target a specific named API version configured under apis in config/geni.php.

geni:mcp:serve

Start a live MCP stdio server that responds to JSON-RPC protocol requests from AI desktop clients. The server translates incoming tool calls into HTTP requests dispatched against your application and streams results back over stdio.
string
Target a specific named API version. When omitted, serves the default root API.
string
Base URL for dispatched HTTP tool execution requests. Defaults to the value of config('app.url').
integer
Maximum number of seconds to wait for each HTTP tool execution request. Defaults to 15.
geni:mcp:serve is designed to be launched by an MCP-compatible desktop client (such as Claude Desktop) as a subprocess. You typically do not run it interactively. Configure it as the command entry in your mcpServers block — use geni:mcp --format=claude-desktop to generate that block automatically.

geni:cache

Pre-compute the OpenAPI specification and store it in your configured Laravel cache store. Once cached, subsequent requests to /docs/api.json are served directly from cache with zero inference overhead.
string
Cache the specification for a specific named API version. When omitted, caches the default root API.
Run geni:cache as part of your deployment pipeline (after php artisan config:cache) so that the first request to your docs endpoint is never slow.

geni:clear

Clear the cached OpenAPI specification from your Laravel cache store. Run this command after deploying changes to force the cache to be rebuilt on the next request, or explicitly with geni:cache.
string
Clear the cached specification for a specific named API version. When omitted, clears the default root API cache.