Skip to content

Start

Your first task

Open your server folder, pick Code mode, describe one change and approve the steps. A small change like this takes under a minute.

Before you start

  • The extension is installed and signed in. If not, see Install and sign in.
  • The folder you want to change is open in VS Code: File, Open Folder. That can be your whole server folder or one resource. Smaller is cheaper.
  • A copy or Git history of the folder, the first time you try it on files that matter.

The example below is a small QBCore server with a resource called sw-garages. The task: make the garage blips on the map yellow.

The six steps

  1. 1

    Open the SwisserAI panel

    Click the S icon in the activity bar. The chat opens with the task box at the bottom.

    1. 1. Type your task here...: describe what you want
    2. 2. Mode: Architect, Code, Ask, Debug
    3. 3. Auto-approve off: the agent asks before each step
  2. 2

    Switch to Code mode

    A new install starts in Architect mode, which plans but does not edit. Click the mode button under the task box and pick Code.

    1. 1. Code: pick this to change files
  3. 3

    Write the task

    Name the resource and say what should change. Press Enter to send.

    1. 1. In sw-garages, make the garage blips yellow.: name the resource
    2. 2. Code
  4. 4

    Approve what the agent wants to look at

    Before it reads a file or searches a folder, the agent asks. The request says exactly what it wants, here one file of sw-garages. Click Approve.

    1. 1. SwisserAI wants to ...: what the agent wants to do
    2. 2. Approve
    3. 3. Deny
  5. 5

    Check the change

    The proposed edit opens as a diff in the editor: the old line in red, the new one in green. You can still type into the right side if you want to adjust it. Save writes it, Deny drops it.

    1. 1. SwisserAI's Changes: red is removed, green is added
    2. 2. Save: writes the change to the file
    3. 3. Deny: drops it
  6. 6

    Read the summary

    When it is done, the agent writes what it changed. See New Changes shows the full diff, Restore Changes puts the files back the way they were. Start New Task clears the chat for the next job.

    1. 1. Task Completed: what the agent changed
    2. 2. Restore Changes: undo everything from this task
    3. 3. Start New Task

The whole task above took three to four requests, about 25 credits and under a minute. To use the change, restart the resource on your server, for example with ensure sw-garages in the server console.

refresh
ensure sw-garages

How to write a good task

The agent does what you write. The more exact the task, the fewer files it has to read and the fewer credits it uses.

  • change the garage blip

    In sw-garages, change the garage blip sprite to 357.
  • fix my script

    In sw-shops, the server console shows this error when I buy something: (paste the error). Find the cause.
  • add a feature to the HUD

    In sw-hud/html, add a stamina bar under the health bar, same style.
  • Name the resource, and the file if you know it.
  • Paste error messages exactly as the console shows them.
  • One change per task. Start a new task for the next topic.
  • Say your framework once in a rule instead of in every task.