-
Notifications
You must be signed in to change notification settings - Fork 1
doc: initial guide to the plugin #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
46b611f
chore: changelog sections got messed up by the merge algorithm
fioan89 e6ff89b
chore: next version is 0.1.4
fioan89 a6ce4fb
doc: initial guide to the plugin
fioan89 d1ebe43
fix: improve error reporting when an agent can't be resolved
fioan89 88f4cb0
doc: fix misleading documentation around agents
fioan89 4bcf3d2
impl: rename `project_path` query param to `folder`
fioan89 1be61f1
fix: plugin install uri
fioan89 b6570ee
fix: drop support for agent name
fioan89 e410d41
fix: install location in Windows
fioan89 b872be2
impl: show plugin main page when uri handling
fioan89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,12 +1,109 @@ | ||
# Toolbox Gateway plugin sample | ||
# Coder Toolbox plugin | ||
|
||
To load plugin into the provided Toolbox App, run `./gradlew build copyPlugin` | ||
[](https://discord.gg/coder) | ||
[](https://twitter.com/coderhq) | ||
[](https://github.com/coder/coder-jetbrains-toolbox/actions/workflows/build.yml) | ||
|
||
or put files in the following directory: | ||
Connects your JetBrains IDE to Coder workspaces | ||
|
||
* Windows: `%LocalAppData%/JetBrains/Toolbox/cache/plugins/plugin-id` | ||
* macOS: `~/Library/Caches/JetBrains/Toolbox/plugins/plugin-id` | ||
* Linux: `~/.local/share/JetBrains/Toolbox/plugins/plugin-id` | ||
## Getting Started | ||
|
||
Put all required .jar files (do not include any dependencies already included with the Toolbox App to avoid possible resolution conflicts), | ||
`extensions.json` and `icon.svg` in this directory. | ||
To install this plugin using JetBrains Toolbox, follow the steps below. | ||
|
||
1. Install [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/). Make sure it's the `2.6.0.40284` release or | ||
above. | ||
2. Launch the Toolbox app and sign in with your JetBrains account (if needed). | ||
|
||
### Install Coder plugin via URI | ||
|
||
You can quickly install the plugin using this JetBrains hyperlink. | ||
|
||
👉 [Install plugin](jetbrains://gateway/com.coder.toolbox) | ||
|
||
This will open JetBrains Toolbox and prompt you to install the Coder Toolbox plugin automatically. | ||
|
||
Alternatively, you can paste `jetbrains://gateway/com.coder.toolbox` into a browser. | ||
|
||
### Manual install | ||
|
||
There are two ways Coder Toolbox plugin can be installed. The first option is to manually download the plugin | ||
artifact from [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/26968-coder/versions) | ||
or from [Coder's Github Release page](https://github.com/coder/coder-jetbrains-toolbox/releases). | ||
|
||
The next step is to copy the zip content to one of the following locations, depending on your OS: | ||
|
||
* Windows: `%LocalAppData%/JetBrains/Toolbox/plugins/com.coder.toolbox` | ||
* macOS: `~/Library/Caches/JetBrains/Toolbox/plugins/com.coder.toolbox` | ||
* Linux: `~/.local/share/JetBrains/Toolbox/plugins/com.coder.toolbox` | ||
|
||
Alternatively, you can install it using the _Gradle_ tasks included in the project: | ||
|
||
```shell | ||
|
||
./gradlew cleanAll build copyPlugin | ||
``` | ||
|
||
Make sure Toolbox is closed before running the command. | ||
|
||
## Connect to a Coder Workspace via JetBrains Toolbox URI | ||
|
||
You can use specially crafted JetBrains Gateway URIs to automatically: | ||
|
||
1. Open Toolbox | ||
|
||
2. Install the Coder Toolbox plugin (if not already installed) | ||
|
||
3. Connect to a specific Coder deployment using a URL and a token. | ||
|
||
4. Select a running workspace | ||
|
||
5. Install a specified JetBrains IDE on that Workspace | ||
|
||
6. Open a project folder directly in the remote IDE | ||
|
||
### Example URIs | ||
|
||
```text | ||
jetbrains://gateway/com.coder.toolbox?url=https%3A%2F%2Fdev.coder.com&token=zeoX4SbSpP-j2qGpajkdwxR9jBdcekXS2&workspace=bobiverse-bob&agent=dev&ide_product_code=GO&ide_build_number=241.23774.119&folder=%2Fhome%2Fcoder%2Fworkspace%2Fhello-world-rs | ||
|
||
jetbrains://gateway/com.coder.toolbox?url=https%3A%2F%2Fj5gj2r1so5nbi.pit-1.try.coder.app%2F&token=gqEirOoI1U-FfCQ6uj8iOLtybBIk99rr8&workspace=bobiverse-riker&agent=dev&ide_product_code=RR&ide_build_number=243.26053.17&folder=%2Fhome%2Fcoder%2Fworkspace%2Fhello-world-rs | ||
``` | ||
|
||
### URI Breakdown | ||
|
||
```text | ||
jetbrains://gateway/com.coder.toolbox | ||
?url=http(s)://<your-coder-deployment> | ||
&token=<auth-token> | ||
&workspace=<workspace-name> | ||
&agent_id=<agent--id> | ||
&ide_product_code=<IDE-code> | ||
&ide_build_number=<IDE-build> | ||
&folder=<absolute-path-to-a-project-folder> | ||
``` | ||
|
||
| Query param | Description | Mandatory | | ||
|------------------|------------------------------------------------------------------------------|-----------| | ||
| url | Your Coder deployment URL (encoded) | Yes | | ||
| token | Coder authentication token | Yes | | ||
| workspace | Name of the Coder workspace to connect to. | Yes | | ||
| agent_id | ID of the agent associated with the workspace | No | | ||
| ide_product_code | JetBrains IDE product code (e.g., GO for GoLand, RR for Rider) | No | | ||
fioan89 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ide_build_number | Specific build number of the JetBrains IDE to install on the workspace | No | | ||
| folder | Absolute path to the project folder to open in the remote IDE (URL-encoded) | No | | ||
|
||
If only a single agent is available, specifying an agent ID is optional. However, if multiple agents exist, | ||
you must provide either the ID to target a specific one. Note that this version of the Coder Toolbox plugin | ||
does not automatically start agents if they are offline, so please ensure the selected agent is running before | ||
proceeding. | ||
|
||
If `ide_product_code` and `ide_build_number` is missing, Toolbox will only open and highlight the workspace environment | ||
page. Coder Toolbox will attempt to start the workspace if it’s not already running; however, for the most reliable | ||
experience, it’s recommended to ensure the workspace is running prior to initiating the connection. | ||
|
||
## Releasing | ||
|
||
1. Check that the changelog lists all the important changes. | ||
2. Update the gradle.properties version. | ||
3. Publish the resulting draft release after validating it. | ||
4. Merge the resulting changelog PR. |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
version=0.1.3 | ||
version=0.1.4 | ||
group=com.coder.toolbox | ||
name=coder-toolbox |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -1,33 +1,24 @@ | ||
package com.coder.toolbox.util | ||
|
||
// These are keys that we support in our Gateway links and must not be changed. | ||
private const val TYPE = "type" | ||
const val URL = "url" | ||
const val TOKEN = "token" | ||
const val WORKSPACE = "workspace" | ||
const val AGENT_NAME = "agent" | ||
const val AGENT_ID = "agent_id" | ||
private const val IDE_PRODUCT_CODE = "ide_product_code" | ||
private const val IDE_BUILD_NUMBER = "ide_build_number" | ||
private const val PROJECT_PATH = "project_path" | ||
|
||
// Helper functions for reading from the map. Prefer these to directly | ||
// interacting with the map. | ||
|
||
fun Map<String, String>.isCoder(): Boolean = this[TYPE] == "coder" | ||
private const val FOLDER = "folder" | ||
|
||
fun Map<String, String>.url() = this[URL] | ||
|
||
fun Map<String, String>.token() = this[TOKEN] | ||
|
||
fun Map<String, String>.workspace() = this[WORKSPACE] | ||
|
||
fun Map<String, String?>.agentName() = this[AGENT_NAME] | ||
|
||
fun Map<String, String?>.agentID() = this[AGENT_ID] | ||
|
||
fun Map<String, String>.ideProductCode() = this[IDE_PRODUCT_CODE] | ||
|
||
fun Map<String, String>.ideBuildNumber() = this[IDE_BUILD_NUMBER] | ||
|
||
fun Map<String, String>.projectPath() = this[PROJECT_PATH] | ||
fun Map<String, String>.projectFolder() = this[FOLDER] |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.