ServiceDesk4u VS Code extension
Generates step-by-step testing guides from your code and saves them to ServiceDesk4u as drafts. A project lead reviews and publishes each guide; testers then follow it in ServiceDesk4u and tick off each step.
Status: working first version: sidebar, sign-in, agent loop and CLI. Not yet on the Marketplace.
How it works
- You ask for a guide: "Testing guide for community contacts, from login to the end".
- The agent runs in steps. ServiceDesk4u's AI picks the next action. This package carries it out on your machine, read-only: list a folder, read part of a file, or search. The result goes back with the next step.
- The agent writes the guide in parts (overview, then one section at a time). ServiceDesk4u checks each part as it arrives.
- When the agent finishes, the guide is saved to your ServiceDesk4u project as a draft.
The model calls go through your ServiceDesk4u server, so the organisation's AI keys, token balances and usage log apply. Admins can pin a model to the feature under Settings → AI (Testing guide generator). Every step uses tokens, and one guide takes many steps, so give the people who use it a healthy balance.
What leaves your machine
Only what the agent reads (capped at 300 lines per read) and search results. The list of files sent is printed at the end and stored on the guide.
The rules are enforced in src/agent/tools.ts, not in the prompt:
- Nothing outside the repository root.
- Secrets are never read:
.env*, env.yaml, keys and certificates, .npmrc, credential and service-account files, production appsettings, Terraform state. *.example/*.sample files are allowed.
node_modules, .git, build output, bin/obj and similar folders are skipped.
Using it in VS Code
- Click the ServiceDesk4u icon in the activity bar.
- Sign in to ServiceDesk4u with your email and password. Tokens go in VS Code's secret storage (your OS keychain). Accounts that only use Google sign-in can't sign in here yet.
- Pick the ServiceDesk4u project, say what the guide should cover, and click Generate guide.
- The first time for each folder, VS Code asks you to confirm that code excerpts may be sent.
- Watch the steps. Stop cancels after the current step.
- When it's saved, click Open in ServiceDesk4u to review and publish the draft. Files sent lists every file the agent read; click one to open it.
If ServiceDesk4u refuses a part of the guide, the AI is told what was wrong and fixes it. If a few problems are still left after its tries, the extension shortens or removes just those parts (a step line, a step, a section) and saves the rest. The panel lists what it changed so you can check the draft. If the guide still can't be saved, it is kept as a JSON file on your computer (the panel shows the path and an Open saved guide button; from the terminal it is written to the current folder as servicedesk4u-draft-<time>.json) instead of being thrown away.
Settings (Settings → ServiceDesk4u):
| Setting |
Default |
|
servicedesk4u.environment |
production |
production or test (see below) |
servicedesk4u.apiUrl |
https://testmate-api-drd1.onrender.com |
Production API address |
servicedesk4u.appUrl |
https://www.servicedesk4u.com |
Production web app, for Open in ServiceDesk4u |
servicedesk4u.test.apiUrl |
http://localhost:4000 |
Test environment API address |
servicedesk4u.test.appUrl |
http://localhost:5173 |
Test environment web app |
servicedesk4u.maxSteps |
40 |
Most steps per guide (5–80) |
Commands: ServiceDesk4u: Generate testing guide, Stop generating, Sign in, Sign out, Switch environment, Show log (every step is also written to the ServiceDesk4u output channel).
Using a test environment
To try the extension against a test server instead of production:
- Run ServiceDesk4u: Switch environment and choose Test, or set
servicedesk4u.environment to test. Point servicedesk4u.test.apiUrl and servicedesk4u.test.appUrl at your test server and web app (they default to http://localhost:4000 and http://localhost:5173).
- While the test environment is in use, the status bar shows ServiceDesk4u: TEST and the panel shows a TEST badge with the server address.
- Sign-in is kept separately for each address: sign in again after switching, and a production sign-in is never sent to the test server.
- When developing the extension, press F5 on Run ServiceDesk4u extension (test environment). It sets
SERVICEDESK4U_ENV=test for that window, which overrides the setting.
- A VSIX is not tied to either: it uses whichever environment is chosen in the settings.
Keeping guides up to date
Every generated guide remembers the commit it was written from. In the panel,
Check guides for code changes (also in the command palette) compares that
commit with your code now (git diff, read-only) and sends ServiceDesk4u the
list of changed file paths, never their contents. ServiceDesk4u marks the
steps that point at those files as "may be outdated".
Refresh this guide then reads the changed files and rewrites only the
sections that changed, keeping the ids of steps that still exist so testers'
ticks stay. If you can't edit that guide (it's published and you aren't the
project lead), the refreshed version is saved as a new draft instead.
From a terminal:
npm run guide -- --project <projectId> --root ../my-app --check-drift
npm run guide -- --project <projectId> --root ../my-app --refresh <guideId>
Needs git on your PATH and the guide's commit in your clone.
Covering more in a guide
A guide rarely covers everything the first time. In the panel, click
Extend next to a guide, say what else it should cover ("also bulk import,
and what each role sees on the Activity log"), and the AI reads the guide and
the code for those areas and adds new sections. Existing steps, ids and testers'
ticks stay as they are. From a terminal:
npm run guide -- --project <projectId> --root ../my-app --extend <guideId> --request "Also cover bulk import"
You need the right to edit the guide (project lead, or its author while it's
a draft). Without it, the extended version is saved as a new draft.
Develop and install
cd vscode-extension
npm install
npm run build # bundles to dist/extension.js
- Debug: open
vscode-extension/ in VS Code and press F5. A second VS Code window opens with the extension loaded.
- Install locally / share a beta: run
npm run package to build servicedesk4u-vscode-0.1.0.vsix. Install it with Extensions → … → Install from VSIX.
- Publish: create a Marketplace publisher and set
publisher in package.json to match. Add a 128×128 PNG icon, a repository and a LICENSE. Then run npx vsce publish, and npx ovsx publish for Open VSX (Cursor, Windsurf, VSCodium).
Run it from a terminal (CLI)
cd vscode-extension
npm install
SERVICEDESK4U_API_URL=https://your-api.example.com \
SERVICEDESK4U_EMAIL=you@company.com SERVICEDESK4U_PASSWORD='…' \
npm run guide -- --project <projectId> --root ../path/to/your/app \
--request "Testing guide for <feature>, from login to the end"
You can also sign in with SERVICEDESK4U_TOKEN (and optionally SERVICEDESK4U_REFRESH_TOKEN) instead of email and password. The project ID is shown on the project page in ServiceDesk4u. Use --max-steps (default 40, max 80) for big features.
Requirements:
- The account needs the Use AI permission and must be a lead or member of the project.
- The organisation (or the user) needs an AI key configured in ServiceDesk4u.
Layout
| Path |
What |
src/agent/tools.ts |
Read-only file tools, sandbox and secret deny list |
src/agent/loop.ts |
The agent loop: steps, history compaction, assembling and saving the guide |
src/api/servicedesk4uClient.ts |
ServiceDesk4u API client (sign-in, refresh, agent step, save guide) |
src/cli.ts |
Terminal runner |
src/extension.ts |
VS Code entry point: commands and the sidebar |
src/vscode/auth.ts |
Sign-in; tokens in SecretStorage |
src/vscode/guidePanel.ts |
The sidebar: consent, running the agent, progress, result |
media/panel.js, media/panel.css |
The sidebar's UI (plain DOM, themed with VS Code's colours) |
Server side: server/modules/testGuide/domain/guideAgentPrompt.ts (system prompt and step format), services/guideAgent.service.ts, route POST /api/v1/test-guides/agent/step.