# VS Code ICP Extension

**URL:** <https://forum.dfinity.org/t/vs-code-icp-extension/34747>\
**Category:** CDK\
**Created:** [September 4, 2024, 12:54pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747 "2024-09-04T12:54:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [September 4, 2024, 12:54pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/1 "2024-09-04T12:54:26Z")

</div>

Hi,  
We received funding from the Dfinity Foundation to develop a VS Code extension for ICP. One of the deliverables for Milestone 2 is to publish the extension on the VS Code Marketplace.

Before doing so, however, we would like to gather some feedback from the developer community.

Here’s the link to download the .vsix file: Download the .vsix file  
[https://] drive[.]google[.]com/file/d/1KkI4M8Xq2BNfkDyTw3zWxct2LADQk4YP/view?usp=sharing)

To Install the .vsix package in Visual Studio Code:

- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or by pressing Ctrl+Shift+X.
- Click on the three dots in the top right corner of the Extensions view.
- Select Install from VSIX…
- Browse to the .vsix file generated in step 2 and select it.

## Example Use Cases

The extension comes with several built-in commands to manage and interact with `dfx.json` and related development tasks. These commands are executed through the context menu in the Canisters View.

**Refresh** : When you have made changes to the `dfx.json` file outside of VS Code or through other processes and want to ensure the tree view is up-to-date.

`canisters> Show Actions`:

1. **Start the Replica** :

2. **Deploy All Canisters** :

3. **Deploy Candid** :

`Show Canister Actions`:

1. **Deploy a Canister** :

2. **View Logs** :

3. **Open Candid UI** :

4. **Open Candid UI in sidebar** :

`Deployed canisters`:

This is a menu view which shows deployed canisters and by selecting one of it you can open Candid UI with selected deployed canister in sidebar.

## Candid UI

For running Candid UI in this extension we changed authentication functionality by removing authentitcating user in Internet Identity canister and instead we added set of 10 random identities in Candid UI which are ready to use. They are generated from the same seed phrase `during nut robust trouble drip question series endless hurry upper track cost time bone crunch gorilla cause peasant fantasy prison banana toy toward mean` and with changed derivation path for next ones. Also we added functions to expand this set which are

1. **Add new identity** - adds new random identity from the seed phrase pasted above
2. **New identity from seed phrase** - adds new identity from the seed phrase given by user
3. **New identity from private key** - adds new identity from private key given by user

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [September 4, 2024, 6:49pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/2 "2024-09-04T18:49:02Z")

</div>

I’ll be trying this today  
Love the idea

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [September 4, 2024, 7:57pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/3 "2024-09-04T19:57:43Z")

</div>

I was able to download the vsix, but you may want to fix the link. I had to copy it and manually put it together

Start replica works for me but the CandidUI and deploy are not working due to `not a terminal` error

```auto
Deploying canister: main
Error: Command failed: dfx deploy main
Error: Failed to create AgentEnvironment.
Caused by: Failed to create AgentEnvironment for network 'local'.
Caused by: Failed to load identity
Caused by: Failed to instantiate identity
Caused by: Failed to load PEM
Caused by: Failed to load PEM file from file
Caused by: Failed to decrypt PEM file at /home/gekctek/.config/dfx/identity/main/identity.pem.encrypted
Caused by: Failed to read user input
Caused by: IO error: not a terminal
Caused by: not a terminal

```

Im using VSCode on windows with WSL2 ubuntu

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [September 5, 2024, 7:36am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/4 "2024-09-05T07:36:05Z")

</div>

We will look into it and get back to You,  
regarding the link, I couldn’t post a valid link.

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [September 16, 2024, 8:39am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/5 "2024-09-16T08:39:18Z")

</div>

Could You try with the new vsix file?  
Should be fixed now.  
[https://]drive.google[.]com/drive/folders/1N3dIVUWtCM0u5LVgL3hilBz8vLnHmKAL?usp=drive\_link

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [September 19, 2024, 7:39pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/6 "2024-09-19T19:39:50Z")

</div>

Im no longer getting that error  
It deploys the canister but I dont see any ‘Deployed Canisters’ or ‘Candid UI’  
Candid UI just shows ‘Waiting for Candid UI deploy finish’ even with a restart/refresh

---

<div class="post-metadata">

**Author:** ![DanGTZ](https://avatars.discourse-cdn.com/v4/letter/d/c67d28/32.png) [@DanGTZ](https://forum.dfinity.org/u/DanGTZ)\
**Post date:** [September 21, 2024, 1:12pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/7 "2024-09-21T13:12:02Z")

</div>

Hi @SE7EN I just installed the extension and opened the dfx.json file from the Azle Internet Identity example: [azle/tests/end\_to\_end/http\_server/internet\_identity at main · demergent-labs/azle · GitHub](https://github.com/demergent-labs/azle/tree/main/tests/end_to_end/http_server/internet_identity)

It found 1 error in the file, while the `dfx deploy` command works perfectly fine using dfx `0.20.1`:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/5/b/5b19330e548bb9f1281e4f43fad17cb424a7c546.png)

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/9/8/98346a2a73e7ad171c93bcfa0333c7d58e538bcd.png)

`property type must have one of the values: rust, assets, custom, motoko, pull`

EDIT : if I use dfx `0.23.0` to deploy, I get the error `canister 'backend' has unknown type 'azle' and there is no installed extension by that name which could define it`, so indeed, this dfx file is not valid for using with the last version of dfx.

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [September 23, 2024, 8:58am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/9 "2024-09-23T08:58:31Z")

</div>

Each canister definition must include a type field, which can have one of the following values:

```
rust
assets
custom
motoko
pull

```

However, yours has the value azle, which is invalid.

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [September 23, 2024, 9:00am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/10 "2024-09-23T09:00:53Z")

</div>

Could you check if you can pass your identity password in Your terminal?

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [September 23, 2024, 6:57pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/11 "2024-09-23T18:57:30Z")

</div>

im not exactly sure what you mean. It prompts me for a password and i give it. that works. just nothing shows up in the UI

---

<div class="post-metadata">

**Author:** ![mmyslblocky](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mmyslblocky/32/20543_2.png) [@mmyslblocky](https://forum.dfinity.org/u/mmyslblocky)\
**Post date:** [September 26, 2024, 10:48am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/12 "2024-09-26T10:48:39Z")

</div>

Can you provide us logs from terminal when you are trying to open the Candid UI? And can you write the steps to the point when you are trying to open canister in Candid UI view? Can you confirm that the canister for which you want to open Candid UI is running and can you check that after deploying given canister that there has been created directory `.dfx/local` with file `canister_ids.json` which contains IDs of the local deployed canisters? This directory should be located in the directory root of the project you are currently working on. I am assuming that there is no problem with deploying this canister you are working on outside of the extension and everything is running fine then?

---

<div class="post-metadata">

**Author:** ![Gekctek](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/gekctek/32/6863_2.png) [@Gekctek](https://forum.dfinity.org/u/Gekctek)\
**Post date:** [October 2, 2024, 7:55pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/13 "2024-10-02T19:55:43Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/c/d/cd1122f85e7223912218adce9db8e4cfa212e745.png)  
I dont get any errors as you can see. It also deploys the candid UI with ‘Open CandidUI’, but the sidebar does nothing and just says `Waiting for Candid UI deploy finish` when doing ‘Open CandidUI with sidebar’  
Also no deployed canisters

---

<div class="post-metadata">

**Author:** ![Henry\_Suso](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/henry_suso/32/16796_2.png) [@Henry\_Suso](https://forum.dfinity.org/u/Henry_Suso)\
**Post date:** [October 2, 2024, 10:29pm UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/14 "2024-10-02T22:29:00Z")

</div>

This seems awesome. I use a tablet and vscode is really a big part of my day. I’ll check this out.

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [October 9, 2024, 11:08am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/15 "2024-10-09T11:08:49Z")

</div>

You can now just download the extension from VS Code marketplace directly, search for:   
ICP support

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/4/4/44c7c7a4a8caa488e38198898220a5c4f3fea023.png)

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [October 14, 2024, 7:23am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/16 "2024-10-14T07:23:25Z")

</div>

I deployed a canister and could open the Candid UI in the sidebar successfully. Really cool that you have this feature to create new account, that is helpful for quick test!

What do I need to do to see canister logs? And would it be possible to enable different network flags when deploying? E.g. that I can also deploy to mainnet or to the playground (like `dfx deploy --playground`) on mainnet?

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [October 14, 2024, 7:30am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/17 "2024-10-14T07:30:43Z")

</div>

The available identities seem to be persistent, is there a way to access their PEM file or seed so we can use them outside of the extension as well?

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [October 14, 2024, 7:34am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/18 "2024-10-14T07:34:06Z")

</div>

BTW, this is the URL to the extension

> **[ICP support - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=BlockyDevs.vscode-motoko-helper)**
>
> Extension for Visual Studio Code - Support for canister deployment and language support for dfx.json file

---

<div class="post-metadata">

**Author:** ![cryptoschindler](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/cryptoschindler/32/26_2.png) [@cryptoschindler](https://forum.dfinity.org/u/cryptoschindler)\
**Post date:** [October 14, 2024, 7:35am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/19 "2024-10-14T07:35:30Z")

</div>

@SE7EN would be awesome if the documentation on the extension page in VSCODE could be more user centric 🙂

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [October 15, 2024, 11:41am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/20 "2024-10-15T11:41:56Z")

</div>

Thanks for your feedback.

At the moment, we only support the local network, and we don’t display canister logs. However, we’ll keep this in mind as we work on the next version.

---

<div class="post-metadata">

**Author:** ![SE7EN](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@SE7EN](https://forum.dfinity.org/u/SE7EN)\
**Post date:** [October 15, 2024, 11:47am UTC](https://forum.dfinity.org/t/vs-code-icp-extension/34747/21 "2024-10-15T11:47:41Z")

</div>

We’re currently using a constant seed phrase for every user (which we acknowledge is not ideal from a security perspective). The seed phrase can be found in the Readme:

```auto
during nut robust trouble drip question series endless hurry upper track cost time bone crunch gorilla cause peasant fantasy prison banana toy toward mean

```

However, you can import your own identity using your own seed phrase or private key. In the next version, we plan to allow users to generate their own seed phrases.

[Next page](https://forum.dfinity.org/t/vs-code-icp-extension/34747.md?page=2)
