Skip to main content
Quick context: LearnPack can open as a VS Code extension (agent: “vscode”) or in the browser (agent: “os”). It auto-detects the environment, and you can also set it in learn.json. 🙂

Agent and mode in LearnPack

What is the agent in LearnPack

LearnPack is an application with various small parts connected to each other. When you run LearnPack inside Visual Studio Code, it is slightly different from running it in a browser. Due to these implementation differences, it is possible to configure LearnPack to open as a VS Code extension (agent = “vscode”) or to open the interface in the browser (agent = “os”).

At a glance

AgentWhere the UI opensHow it is set
vscodeInside VS Code as an extensionAuto-detected in VS Code, or set in learn.json under editor.agent
osIn your default web browserAuto-detected when started outside VS Code, or set in learn.json

What is the “mode” in LearnPack

LearnPack will notice in which program it was executed to determine the agent, but the agent can also be specified within learn.json in the editor.agent section. This allows users to explicitly define how they want LearnPack to be executed. If a difference is detected between the detected agent and the suggested one, LearnPack will display a warning. This warning is important to ensure the best user experience, as each agent has its own characteristics and advantages. For example, if LearnPack detects that it is running in VS Code but the learn.json file suggests that it should run in a browser, a message will be displayed recommending changing the agent to avoid potential compatibility or functionality issues.
Tip: Keep editor.agent aligned with where you actually run LearnPack to avoid warnings and ensure the best UI behavior.

How to run LearnPack with agent “os” (browser)

1

Close VS Code

Save your work and close the VS Code application.
2

Open a terminal

Use your system terminal or command prompt.
3

Go to your project

Navigate to the LearnPack project directory with cd.
4

Start LearnPack

Run: learnpack start

How to run LearnPack from VS Code (agent “vscode”)

1

Open VS Code

Launch Visual Studio Code on your computer.
2

Install the LearnPack extension

Open the Extensions view (Ctrl+Shift+X), search for LearnPack, then install or enable it.
3

Open the terminal in VS Code

Use the integrated terminal to work in your project directory.
4

Start LearnPack

In the tutorial directory, run: learnpack start

Next up

See also