Skip to main content

AI Code Assistant

Twinit AI Code Assistant#

The Twinit AI Code Assistant introduces a powerful, integrated AI support experience inside the Twinit VSCode Extension. It enables you to generate code, explore explanations, and integrate results into your files, all without leaving your development environment. This assistant is powered by the CodeAssistAgent provided by the Twinit AI Service, ensuring high-quality, context-aware responses tailored to your project.


Getting Started#

To begin using the AI Code Assistant, follow these steps:

Open the Assistant#

Click the Twinit AI Code Assist button in the bottom panel of the Twinit VSCode Extension.

Select a Project#

Choose the project you want the assistant to work with.

Configuration Check#

Once a project is selected, the system verifies that the necessary components are available:

  • OpenAI Token
  • Agent
  • Team

If all components are already present, you can immediately begin chatting with the AI.

Automatic Setup When Needed#

If any configuration is missing, the system automatically sets up the required items. If it does not already exist, the only input you will need to provide is your OpenAI Token. After this setup is complete, you can begin interacting with the AI Code Assistant right away.


Using the AI Code Assistant#

The assistant’s interface is built to support a smooth, developer friendly workflow. It provides tools for understanding code, reviewing reasoning, and inserting results into your files with as few steps as possible.


Key Features#

Below is a detailed overview of what the AI Code Assistant offers.

Side-by-Side Code and Explanations#

The assistant displays generated answers in a dual-panel layout:

  • Code Snippet Panel: Shows the code proposed by the AI using clear, formatted syntax.

  • Explanation Panel: Provides contextual and technical reasoning behind the generated code. This may include architectural considerations, best practices, or suggestions for adapting the code.

You can click on a code snippet to highlight its related explanation, or click an explanation to highlight the corresponding code block. This connected view helps you understand both what the code does and why it was generated that way.

Copy Snippet#

Each snippet features a Copy button. This allows you to quickly copy the code to your clipboard for use anywhere in your project.

Insert Snippet Into Your Project#

You can also insert a snippet directly into your project using the Insert button.

The insertion behavior is context-aware:

  • If you have both the chat panel and a code file open side by side, the snippet is inserted at your current cursor position in the active file.
  • If no editor file is open or the chat is not side by side with code, the assistant will automatically create a new file and paste the snippet there.

This functionality makes it easy to test ideas, add new functions, or build out features with minimal friction.