How can I use the Notecard CLI from VS Code

I Want to Interact with Notecard from VS Code

Is there a way I can talk to Notecard from the VS Code environment?

Use the Notecard CLI from the VS Code Terminal

The Notecard CLI is a command line executable that can be used to interact with Notecard.
You can perform the following tasks from the VS Code Terminal:

  • Execute single Notecard requests
  • Execute sequence of requests in a JSON script
  • Open an interactive session with Notecard
  • Execute debug traces

What is the VS Code Terminal?

A window in VS Code where you can execute operating system commands. For more details, see: Integrated Terminal in Visual Studio Code

How do I use the Notecard CLI in the terminal?

Here are the basic steps for using the Notecard CLI in VS Code

  1. Download the Notecard CLI executable for your system from Github here:

  2. Copy the executable to a folder on your system path **

  3. Start VS Code (or restart it if you already have it open)

  4. Open a Terminal window with

    ctrl-shift-`

  5. Enter notecard in the VS Code Terminal to test the command is working. It should return the command line usage documentation

At the end, if the notecard utility is able to detect serial ports it will list the available serial ports

Ports on 'serial':
   COM12
   COM4 ***
   COM14

the one with *** was detected as a Notecard connected via USB, and this will be the default if you don’t specify a port.


** Configuring system path

The system path enables an executable to be executed without needing to specify the entire folder path name where the executable is stored on your system. You can either store the executable in a directory already on the system path, or add a directory to the system path.

You can update the system path to include a folder or directory where you stored the executable.

Here are a couple of references: