Skip to main content

Create Quick Command: IDE

Creating your Quick Command

Follow the steps below to create:

Step 1. Access the StackSpot AI Portal

Step 2. On the left side menu, click ‘Quick Command’

Step 3. Click on the ‘Create Quick Command IDE’ button

Step 4. Click 'Start' and fill out the fields on ‘Quick Command Information’ to add information about your quick command

See an example below:

  • Name: Add a name for your Command

Technical Debt

  • Command: Add a name you will use it later; it should follow the slug pattern. For more information about Slugs, see the slug pattern.

/technical_debt_1

  • Description: Add a description of what your Command can do.

Create an issue on GitHub highlighting technical debt on the selected code and suggest a corrective action.

Step 5. Follow the workflow on the screen. Click on 'add button'. Choose ‘Prompt’

1. Prompt

Fill out the fields:

  • Prompt name: Add a slug identifier following the slug pattern. See an example:

/prompt_name_1 /title_issue

  • Insert your prompt: Write down what you want your command to do.

If you want the user to select a specific code extract, insert the code below in the designated box:

{{selected_code}}

Adding this option sends the information to StackSpot AI and make it easier to understand, see the example below:

Write a title of up to 80 characters for a GitHub issue. Read this

{{selected_code}}
  • Use the current Stack to generate code: This option depends on your needs.

    • When enabled, it considers the context of your Stack and generates code based on whether you have a Java or Python Stack, for example. If you require code generation, then this option is necessary.
    • However, if you need to generate text, like translations, it's best to refrain from enabling this option as it may not yield optimal results.
  • 2. Select Knowledge Sources

This is not required. You should choose this option when creating a Quick Command and you want to select a specific context from a Knowledge Source. This option is useful when creating a command requiring detailed knowledge, such as searching for vulnerabilities based on security policies.

Step 6. Click on the plus ‘+’ button. You will see a summary of your command in this box

Example:

Title_issue Write a title of up to 80 characters for a GitHub issue. Read the

{{selected_code}}

Screenshot of the Quick Command creation screen on the StackSpot portal. A highlight is displayed in the area for adding the Quick Command's function, which is 'Summarize this {selected_code} snippet for a GitHub issue description'.

  • Click 'End' then on the Final result screen: Insert .answer after your Quick Command name (only if it is a prompt option):

{{title_issue.answer}}

Step 7. Click ‘End > Finish Flow’

2. Creating a Web Request

Creating a Web Request to open a GitHub issue, for example:

Fill out the fields:

  • Web request name: Add a request name following the slug pattern. Example:

/github_request

  • HTTP Method: Choose a HTTP method.

GET

  • URL Endpoint: Add the Endpoint URL.

https://api.example.com/users

  • Headers:
content-type: application/json
authorization: Bearer your_access_token
  • Request Body:
{ 
"name": "John".
"age": 30

}

See the example:

Image showing the example described above

tip

Use Jinja to interpolate values in the URL endpoint, headers, and request body. For example, add a variable such as {{selected_code}} in the URL or header.

Step 8. Click 'End' and fill out the Quick Command Utilization

Choose the way the user can interact with your Quick Command in the IDE, see below:

  • Replace the selected code

  • Above the selected code

  • Below the selected code

  • Chat

  • Final result: This option shows the success message that the user will see using your Quick Command. You can edit the message and choose the utilization mode as well. See the example below showing the URL to create a GitHub issue:

Final result Insert { to view the predefined input options or click on the tags below: select_mode, title_issue, summarize, propose_improvement;

  • Use chat context: This option uses previous Quick Command responses and interactions as context for subsequent interactions in a specific chat session. You can use this option to have a more coherent and contextually enriched experience across your interactions within the platform. StackSpot AI uses past inputs and responses to inform and enhance your future commands and responses.

Your issue was successfully created at the following URL: {{create_issue.json[0].url}}

Step 8. Click ‘End > Finish Flow’

info

How can I navigate every step of that creation flow?

When the response is a JSON, you can browse specific parts of the previous steps you did on the creation flow. You can work with the attributes, the values, etc. This step is essential because you can extract what the user needs. For example, a field of that service you created, a header, what was the status, etc.

If you need to know any value from the previous steps, add the information below:

1. Web Request See below a server that can return the following object format:

Headers: {"headers_name": "value", ...}
data: text
status: [200-599]
json: json - dictionary of the "data"

Example: {{create_issue.json[0].url}}

  • If the data you receive is in JSON format, you can easily navigate through your data's values and attributes.
  • The json field will be empty if it is not a JSON.

2. Prompt By default, you can navigate through the following fields:

answer: string
prompt_tokens: string
completion_tokens: string
total_cost: Decimal

Example: {{my_prompt.answer}}

What can you do next?

After creating your Quick Command, add it to your Studio or a Workspace, depending on your permission.

1. Add to a Workspace to make this Quick Command available for the users in your organization

See if you have permission to do it. If you need help, contact your account administrator.

Follow the instructions:

  • On the left side menu, access 'Workspace';
  • Click 'Add Quick Command';
  • Select the commands you want and click 'Add Quick Command.'
info
  • You can find Knowledge Sources inside the Workspace with the Quick Command. However, using a Quick Command does not affect the Knowledge Sources.
  • The only Knowledge Sources that affect your Quick Command are the ones you added while creating the command.

Delete Quick Command (QC) linked to a Workspace

caution

This action is irreversible.

Deleting a Quick Command (QC) with a linked Workspace or Studio may affect certain users. Follow these steps to delete:

  1. On left-side menu click ‘Quick Command’;
  2. Select the Quick Command you want to delete and click ‘Settings’;
  3. Click the ‘Delete’ button.

Next Step