---
import DocsLayout from '../../layouts/DocsLayout.astro'
import { SITE } from '../../data/site'

const toc = [
  { id: 'start', label: 'start the agent' },
  { id: 'pick-a-provider', label: 'pick a provider' },
  { id: 'first-task', label: 'give it a task' },
  { id: 'review', label: 'review the changes' },
  { id: 'next-steps', label: 'next steps' },
]
---

<DocsLayout
  title="openclaude quickstart — first session in 5 minutes"
  description="Run your first openclaude session: start the agent in a repo, pick a model provider, give it a task, and review the diff. From install to working agent in minutes."
  heading="quickstart"
  lede="From a fresh install to a reviewed diff in about five minutes."
  toc={toc}
>
  <h2 id="start">1. start the agent</h2>
  <p>Run it inside any repository (or empty directory):</p>
  <pre><code>cd your-repo
openclaude</code></pre>
  <p>
    If you haven't <a href="/docs/installation/">installed it</a> yet:
    <code>{SITE.installCommand}</code>
  </p>

  <h2 id="pick-a-provider">2. pick a provider</h2>
  <p>
    Inside the session, type <code>/provider</code> for guided setup with saved profiles.
    It can wire up OpenAI, OpenRouter, Gemini, local Ollama, and a dozen other backends —
    see the <a href="/docs/providers/">provider guide</a> for the full list.
  </p>
  <p>Prefer environment variables? The fastest OpenAI-compatible setup:</p>
  <pre><code>export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_API_KEY=sk-your-key-here
export OPENAI_MODEL=gpt-4o

openclaude</code></pre>
  <p>For GitHub Models, run <code>/onboard-github</code> for interactive OAuth onboarding.</p>

  <h2 id="first-task">3. give it a task</h2>
  <p>Write a task the way you'd brief a teammate:</p>
  <pre><code>&gt; add retry with exponential backoff to the fetch client, then run the tests</code></pre>
  <p>
    The agent streams its plan, tool calls, and edits live: reading files, searching,
    editing, and running commands. Tool use is permission-gated — you approve the first
    use of anything sensitive, and can manage rules later with <code>/permissions</code>.
  </p>

  <h2 id="review">4. review the changes</h2>
  <ul>
    <li><code>/diff</code> — view uncommitted changes and per-turn diffs.</li>
    <li><code>/rewind</code> — restore code and/or conversation to a previous point.</li>
    <li><code>/cost</code> — see what the session cost so far.</li>
  </ul>
  <p>Nothing is committed unless you ask for it; every change stays reviewable.</p>

  <h2 id="next-steps">next steps</h2>
  <ul>
    <li>Browse the <a href="/docs/slash-commands/">slash command reference</a> — sessions, context, review, and more.</li>
    <li>Script it: <code>openclaude -p "explain this repo"</code> — see the <a href="/docs/cli-reference/">CLI reference</a>.</li>
    <li>Make it yours: <a href="/docs/configuration/">configuration</a> and <a href="/docs/keybindings/">keybindings</a>.</li>
  </ul>
</DocsLayout>
