|
2 | 2 | sidebar_position: 1 |
3 | 3 | --- |
4 | 4 |
|
5 | | -# Tutorial Intro |
| 5 | +# Intro |
6 | 6 |
|
7 | | -Let's discover **Docusaurus in less than 5 minutes**. |
| 7 | +Let's discover **auto-code in less than 5 minutes**. |
8 | 8 |
|
9 | | -## Getting Started |
10 | | - |
11 | | -Get started by **creating a new site**. |
| 9 | +## Installation and Setup |
12 | 10 |
|
13 | | -Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**. |
| 11 | +You will need an Anthropic or OpenAI API key to use this tool. They should be exported as environment variables. For example |
14 | 12 |
|
15 | | -### What you'll need |
16 | | - |
17 | | -- [Node.js](https://nodejs.org/en/download/) version 18.0 or above: |
18 | | - - When installing Node.js, you are recommended to check all checkboxes related to dependencies. |
| 13 | +```bash |
| 14 | +export OPENAI_API_KEY="your-api-key" |
| 15 | +export ANTROPIC_API_KEY="your-api-key" |
| 16 | +``` |
19 | 17 |
|
20 | | -## Generate a new site |
| 18 | +Then you can run the tool via `npx`: |
21 | 19 |
|
22 | | -Generate a new Docusaurus site using the **classic template**. |
| 20 | +```base |
| 21 | +npx @autocode2/cli@latest --help |
| 22 | +``` |
23 | 23 |
|
24 | | -The classic template will automatically be added to your project after you run the command: |
| 24 | +For brevity, I recommend adding an alias to your shell profile: |
25 | 25 |
|
26 | 26 | ```bash |
27 | | -npm init docusaurus@latest my-website classic |
| 27 | +alias ac2="npx @autocode2/cli@latest" |
28 | 28 | ``` |
29 | 29 |
|
30 | | -You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor. |
| 30 | +Then you can run the tool via `ac2`. The following examples will assume you have done this. |
| 31 | + |
| 32 | +## Getting Started |
31 | 33 |
|
32 | | -The command also installs all necessary dependencies you need to run Docusaurus. |
| 34 | +Get started by **creating a new app**. We'll use a simple remix app starter, but you can of course start anything you like. |
33 | 35 |
|
34 | | -## Start your site |
| 36 | +```bash |
| 37 | +npx create-remix@latest --template jacob-ebey/remix-shadcn |
| 38 | +cd your-app-name |
| 39 | +npm run dev |
| 40 | +``` |
35 | 41 |
|
36 | | -Run the development server: |
| 42 | +## Generate some code |
37 | 43 |
|
38 | 44 | ```bash |
39 | | -cd my-website |
40 | | -npm run start |
| 45 | +ac2 code:run --include "src/**/*.{ts,tsx}" -m sonnet "Replace this initial starter app with a simple todo app" |
41 | 46 | ``` |
42 | 47 |
|
43 | | -The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there. |
| 48 | +All being well, you should see some output from the LLM and it should have edited the files in your project. |
| 49 | + |
| 50 | +## Chat with the LLM |
44 | 51 |
|
45 | | -The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/. |
| 52 | +You can continue the conversation with the LLM by using the `-c` (or `--continue`) flag, or for an interactive chat use the `code:chat` command. |
| 53 | + |
| 54 | +```bash |
| 55 | +ac2 code:chat -c -m sonnet |
| 56 | +``` |
46 | 57 |
|
47 | | -Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes. |
|
0 commit comments