Skip to main content

start

Launch OpenCode with Era-managed settings.

Usage

era-code start [options]

Options

OptionDescription
-m, --model <model>Model to use
-a, --agent <agent>Agent to use (overrides default_agent setting)
-q, --quietSuppress output

Examples

Launch with defaults

era-code start

Use a specific model

era-code start --model claude-sonnet-4-20250514

Use a specific agent

era-code start --agent orchestration

What It Does

  1. Checks initialization - If Era is not initialized, offers to run era-code init first
  2. Syncs configuration - Updates opencode.jsonc with latest settings (including default_agent)
  3. Builds directives - Compiles your directive files into DIRECTIVES.md
  4. Loads credentials - Injects MCP server credentials into the environment
  5. Launches OpenCode - Spawns OpenCode with Era configuration applied

Auto-Initialization

If you run era-code start in a project that hasn't been initialized, you'll be prompted:

Era is not initialized in this project.

Would you like to initialize Era now? (Y/n)

Selecting yes runs the full interactive era-code init flow, then automatically continues to launch OpenCode. In quiet mode (--quiet), this prompt is skipped and an error is thrown instead.

Available Agents

Primary Agents

These can be set as the default agent via era-code config:

AgentPurpose
planStrategic planning, creates docs/plans (default)
orchestrationMain coding agent for implementation

Subagents

These are invoked automatically via the Task tool:

AgentPurpose
exploreFast codebase exploration
researcherDocumentation and web research
debuggerSystematic debugging and root cause analysis
docs-generatorGenerate /docs folder
readme-generatorGenerate README.md

Changing the Default Agent

Use the config command to change which agent starts by default:

# Set orchestration as default
era-code config --set settings.default_agent=orchestration

# Set plan as default (this is the default)
era-code config --set settings.default_agent=plan

The change applies on next era-code start.

Environment

The start command sets:

  • ERA_CODE_MANAGED=1 - Indicates Era is managing the session
  • MCP credentials from ~/.config/era-code/credentials.json