-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first-draft vscode page for docs (#125)
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Get started: LaVague VSCode Extension **Alpha** | ||
|
||
The LaVague VSCode Extension allows you to leverage LaVague directly in VSCode. | ||
|
||
You can generate your automation code and directly preview and test the generated code within VSCode! | ||
|
||
!!! warning "Pre-requisites" | ||
To use our VSCode extension you will need: | ||
|
||
- A version of VSCode >= 1.80 | ||
- The Jupyter notebooks VSCode extension | ||
- To install a webdriver & LaVague: You can install them with the following command: `wget https://raw.githubusercontent.com/lavague-ai/LaVague/main/setup.sh &&sudo bash setup.sh` | ||
|
||
See the LaVague installation instructions [for more details](https://docs.lavague.ai/en/latest/docs/get-started/setting-up-la-vague/)! | ||
|
||
### LaVague VSCode Extension in Action | ||
|
||
Check out what the LaVague VSCode Extension looks like in action: | ||
|
||
<div> | ||
<figure> | ||
<img src="https://raw.githubusercontent.com/lavague-ai/lavague/main/docs/assets/vscode-demo.gif" alt="LaVague VSCode Extension Example"> | ||
<figcaption><b>LaVague interacting with Hacker News.</b></figcaption> | ||
</figure> | ||
<br><br> | ||
</div> | ||
|
||
### Getting started | ||
|
||
Firstly, you'll need to download the [LaVague extension from VSCode marketplace](https://marketplace.visualstudio.com/items?itemName=LaVagueAI.lavague). | ||
|
||
Now, you can open your first LaVague project: | ||
|
||
- Open the VSCode Command Palette with Ctrl+Shift+P | ||
|
||
- Type or search and find the 'LaVague: New project' command | ||
<img src="https://github.com/lavague-ai/lavague/blob/main/vscode-assets/command-2.png?raw=true" alt="open new project" width=60%> | ||
|
||
This will open a new LaVague project. | ||
|
||
### Adding your URL and instruction | ||
|
||
You can add the URL you wish to generate automation code as an argument to `driver.get` in the boilerplate code block. | ||
|
||
<img src="https://github.com/lavague-ai/lavague/blob/main/vscode-assets/add-url.png?raw=true" alt="modify URL" width=75%> | ||
|
||
If we now run this first block of code, a VSCode window opens displaying our target site. | ||
|
||
We're now ready to add an instruction for the action we'd like to automate following the `%lavague-exec` magic command: | ||
|
||
<img src="https://github.com/lavague-ai/lavague/blob/main/vscode-assets/instruction.png?raw=true" alt="add instruction" width=75%> | ||
|
||
!!! warning "OpenAI API key" | ||
You will need to have an OPENAI_API_KEY variable set in your notebook environment. | ||
|
||
If you don't have yours set in your notebook environment, you can add the following code into a cell: | ||
|
||
``` | ||
import os | ||
os.environ['OPENAI_API_KEY'] = '' | ||
``` | ||
|
||
Your automation code will populate the next cell. | ||
|
||
<img src="https://github.com/lavague-ai/lavague/blob/main/vscode-assets/instruction-and-code.png?raw=true" alt="generated code" width=75%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters