Lander.astro 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. ---
  2. import { Image } from 'astro:assets';
  3. import config from "virtual:starlight/user-config";
  4. import type { Props } from '@astrojs/starlight/props';
  5. import CopyIcon from "../assets/lander/copy.svg";
  6. import CheckIcon from "../assets/lander/check.svg";
  7. import TuiScreenshot from "../assets/lander/screenshot-splash.png";
  8. import VscodeScreenshot from "../assets/lander/screenshot-vscode.png";
  9. import GithubScreenshot from "../assets/lander/screenshot-github.png";
  10. const { data } = Astro.locals.starlightRoute.entry;
  11. const { title = data.title, tagline, image, actions = [] } = data.hero || {};
  12. const imageAttrs = {
  13. loading: 'eager' as const,
  14. decoding: 'async' as const,
  15. width: 400,
  16. alt: image?.alt || '',
  17. };
  18. const github = config.social.filter(s => s.icon === 'github')[0];
  19. const discord = config.social.filter(s => s.icon === 'discord')[0];
  20. const command = "curl -fsSL"
  21. const protocol = "https://"
  22. const url = "opencode.ai/install"
  23. const bash = "| bash"
  24. let darkImage: ImageMetadata | undefined;
  25. let lightImage: ImageMetadata | undefined;
  26. let rawHtml: string | undefined;
  27. if (image) {
  28. if ('file' in image) {
  29. darkImage = image.file;
  30. } else if ('dark' in image) {
  31. darkImage = image.dark;
  32. lightImage = image.light;
  33. } else {
  34. rawHtml = image.html;
  35. }
  36. }
  37. ---
  38. <div class="hero">
  39. <section class="top">
  40. <div class="logo">
  41. <Image
  42. src={darkImage}
  43. {...imageAttrs}
  44. class:list={{ 'light:sl-hidden': Boolean(lightImage) }}
  45. />
  46. <Image src={lightImage} {...imageAttrs} class="dark:sl-hidden" />
  47. </div>
  48. <h1>The AI coding agent built for the terminal.</h1>
  49. </section>
  50. <section class="cta">
  51. <div class="col1">
  52. <a href="/docs">Get Started</a>
  53. </div>
  54. <div class="col2">
  55. <button class="command" data-command={`${command} ${protocol}${url} ${bash}`}>
  56. <code>
  57. <span>{command}&nbsp;</span><span class="protocol">{protocol}</span><span class="highlight">{url}</span>&nbsp;{bash}
  58. </code>
  59. <span class="copy">
  60. <CopyIcon />
  61. <CheckIcon />
  62. </span>
  63. </button>
  64. </div>
  65. </section>
  66. <section class="content">
  67. <ul>
  68. <li><b>Native TUI</b>: A responsive, native, themeable terminal UI.</li>
  69. <li><b>LSP enabled</b>: Automatically loads the right LSPs for the LLM.</li>
  70. <li><b>Multi-session</b>: Start multiple agents in parallel on the same project.</li>
  71. <li><b>Shareable links</b>: Share a link to any sessions for reference or to debug.</li>
  72. <li><b>Claude Pro</b>: Log in with Anthropic to use your Claude Pro or Max account.</li>
  73. <li><b>Use any model</b>: Supports 75+ LLM providers through <a href="https://models.dev">Models.dev</a>, including local models.</li>
  74. </ul>
  75. </section>
  76. <section class="alternatives">
  77. <div class="col1">
  78. <h3>npm</h3>
  79. <button class="command" data-command="npm install -g opencode-ai">
  80. <code>
  81. <span>npm install -g</span> <span class="highlight">opencode-ai</span>
  82. </code>
  83. <span class="copy">
  84. <CopyIcon />
  85. <CheckIcon />
  86. </span>
  87. </button>
  88. </div>
  89. <div class="col2">
  90. <h3>Bun</h3>
  91. <button class="command" data-command="bun install -g opencode-ai">
  92. <code>
  93. <span>bun install -g</span> <span class="highlight">opencode-ai</span>
  94. </code>
  95. <span class="copy">
  96. <CopyIcon />
  97. <CheckIcon />
  98. </span>
  99. </button>
  100. </div>
  101. <div class="col3">
  102. <h3>Homebrew</h3>
  103. <button class="command" data-command="brew install opencode">
  104. <code>
  105. <span>brew install</span> <span class="highlight">opencode</span>
  106. </code>
  107. <span class="copy">
  108. <CopyIcon />
  109. <CheckIcon />
  110. </span>
  111. </button>
  112. </div>
  113. <div class="col4">
  114. <h3>Paru</h3>
  115. <button class="command" data-command="paru -S opencode-bin">
  116. <code>
  117. <span>paru -S</span> <span class="highlight">opencode-bin</span>
  118. </code>
  119. <span class="copy">
  120. <CopyIcon />
  121. <CheckIcon />
  122. </span>
  123. </button>
  124. </div>
  125. <div class="col4">
  126. <h3>Mise</h3>
  127. <button class="command" data-command="mise use -g ubi:sst/opencode">
  128. <code>
  129. <span>mise use -g</span> <span class="highlight">ubi:sst/opencode</span>
  130. </code>
  131. <span class="copy">
  132. <CopyIcon />
  133. <CheckIcon />
  134. </span>
  135. </button>
  136. </div>
  137. </section>
  138. <section class="images">
  139. <div class="left">
  140. <figure>
  141. <figcaption>opencode TUI with the tokyonight theme</figcaption>
  142. <a href="/docs/cli">
  143. <Image src={TuiScreenshot} alt="opencode TUI with the tokyonight theme" />
  144. </a>
  145. </figure>
  146. </div>
  147. <div class="right">
  148. <div class="row1">
  149. <figure>
  150. <figcaption>opencode in VS Code</figcaption>
  151. <a href="/docs/ide">
  152. <Image src={VscodeScreenshot} alt="opencode in VS Code" />
  153. </a>
  154. </figure>
  155. </div>
  156. <div class="row2">
  157. <figure>
  158. <figcaption>opencode in GitHub</figcaption>
  159. <a href="/docs/github">
  160. <Image src={GithubScreenshot} alt="opencode in GitHub" />
  161. </a>
  162. </figure>
  163. </div>
  164. </div>
  165. </section>
  166. <section class="footer">
  167. <div class="col1">
  168. <a href={github.href} target="_blank" rel="noopener noreferrer">GitHub</a>
  169. </div>
  170. <div class="col2">
  171. <a href={discord.href} target="_blank" rel="noopener noreferrer">Discord</a>
  172. </div>
  173. <div class="col3">
  174. <span>&copy;2025 <a href="https://anoma.ly" target="_blank" rel="noopener noreferrer">Anomaly Innovations</a></span>
  175. </div>
  176. </section>
  177. </div>
  178. <style>
  179. .hero {
  180. --padding: 3rem;
  181. --vertical-padding: 1.5rem;
  182. --heading-font-size: var(--sl-text-3xl);
  183. margin: 1rem;
  184. border: 2px solid var(--sl-color-border);
  185. }
  186. @media (max-width: 30rem) {
  187. .hero {
  188. --padding: 1rem;
  189. --vertical-padding: 0.75rem;
  190. --heading-font-size: var(--sl-text-2xl);
  191. margin: 0.5rem;
  192. }
  193. }
  194. section.top {
  195. padding: var(--padding);
  196. h1 {
  197. margin-top: calc(var(--vertical-padding) / 8);
  198. font-size: var(--heading-font-size);
  199. line-height: 1.25;
  200. text-transform: uppercase;
  201. }
  202. img {
  203. height: auto;
  204. width: clamp(200px, 70vw, 400px);
  205. }
  206. }
  207. section.cta {
  208. display: flex;
  209. flex-direction: row;
  210. justify-content: flex-start;
  211. align-items: stretch;
  212. border-top: 2px solid var(--sl-color-border);
  213. @media (max-width: 50rem) {
  214. flex-direction: column;
  215. }
  216. & > div {
  217. line-height: 1.4;
  218. padding: var(--vertical-padding) var(--padding);
  219. a {
  220. font-size: 1rem;
  221. }
  222. }
  223. & > div.col1 {
  224. flex: 0 0 auto;
  225. text-align: center;
  226. text-transform: uppercase;
  227. @media (max-width: 50rem) {
  228. padding-bottom: calc(var(--vertical-padding) + 4px);
  229. }
  230. }
  231. & > div.col2 {
  232. flex: 1;
  233. padding-left: 1rem;
  234. padding-right: 1rem;
  235. }
  236. & > div + div {
  237. border-left: 2px solid var(--sl-color-border);
  238. @media (max-width: 50rem) {
  239. border-left: none;
  240. border-top: 2px solid var(--sl-color-border);
  241. }
  242. }
  243. .command {
  244. all: unset;
  245. display: flex;
  246. align-items: center;
  247. gap: 0.625rem;
  248. justify-content: center;
  249. cursor: pointer;
  250. width: 100%;
  251. code {
  252. color: var(--sl-color-text-secondary);
  253. font-size: 1.125rem;
  254. @media (max-width: 24rem) {
  255. font-size: 0.875rem;
  256. }
  257. @media (max-width: 30rem) {
  258. span.protocol {
  259. display: none;
  260. }
  261. }
  262. @media (max-width: 43rem) {
  263. text-align: center;
  264. span:first-child {
  265. display: block;
  266. }
  267. }
  268. }
  269. code .highlight {
  270. color: var(--sl-color-text);
  271. font-weight: 500;
  272. }
  273. .copy {
  274. line-height: 1;
  275. padding: 0;
  276. @media (max-width: 43rem) {
  277. display: none;
  278. }
  279. }
  280. .copy svg {
  281. width: 1rem;
  282. height: 1rem;
  283. vertical-align: middle;
  284. }
  285. .copy svg:first-child {
  286. color: var(--sl-color-text-dimmed);
  287. }
  288. .copy svg:last-child {
  289. color: var(--sl-color-text);
  290. display: none;
  291. }
  292. &.success .copy {
  293. pointer-events: none;
  294. }
  295. &.success .copy svg:first-child {
  296. display: none;
  297. }
  298. &.success .copy svg:last-child {
  299. display: inline;
  300. }
  301. }
  302. }
  303. section.content {
  304. border-top: 2px solid var(--sl-color-border);
  305. padding: var(--padding);
  306. ul {
  307. padding-left: 1rem;
  308. li + li {
  309. margin-top: calc(var(--vertical-padding) / 2);
  310. }
  311. li b {
  312. text-transform: uppercase;
  313. }
  314. }
  315. }
  316. section.images {
  317. --images-height: 600px;
  318. display: grid;
  319. grid-template-columns: 1fr 1fr;
  320. grid-template-rows: var(--images-height);
  321. border-top: 2px solid var(--sl-color-border);
  322. & > div.left {
  323. display: flex;
  324. grid-row: 1;
  325. grid-column: 1;
  326. }
  327. & > div.right {
  328. display: grid;
  329. grid-template-rows: 1fr 1fr;
  330. grid-row: 1;
  331. grid-column: 2;
  332. border-left: 2px solid var(--sl-color-border);
  333. & > div.row1 {
  334. display: flex;
  335. grid-row: 1;
  336. border-bottom: 2px solid var(--sl-color-border);
  337. height: calc(var(--images-height) / 2);
  338. }
  339. & > div.row2 {
  340. display: flex;
  341. grid-row: 2;
  342. height: calc(var(--images-height) / 2);
  343. }
  344. }
  345. figure {
  346. flex: 1;
  347. display: flex;
  348. flex-direction: column;
  349. gap: calc(var(--padding) / 4);
  350. padding: calc(var(--padding) / 2);
  351. border-width: 0;
  352. border-style: solid;
  353. border-color: var(--sl-color-border);
  354. min-height: 0;
  355. overflow: hidden;
  356. & > div, figcaption {
  357. display: flex;
  358. align-items: center;
  359. }
  360. & > div {
  361. flex: 1;
  362. min-height: 0;
  363. display: flex;
  364. align-items: center;
  365. justify-content: center;
  366. }
  367. a {
  368. display: flex;
  369. flex: 1;
  370. min-height: 0;
  371. align-items: center;
  372. justify-content: center;
  373. width: 100%;
  374. height: 100%;
  375. }
  376. figcaption {
  377. letter-spacing: -0.03125rem;
  378. text-transform: uppercase;
  379. color: var(--sl-color-text-dimmed);
  380. flex-shrink: 0;
  381. @media (max-width: 30rem) {
  382. font-size: 0.75rem;
  383. }
  384. }
  385. }
  386. & > div.left figure {
  387. height: var(--images-height);
  388. box-sizing: border-box;
  389. }
  390. & > div.right figure {
  391. height: calc(var(--images-height) / 2);
  392. box-sizing: border-box;
  393. }
  394. & > div.left img {
  395. width: 100%;
  396. height: 100%;
  397. min-width: 0;
  398. object-fit: contain;
  399. }
  400. & > div.right img {
  401. width: 100%;
  402. height: calc(100% - 2rem);
  403. object-fit: contain;
  404. display: block;
  405. }
  406. @media (max-width: 30rem) {
  407. & {
  408. --images-height: auto;
  409. grid-template-columns: 1fr;
  410. grid-template-rows: auto auto;
  411. }
  412. & > div.left {
  413. grid-row: 1;
  414. grid-column: 1;
  415. }
  416. & > div.right {
  417. grid-row: 2;
  418. grid-column: 1;
  419. border-left: none;
  420. border-top: 2px solid var(--sl-color-border);
  421. & > div.row1,
  422. & > div.row2 {
  423. height: auto;
  424. }
  425. }
  426. & > div.left figure,
  427. & > div.right figure {
  428. height: auto;
  429. }
  430. & > div.left img,
  431. & > div.right img {
  432. width: 100%;
  433. height: auto;
  434. max-height: none;
  435. }
  436. }
  437. }
  438. section.alternatives {
  439. border-top: 2px solid var(--sl-color-border);
  440. display: grid;
  441. grid-template-columns: 1fr 1fr;
  442. grid-template-rows: 1fr 1fr;
  443. @media (max-width: 40rem) {
  444. grid-template-columns: 1fr;
  445. grid-template-rows: auto;
  446. }
  447. & > div {
  448. display: flex;
  449. flex-direction: column;
  450. padding: calc(var(--vertical-padding) / 2) calc(var(--padding) / 2) calc(var(--vertical-padding) / 2 + 0.125rem);
  451. text-align: left;
  452. gap: 0.5rem;
  453. @media (max-width: 30rem) {
  454. gap: 0.3125rem;
  455. }
  456. @media (max-width: 40rem) {
  457. text-align: left;
  458. }
  459. }
  460. & > div.col1 {
  461. border-bottom: 2px solid var(--sl-color-border);
  462. @media (max-width: 40rem) {
  463. border-bottom: none;
  464. }
  465. }
  466. & > div.col2 {
  467. border-left: 2px solid var(--sl-color-border);
  468. border-bottom: 2px solid var(--sl-color-border);
  469. @media (max-width: 40rem) {
  470. border-left: none;
  471. border-bottom: none;
  472. border-top: 2px solid var(--sl-color-border);
  473. }
  474. }
  475. & > div.col3 {
  476. @media (max-width: 40rem) {
  477. border-top: 2px solid var(--sl-color-border);
  478. }
  479. }
  480. & > div.col4 {
  481. border-left: 2px solid var(--sl-color-border);
  482. @media (max-width: 40rem) {
  483. border-left: none;
  484. border-top: 2px solid var(--sl-color-border);
  485. }
  486. }
  487. h3 {
  488. letter-spacing: -0.03125rem;
  489. text-transform: uppercase;
  490. color: var(--sl-color-text-dimmed);
  491. font-weight: normal;
  492. font-size: 1rem;
  493. flex-shrink: 0;
  494. @media (max-width: 30rem) {
  495. font-size: 0.75rem;
  496. }
  497. }
  498. .command {
  499. all: unset;
  500. display: flex;
  501. align-items: center;
  502. gap: 0.625rem;
  503. justify-content: flex-start;
  504. cursor: pointer;
  505. width: 100%;
  506. @media (max-width: 40rem) {
  507. justify-content: flex-start;
  508. }
  509. @media (max-width: 30rem) {
  510. justify-content: center;
  511. }
  512. code {
  513. color: var(--sl-color-text-secondary);
  514. font-size: 1rem;
  515. @media (max-width: 24rem) {
  516. font-size: 0.875rem;
  517. }
  518. }
  519. code .highlight {
  520. color: var(--sl-color-text);
  521. font-weight: 500;
  522. }
  523. .copy {
  524. line-height: 1;
  525. padding: 0;
  526. @media (max-width: 40rem) {
  527. display: none;
  528. }
  529. }
  530. .copy svg {
  531. width: 1rem;
  532. height: 1rem;
  533. vertical-align: middle;
  534. }
  535. .copy svg:first-child {
  536. color: var(--sl-color-text-dimmed);
  537. }
  538. .copy svg:last-child {
  539. color: var(--sl-color-text);
  540. display: none;
  541. }
  542. &.success .copy {
  543. pointer-events: none;
  544. }
  545. &.success .copy svg:first-child {
  546. display: none;
  547. }
  548. &.success .copy svg:last-child {
  549. display: inline;
  550. }
  551. }
  552. }
  553. section.footer {
  554. border-top: 2px solid var(--sl-color-border);
  555. display: flex;
  556. flex-direction: row;
  557. & > div {
  558. flex: 1;
  559. text-align: center;
  560. text-transform: uppercase;
  561. padding: var(--vertical-padding) 0.5rem;
  562. }
  563. & > div + div {
  564. border-left: 2px solid var(--sl-color-border);
  565. }
  566. /* Below 800px: first two columns shrink to content, third expands */
  567. @media (max-width: 50rem) {
  568. & > div.col1,
  569. & > div.col2 {
  570. flex: 0 0 auto;
  571. padding-left: calc(var(--padding) / 2);
  572. padding-right: calc(var(--padding) / 2);
  573. }
  574. & > div.col3 {
  575. flex: 1;
  576. }
  577. }
  578. /* Mobile: third column on its own row */
  579. @media (max-width: 30rem) {
  580. flex-wrap: wrap;
  581. & > div.col1,
  582. & > div.col2 {
  583. flex: 1;
  584. }
  585. & > div.col3 {
  586. flex: 1 0 100%;
  587. border-left: none;
  588. border-top: 2px solid var(--sl-color-border);
  589. }
  590. }
  591. }
  592. </style>
  593. <style is:global>
  594. :root[data-has-hero] {
  595. header.header {
  596. display: none;
  597. }
  598. .main-frame {
  599. padding-top: 0;
  600. .main-pane > main {
  601. padding: 0;
  602. }
  603. }
  604. main > .content-panel .sl-markdown-content {
  605. margin-top: 0;
  606. }
  607. }
  608. </style>
  609. <script>
  610. const buttons = document.querySelectorAll("button.command") as NodeListOf<HTMLButtonElement>
  611. buttons.forEach(button => {
  612. button.addEventListener("click", () => {
  613. navigator.clipboard.writeText(button.dataset.command!)
  614. button.classList.toggle("success")
  615. setTimeout(() => {
  616. button.classList.toggle("success");
  617. }, 1500)
  618. })
  619. })
  620. </script>