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

# Upsun CLI

> Install and use the Upsun CLI to manage your projects directly from the terminal

export const CliVersion = ({fallback = '5.9.0'}) => {
  const [version, setVersion] = useState(fallback);
  const STORAGE_KEY = 'upsun_cli_version_cache';
  const CACHE_TTL = 1 * 60 * 60 * 1000;
  const API_URL = 'https://api.github.com/repos/upsun/cli/releases/latest';
  useEffect(() => {
    const cached = localStorage.getItem(STORAGE_KEY);
    if (cached) {
      try {
        const {version: v, timestamp} = JSON.parse(cached);
        if (Date.now() - timestamp < CACHE_TTL) {
          setVersion(v);
          return;
        }
      } catch (e) {}
    }
    fetch(API_URL).then(res => res.json()).then(data => {
      const v = data.tag_name || null;
      if (v) {
        localStorage.setItem(STORAGE_KEY, JSON.stringify({
          version: v,
          timestamp: Date.now()
        }));
        setVersion(v);
      }
    }).catch(() => {});
  }, []);
  return <span>v{version}</span>;
};

<div className="w-full">
  <div className="max-w-7xl mx-auto px-6 pt-16">
    <div className="relative overflow-hidden rounded-3xl bg-white dark:bg-[#0E1113] border-theme p-10 lg:p-16 mb-20">
      <div className="absolute inset-0 opacity-[0.03]" style={{backgroundImage: 'linear-gradient(rgba(0,0,0,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.1) 1px, transparent 1px)', backgroundSize: '32px 32px'}} />

      <div className="relative grid grid-cols-1 lg:grid-cols-5 gap-12 items-center">
        <div className="lg:col-span-2">
          <div className="inline-flex items-center gap-2 bg-accent-badge border border-accent-soft px-3 py-1.5 rounded-lg text-accent text-xs font-mono uppercase tracking-wider mb-6">
            <span className="w-2 h-2 rounded-full bg-accent animate-pulse" />

            <CliVersion />
          </div>

          <h1 className="text-4xl lg:text-5xl font-semibold text-gray-900 dark:text-white mb-4 leading-tight tracking-tight">
            Upsun CLI
          </h1>

          <p className="text-lg text-muted leading-relaxed mb-8">
            The full power of Upsun in your terminal. Manage projects, push code, SSH into environments, and automate workflows.
          </p>

          <div className="flex flex-wrap gap-3">
            <a href="/cli/install" className="inline-flex items-center gap-2 px-5 py-2.5 btn-primary font-semibold text-sm rounded-full transition-colors">
              Install

              <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 14l-7 7m0 0l-7-7m7 7V3" />
              </svg>
            </a>

            <a href="/cli/reference" className="inline-flex items-center gap-2 px-5 py-2.5 btn-secondary font-semibold text-sm rounded-full transition-colors">
              Command Reference
            </a>
          </div>
        </div>

        <div className="lg:col-span-3">
          <div className="bg-surface-dark rounded-2xl p-8">
            <div className="flex items-center gap-3 mb-6">
              <div className="flex gap-2">
                <div className="w-3 h-3 rounded-full bg-red-500" />

                <div className="w-3 h-3 rounded-full bg-yellow-500" />

                <div className="w-3 h-3 rounded-full bg-green-500" />
              </div>

              <span className="text-gray-500 text-sm font-mono">\~/my-project</span>
            </div>

            <div className="bg-code-block rounded-xl p-6 font-mono text-sm">
              <div className="mb-4">
                <span className="text-green-400">\$</span><span className="text-white ml-2">upsun</span>
                <div className="text-gray-400 mt-1">Welcome to Upsun!</div>
              </div>

              <div className="mb-4">
                <span className="text-green-400">\$</span><span className="text-white ml-2">upsun push</span>

                <div className="text-gray-400 text-xs mt-1">
                  Pushing HEAD to branch feature-login...<br />
                  Building application 'myapp'...<br />
                  <span className="text-green-400">✓ Environment deployed:</span> [https://feature-login-abc123.upsun.app](https://feature-login-abc123.upsun.app)
                </div>
              </div>

              <div>
                <span className="text-green-400">\$</span><span className="text-white ml-2">upsun ssh</span>

                <div className="text-gray-400 text-xs mt-1">
                  Connected to myapp\@feature-login (us-5)<br />
                  <span className="text-white">app\@feature-login:\~\$</span> \_
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <h2 className="text-2xl font-semibold text-gray-900 dark:text-white mb-2 tracking-subheading">CLI Documentation</h2>
    <p className="text-sm text-muted mb-6">Learn how to install, configure, and use the Upsun CLI.</p>

    <CardGroup cols={3}>
      <Card title="Install" href="/cli/install" icon="download" horizontal>
        Install and authenticate the CLI
      </Card>

      <Card title="Use" href="/cli/use" icon="square-terminal" horizontal>
        Run commands and customize the CLI
      </Card>

      <Card title="API Tokens" href="/cli/api-tokens" icon="key" horizontal>
        Authenticate for CI/CD and automation
      </Card>

      <Card title="Init" href="/cli/init" icon="rocket" horizontal>
        Set up a project from a repository
      </Card>

      <Card title="Reference" href="/cli/reference" icon="terminal" horizontal>
        All CLI commands and options
      </Card>

      <Card title="AI Agents" href="/cli/ai-coding-agents" icon="sparkles" horizontal>
        Manage projects with AI coding agents
      </Card>
    </CardGroup>

    <div className="mb-16" />

    <div className="pb-20 scroll-mt-24">
      <div className="flex items-center gap-3 mb-8">
        <div className="flex items-center justify-center w-10 h-10 rounded-xl bg-accent-subtle border border-accent-subtle">
          <span className="text-accent font-semibold font-mono text-lg">1</span>
        </div>

        <div>
          <h2 className="text-2xl font-semibold text-gray-900 dark:text-white tracking-subheading">Install</h2>
          <p className="text-sm text-subtle">Choose your platform</p>
        </div>
      </div>

      <CodeGroup>
        ```bash macOS (Homebrew) theme={null}
          brew install upsun/tap/upsun-cli
        ```

        ```bash Linux theme={null}
          curl -fsSL https://raw.githubusercontent.com/upsun/cli/main/installer.sh | bash
        ```

        ```bash Windows (Scoop) theme={null}
          scoop bucket add upsun https://github.com/upsun/homebrew-tap.git
          scoop install upsun
        ```
      </CodeGroup>

      <p className="text-xs text-subtle mt-2">Windows (Scoop) requires the <a href="https://github.com/ScoopInstaller/Extras" className="link-accent">Extras bucket</a></p>
    </div>

    <div className="pb-20">
      <div className="flex items-center gap-3 mb-8">
        <div className="flex items-center justify-center w-10 h-10 rounded-xl bg-accent-subtle border border-accent-subtle">
          <span className="text-accent font-semibold font-mono text-lg">2</span>
        </div>

        <div>
          <h2 className="text-2xl font-semibold text-gray-900 dark:text-white tracking-subheading">Authenticate</h2>
          <p className="text-sm text-subtle">Log in via your browser</p>
        </div>
      </div>

      <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
        <div className="rounded-xl border-theme bg-gray-50 dark:bg-[#191C1E] overflow-hidden">
          <div className="flex items-center gap-2 px-4 py-2.5 border-b border-gray-200 dark:border-[#BFB5FF]/20">
            <div className="flex gap-1.5">
              <div className="w-2.5 h-2.5 rounded-full bg-red-500/80" />

              <div className="w-2.5 h-2.5 rounded-full bg-yellow-500/80" />

              <div className="w-2.5 h-2.5 rounded-full bg-green-500/80" />
            </div>
          </div>

          <pre className="p-5 font-mono text-sm m-0 bg-transparent overflow-x-auto">
            <code>
              {"$ upsun\nOpening a browser to log in...\n✓ Login successful.\n✓ SSH certificates created.\n\nYour projects:\n  [0] My project (xb3pfo734qxbeg)\n  [1] Another project (3p5fmol45kxp6)"}
            </code>
          </pre>
        </div>

        <div className="flex flex-col justify-center space-y-4">
          <p className="text-muted">
            Running <code className="bg-gray-100 dark:bg-[#2B3134] px-1.5 py-0.5 rounded text-sm font-mono">upsun</code> opens a browser login flow and generates SSH certificates for secure access.
          </p>

          <p className="text-muted">
            Use <code className="bg-gray-100 dark:bg-[#2B3134] px-1.5 py-0.5 rounded text-sm font-mono">upsun login</code> to force a re-authentication.
          </p>

          <p className="text-muted text-sm">
            For CI/CD pipelines and automation, use <a href="/cli/api-tokens" className="link-accent">API tokens</a> instead.
          </p>
        </div>
      </div>
    </div>

    <div className="pb-20">
      <div className="flex items-center gap-3 mb-8">
        <div className="flex items-center justify-center w-10 h-10 rounded-xl bg-accent-subtle border border-accent-subtle">
          <span className="text-accent font-semibold font-mono text-lg">3</span>
        </div>

        <div>
          <h2 className="text-2xl font-semibold text-gray-900 dark:text-white tracking-subheading">Use</h2>
          <p className="text-sm text-subtle">Common commands</p>
        </div>
      </div>

      <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-x-8 gap-y-0 [&_pre]:!mb-0 [&_.code-block]:!mb-0 [&>div]:!mb-0">
        <CodeBlock filename="List commands" language="bash">
          {`upsun list`}
        </CodeBlock>

        <CodeBlock filename="Get help" language="bash">
          {`upsun help get`}
        </CodeBlock>

        <CodeBlock filename="Push code" language="bash">
          {`upsun push`}
        </CodeBlock>

        <CodeBlock filename="SSH into environment" language="bash">
          {`upsun ssh`}
        </CodeBlock>

        <CodeBlock filename="Run remote command" language="bash">
          {`upsun ssh -- python my-script.py`}
        </CodeBlock>

        <CodeBlock filename="Clone a project" language="bash">
          {`upsun get PROJECT_ID`}
        </CodeBlock>

        <CodeBlock filename="Environment details" language="bash">
          {`upsun environment:info`}
        </CodeBlock>

        <CodeBlock filename="Merge environments" language="bash">
          {`upsun merge`}
        </CodeBlock>

        <CodeBlock filename="Open SSH tunnel" language="bash">
          {`upsun tunnel:open`}
        </CodeBlock>
      </div>
    </div>

    <div className="pb-20">
      <div className="flex items-center gap-3 mb-3">
        <div className="flex-shrink-0 w-10 h-10 rounded-xl bg-accent-subtle border border-accent-subtle flex items-center justify-center">
          <svg className="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 00-2.455 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z" />
          </svg>
        </div>

        <h2 className="text-2xl font-semibold text-gray-900 dark:text-white tracking-subheading">AI Coding Agents</h2>
      </div>

      <p className="text-sm text-muted mb-8 ml-[52px]">Teach your AI coding agent to manage Upsun projects using the CLI.</p>

      <div className="grid grid-cols-1 lg:grid-cols-5 gap-8">
        <div className="lg:col-span-3">
          <div className="rounded-xl bg-white dark:bg-[#191C1E] p-6">
            <h3 className="font-semibold text-gray-900 dark:text-white mb-2">Upsun Skills</h3>

            <p className="text-sm text-muted mb-5 leading-relaxed">
              <a href="https://github.com/upsun/skills" className="link-accent">Upsun Skills</a> is an open-source skill that gives AI coding agents like <a href="https://claude.ai/download" className="link-accent">Claude Code</a> full access to 130+ Upsun CLI commands across 30 namespaces — deployments, environments, backups, databases, scaling, and more.
            </p>

            <p className="text-xs font-semibold text-gray-900 dark:text-white uppercase tracking-wider mb-3">Install as a Claude Code plugin</p>

            <CodeBlock language="bash">
              {`claude plugin add upsun/skills`}
            </CodeBlock>

            <p className="text-xs font-semibold text-gray-900 dark:text-white uppercase tracking-wider mb-3 mt-5">Or add manually to your project</p>

            <CodeBlock language="bash">
              {`git clone https://github.com/upsun/skills.git ~/.claude/skills/upsun-skills`}
            </CodeBlock>
          </div>
        </div>

        <div className="lg:col-span-2 flex flex-col gap-3">
          <p className="text-xs font-semibold text-muted uppercase tracking-wider mb-0">What your agent can do</p>

          <div className="flex items-start gap-3 p-3 rounded-lg bg-white dark:bg-[#191C1E]">
            <svg className="w-4 h-4 text-accent mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
            </svg>

            <div>
              <p className="text-sm font-medium text-muted">Deploy & manage environments</p>
              <p className="text-xs text-muted">Push, branch, merge, and sync with production safety patterns</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-3 rounded-lg bg-white dark:bg-[#191C1E]">
            <svg className="w-4 h-4 text-accent mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
            </svg>

            <div>
              <p className="text-sm font-medium text-muted">Backup & restore</p>
              <p className="text-xs text-muted">Create backups, verify integrity, and restore with confirmation checks</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-3 rounded-lg bg-white dark:bg-[#191C1E]">
            <svg className="w-4 h-4 text-accent mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
            </svg>

            <div>
              <p className="text-sm font-medium text-muted">Database operations</p>
              <p className="text-xs text-muted">Manage PostgreSQL, MongoDB, Redis, and Valkey services</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-3 rounded-lg bg-white dark:bg-[#191C1E]">
            <svg className="w-4 h-4 text-accent mt-0.5 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
            </svg>

            <div>
              <p className="text-sm font-medium text-muted">Scale & configure</p>
              <p className="text-xs text-muted">Adjust resources, manage domains, and configure autoscaling</p>
            </div>
          </div>

          <a href="https://github.com/upsun/skills" className="inline-flex items-center gap-2 mt-1 text-sm link-accent w-fit">
            View on GitHub

            <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
            </svg>
          </a>
        </div>
      </div>
    </div>

    <div className="pb-20">
      <div className="rounded-2xl bg-[#F0F1F2] dark:bg-[#191C1E] p-8">
        <h2 className="text-2xl font-semibold text-gray-900 dark:text-white mb-2 tracking-subheading">Features</h2>
        <p className="text-sm text-muted mb-6">Everything you need to manage projects, environments, and deployments from the terminal.</p>

        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">Auto-detection</h3>
              <p className="text-xs text-muted leading-relaxed">Detects project and environment from your local checkout. Override with <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">--project</code> and <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">--environment</code>.</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">More than Git</h3>
              <p className="text-xs text-muted leading-relaxed">Commands like <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">upsun push</code> add options like <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">--activate</code> and <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">--no-wait</code>.</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />

                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">Customizable</h3>
              <p className="text-xs text-muted leading-relaxed">Configure via <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">\~/.upsun-cli/config.yaml</code>. See <a href="https://github.com/platformsh/legacy-cli#user-content-customization" className="link-accent">GitHub</a>.</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">Automation-ready</h3>
              <p className="text-xs text-muted leading-relaxed">Set <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">UPSUN\_CLI\_NO\_INTERACTION=1</code> to bypass prompts in CI/CD.</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M13 10V3L4 14h7v7l9-11h-7z" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">Autocompletion</h3>
              <p className="text-xs text-muted leading-relaxed">Enable tab completion with <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">{"eval $(upsun completion)"}</code> or via <a href="https://docs.brew.sh/Shell-Completion" className="link-accent">Homebrew</a>.</p>
            </div>
          </div>

          <div className="flex items-start gap-3 p-4 rounded-xl bg-transparent border-theme">
            <div className="flex-shrink-0 w-9 h-9 rounded-lg bg-accent-subtle flex items-center justify-center">
              <svg className="w-4.5 h-4.5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
              </svg>
            </div>

            <div>
              <h3 className="font-semibold text-gray-900 dark:text-white text-sm mb-1">SSH built-in</h3>
              <p className="text-xs text-muted leading-relaxed">Creates SSH certificates automatically on login. Access environments with <code className="text-xs bg-gray-100 dark:bg-[#2B3134] px-1 py-0.5 rounded">upsun ssh</code>.</p>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div className="pb-20">
      <h2 className="text-2xl font-semibold text-gray-900 dark:text-white mb-2 tracking-subheading">Maintenance</h2>
      <p className="text-sm text-muted mb-8">Keep your CLI up to date and resolve common issues.</p>

      <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
        <div className="rounded-xl border-theme bg-white dark:bg-[#191C1E] p-6">
          <h3 className="font-semibold text-gray-900 dark:text-white mb-4">Update</h3>

          <div className="space-y-3">
            <CodeBlock filename="Homebrew" language="bash">
              {`brew upgrade upsun-cli`}
            </CodeBlock>

            <CodeBlock filename="Scoop" language="bash">
              {`scoop update upsun`}
            </CodeBlock>
          </div>
        </div>

        <div className="rounded-xl border-theme bg-white dark:bg-[#191C1E] p-6">
          <h3 className="font-semibold text-gray-900 dark:text-white mb-4">Troubleshooting</h3>

          <div className="bg-amber-50 dark:bg-amber-950/30 border border-amber-200 dark:border-amber-800/50 rounded-lg p-4 mb-4">
            <p className="text-sm text-amber-800 dark:text-amber-300 font-semibold mb-1">RootNotFoundException</p>
            <p className="text-sm text-amber-700 dark:text-amber-400">If you cloned via Git directly, run:</p>

            <div className="mt-2">
              <CodeBlock language="bash">
                {`upsun project:set-remote --project PROJECT_ID`}
              </CodeBlock>
            </div>
          </div>

          <p className="text-sm text-muted">
            <span className="font-semibold text-gray-900 dark:text-white">Upgrading from legacy CLI?</span> Follow the <a href="/cli/install" className="link-accent">installation steps</a> — the new CLI guides you through removal.
          </p>
        </div>
      </div>
    </div>

    <div className="rounded-2xl overflow-hidden p-14 text-center mb-8 bg-accent">
      <h2 className="text-3xl font-semibold text-white mb-3 tracking-subheading">Ready to get started?</h2>

      <p className="text-white/70 mb-8 max-w-md mx-auto">
        Install the CLI and start managing your projects from the terminal.
      </p>

      <div className="flex gap-3 justify-center flex-wrap">
        <a href="/cli/install" className="inline-flex items-center px-7 py-3.5 bg-white text-accent-deep font-semibold rounded-full hover:bg-[#DFDAFF] transition-colors text-sm">
          Install the CLI
        </a>

        <a href="/cli/reference" className="inline-flex items-center px-7 py-3.5 bg-transparent text-white font-medium rounded-full border-2 border-white hover:bg-white hover:text-[#6046ff] transition-all text-sm">
          View Reference
        </a>
      </div>
    </div>
  </div>
</div>
