Core - User Guide
In this section, you will learn all the features of AllAi Code and the best practices for the features with Core examples.
All features are not available on trial accounts.
Features:
1. Code Generation (with Interactive Chat)
Open the AllAi Interactive Chat and type what you need. If you like the proposed code, you can press "Insert to editor" button to place the code to where your cursor is.
1.1. Bug/Issue fixing with Chat
At OSF Digital, we believe that the true power of AllAi lies not just in its features, but in the adeptness of the user's prompting skills. Our course modules are meticulously designed to transform our clients into proficient prompters, enabling them to harness the full capabilities of AllAi.
In the following example, we demonstrate the practical application of this skill. Observe how, through prompting, we guide AllAi to analyze an issue and formulate an effective solution.
2. Code Completion
First, don’t forget to select in the Extensions settings the Maximum lines of code you want to be automatically completed.
Just type and wait! You will see the running cycle of AllAi at the right bottom corner.
This means, it's working and will show you the result in a few seconds.
3. Code Explanation
Select a piece of code, "Right Click" and select “OSF Digital - AllAi > Explain code“:
4. Docstring Generation
First, Right Click anywhere inside the function block.
Then select “OSF Digital - AllAi > Generate docstring”.
5. Docstring Generation (batch)
First, Right Click anywhere inside the file.
Then select “OSF Digital - AllAi > Batch generate Docstring”.
AllAi will start generating docstrings for each method one by one.
6. Unit Test Generation
Select the whole class or a method that you want to generate unit tests.
Then Right Click anywhere inside the file and select “OSF Digital - AllAi > Generate unit tests”.
Modify the result
After the unit tests are generated, you can modify the result by giving instructions to AllAi.
E.g. “add 2 invalid cases“
7. Knowledge Bases
You can enable AllAi to browse the Salesforce documentation pages before answering the questions. And once it's done generating the answer, it will reference its sources.
Enable the Knowledge Bases that you want AllAi to focus on while generating answers by selecting it with a tag in the chat input field.
Ask your question and AllAi will give references to the sources that it used while generating the answer. You can click on the links to open it in your browser.
8. Workspace Indexing
AllAi can only see one file at a time. It only sees the open file. So it's not aware of any functions or interfaces that you might have defined in other files.
With the Workspace Indexing feature, AllAi indexes your entire workspace, allowing it to "memorize" all the code you have and use it as a reference when answering questions in Chat.
Your entire workspace is automatically indexed when you open it in VS Code for the first time. To confirm this, just check for the presence of the .allai
folder in your workspace. It should contain the workspace.db
file inside.
The workspace.db
file will consequently be added to the changes made to your workspace. However, it’s not mandatory to stage and commit it to your branch. You can always discard it.
To use the advantages of the Workspace indexing feature, simply select the “Workspace“ option as you did with the Knowledge Base selection.
First, ask your question.
Then, check the answer and the “Sources” used.
Lastly, Click on a source to open the file and check the code.
9. Slash commands
The Slash Commands feature in AllAi Code empowers you to streamline repetitive tasks by defining custom commands through .prompt
files. These commands can be invoked directly in the chat using the /
symbol, making your workflow smoother and more efficient.
🧩 What Are Slash Commands?
Slash Commands allow you to:
Automate repetitive coding tasks (e.g., generating docstrings, creating boilerplate code).
Customize prompts based on your coding standards and preferred languages.
Seamlessly integrate context-aware commands in your chat by using
/
symbol.
📂 File Structure
Slash Commands are defined using .prompt
files with a structured JSON format.
{
"handle": "command_handle",
"name": "Example Command",
"description": "Short description of your command",
"prompt": [
{
"sender": "system",
"contentTemplate": "A custom system message"
},
{
"sender": "user",
"contentTemplate": "The message that will be added in the chat."
}
]
}
When you open a .prompt
file, a custom editor will open with a graphical user interface so you don’t need to write any JSON.
⚙️ How It Works
Create a
.prompt
file in your project.Define your command:
handle
: Unique identifier (used with/
to trigger the command).name
: Descriptive name of the command.description
: Brief description of what the command does.prompt
: Sequence of messages to generate output, using placeholders (e.g.,{{language}}
,{{selection}}
).
Trigger the command in the chat:
Use
/handle
(e.g.,/docstring
).AllAi Code will:
Process the selected code or context.
Apply the defined prompts
Return the generated output.
📌 Supported Placeholders
Placeholder | Description |
---|---|
{{input}} | The text after /handle |
{{selection}} | Currently selected code in your editor |
{{file_name}} | The name of the currently open file |
{{language}} | The language of the currently open file |