> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up OpenCode

> Use OpenCode with project-local StackShift guidance and the CLI.

<Tip>
  **Live.** This area is documented as current, user-reliable behavior.
</Tip>

## Goal

Prepare an existing repository for StackShift with OpenCode.

## Prerequisites

* OpenCode installed with a configured model provider.
* The StackShift CLI release containing setup agent.

## Workflow

<Steps>
  <Step>
    Open a terminal in your project and run opencode. Use /connect if your model provider is not configured.
  </Step>

  <Step>
    Ask OpenCode to read [https://stackshift.cloud/prompt.md](https://stackshift.cloud/prompt.md) and prepare the repository for StackShift.
  </Step>

  <Step>
    Alternatively, run stackshift setup agent --client opencode from the repository root, then start a new OpenCode session.
  </Step>

  <Step>
    Use stackshift auth login for StackShift account access, then ask the agent to inspect the project before requesting deployment.
  </Step>
</Steps>

## Project-local setup (next CLI release)

This flow installs guidance for OpenCode and uses the StackShift CLI. It does not install OpenCode, configure its model provider, or configure MCP. Existing project instructions and other providers are preserved.

The skill includes repository setup, databases, Assets, S2, Mail, migration and recovery guidance. It grants no additional permissions. Restart OpenCode after installation for discovery.

OpenCode is supported by this local setup flow; it is not advertised as a qualified StackShift MCP client.

```bash theme={null}
stackshift setup agent --client opencode
opencode
```

## Official references

[OpenCode setup](https://opencode.ai/docs/)

[OpenCode skills](https://opencode.ai/docs/skills/)

## Expected result

<Check>
  StackShift guidance is installed in .opencode/skills/stackshift-cloud-operations. Installation alone does not deploy or create resources.
</Check>

## Common failures

<Warning>
  * An older CLI may not recognize opencode; install the release containing this client.
  * Modified local skill files are preserved. Review differences before replacing them.
</Warning>

## Related guides

<CardGroup cols={2}>
  <Card title="Connect your coding agent" href="/ai-features/agent-connections">
    Connect an external client, choose its access and inspect its work in StackShift.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.