Lander.astro 16 KB

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