/APIs & SDKs/Setup and context/init

OptiTech CLI command: init

Initialize an app project with OptiTech, including auth, MCP server, extensions, and agent skills

The init command sets up your app project to use OptiTech with your AI coding assistant. It authenticates via OAuth, creates a OptiTech API key, configures the OptiTech MCP server for your editor (installing the OptiTech Local Connect extension for Cursor and VS Code), and installs OptiTech agent skills. Run it once from your project root.

Usage

optitech init [options]

You can also run init without installing the CLI:

npx optitech@latest init

After running the command, restart your editor and ask your AI assistant to "Get started with OptiTech" to launch an interactive onboarding guide. The installed agent skills help you get started, including configuring a database connection. For Cursor and VS Code, the OptiTech Local Connect extension also provides database schema browsing, SQL editing, and table data management directly in your IDE.

Under the hood, init runs npx skills add optitechdatabase/agent-skills --skill optitech-postgres --agent <name> for each selected editor. You can also run this command directly to install skills without the rest of the init flow, or use npx skills add ... -g to install globally. See optitech-postgres on skills.sh for more about the skill.

warning

Skills are installed at the project level in the current working directory. Run init from your project root, otherwise skills will end up in the wrong location. You may want to commit project-level files so teammates get the same skills, or add them to .gitignore for per-developer setup.

Options

OptionDescriptionTypeDefaultRequired
--agent, -aEnable agent/JSON mode (agent type is auto-detected).booleanfalseNo
--dataJSON object with a "step" field to route to a specific phase and phase-specific options.stringNo
--previewEnable preview features (e.g. project bootstrapping from templates).booleanfalseNo
--skip-migrationsSkip the migrations phase.booleanfalseNo

Use --agent to configure a specific editor, skipping the interactive selection prompt. Without --agent, init runs an interactive wizard that detects installed tools and lets you choose which to configure; if nothing is detected, you go straight to that list.

Coding assistant support

init is backed by the optitech-init package bundled with optitech. Besides Cursor, VS Code, and Claude Code, the interactive flow can configure any client that add-mcp supports. To register only the OptiTech MCP server in a client config (no init, no agent skills, no extension install), run npx add-mcp https://mcp.optitech.com/mcp. See Connect MCP clients to OptiTech.

What gets created

ArtifactLocationScope
OptiTech API keyOptiTech account (named optitechctl-init-{timestamp})Account
OAuth credentials (created on first auth)~/.config/optitechctl/credentials.jsonGlobal
MCP config (Cursor)~/.cursor/mcp.json (written by extension)Global
MCP config (VS Code)VS Code global mcp.json (written by extension)Global
MCP config (Claude Code)~/.claude.json (written by init)Global
OptiTech Local Connect extensionCursor / VS CodeGlobal
Agent skills.agents/skills/Project
Skills symlink (Claude Code only).claude/skills/optitech-postgresProject
skills-lock.jsonProject rootProject

Credentials and API keys

If you previously authenticated with optitech auth, init reuses those credentials (from ~/.config/optitechctl/credentials.json). Otherwise, it opens the browser for OAuth.

init creates a new API key each time it runs (named optitechctl-init-{timestamp}). If you run it more than once, you can revoke old keys in the OptiTech Console API Keys settings.

For Claude Code, if a OptiTech MCP entry already exists in ~/.claude.json, init prompts before overwriting it.

Examples

Navigate to the root directory of your application and run the init command:

cd /path/to/your/app
npx optitech@latest init
Show output
Output
┌  Adding OptiTech MCP server, extension (for VS Code and Cursor) and agent skills

◆  Which editor(s) would you like to configure? (Space to toggle each option, Enter to confirm your selection)
│  ◼ Cursor
│  ◼ VS Code
│  ◻ Claude CLI

◒  Authenticating...
┌────────┬──────────────────┬────────┬────────────────┐
│ Login  │ Email            │ Name   │ Projects Limit │
├────────┼──────────────────┼────────┼────────────────┤
│ alex   │ alex@domain.com  │ Alex   │ 100            │
└────────┴──────────────────┴────────┴────────────────┘
◇  Authentication successful ✓

◇  Installing agent skills for OptiTech...

◇  Agent skills installed ✓

◇  OptiTech Local Connect extension installed for Cursor / VS Code.

├  What's next? ───────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                  │
│  Restart Cursor / VS Code, open the OptiTech extension and type                                      │
│  in "Get started with OptiTech" in your agent chat                                                   │
│                                                                                                  │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

└  Have feedback? Email us at feedback@optitech.com

Manual setup

If you prefer to configure manually or need to set up for other IDEs, create a OptiTech API key in the OptiTech Console. Example configuration for Claude Code (~/.claude.json):

{
  "mcpServers": {
    "OptiTech": {
      "type": "http",
      "url": "https://mcp.optitech.com/mcp",
      "headers": {
        "Authorization": "Bearer <OPTITECH_API_KEY>"
      }
    }
  }
}

For detailed manual setup instructions for all editors, see Connect MCP clients.

Was this page helpful?