Cursor for 1C: writing BSL code with an AI agent
How to open a 1C configuration dump in Cursor, write rules for BSL, give the agent metadata and avoid accepting invented code. With a session cost estimate.
6 min · · IDE · development
Cursor for 1C works, but not out of the box: the editor does not know your configuration, and the built-in 1C language is far less widespread than Python or JavaScript, so do not count on the model knowing the platform well. If you open a configuration dump in Cursor, write rules for BSL and teach the agent to consult metadata, it becomes a working helper for typical changes. Below, step by step: how to prepare the project, what to put in the rules, how to verify the result and what a session costs on your own key.
The principles of prompting a model (what to pass, how to phrase) are covered in the article on integrating AI into 1C. Here the topic is working inside the editor with a project.
Cursor AI for 1C, step 1: dump the configuration to files
The agent works with project files, so the configuration must become a directory tree. There are two common ways:
- Configurator. The configuration menu has an item for dumping the configuration to files, and the Configurator's batch launch mode has a matching parameter. Check the exact name and parameters in the help of your platform version.
- 1C:Enterprise Development Tools (EDT). An EDT project is already stored as a set of files, and you can open it in Cursor as a regular folder.
The dump contains .bsl modules and XML descriptions of metadata objects: catalogs, documents, registers, forms. The XML gives the agent real attribute and dimension names, so do not exclude it from the index.
Check two things right away. First, encoding: 1C modules from a dump are usually stored as UTF-8 with BOM, and an editor or agent that saves a file without it may break the file for loading back. Test how your setup behaves on one file. Second, size: a large standard configuration can contain tens of thousands of files. Open in Cursor not the whole tree but the subsystem slice you need, or exclude the rest in .cursorignore (same format as .gitignore).
Step 2. Write rules for BSL
Rules are a file that Cursor mixes into the agent's context. The current format lives in the .cursor/rules directory and is covered in the article how to write Cursor rules. An example for 1C:
---
description: Rules for working with 1C (BSL) code
globs: **/*.bsl
alwaysApply: false
---
- Language: the built-in 1C:Enterprise language, platform 8.3.
- Before writing code, find the XML description of the metadata object in the
project and use only attributes, dimensions and resources that really exist.
- If an attribute is not in the XML, do not invent it: ask a question.
- Respect compilation directives: &AtClient, &AtServer, &AtServerNoContext.
Do not call server procedures from client code without passing data explicitly.
- Write queries in the 1C query language, with parameters (&Parameter), no string concatenation.
- No query inside a loop. Collect data with one query.
- Copy style and naming from neighbouring procedures in the same module.
- Do not touch blocks marked "Do not modify".Keep rules short. Every line spends tokens on every agent request, and a long wall of text is followed worse than three clear points. If your team has a development standard, put a reference to it in a separate file and attach it when needed.
Step 3. Working with the agent in the project
A working order that reduces invented code:
- Open the module you need and explicitly add the module file and the object's XML to context via
@in Cursor's chat. Do not count on the agent finding everything itself. - Phrase the task with boundaries. For example: "in the posting handler of the document SalesOfGoods add a stock check against the register GoodsInWarehouses; change nothing else".
- Ask for a plan first, then code. You read the plan in half a minute and wrong assumptions are visible before edits.
- Review the diff. Accept changes one fragment at a time.
- Do not assign several objects in one request. Split by module.
For questions like "where in the configuration is this register used" a question mode without edits fits. For changes use the agent, but with manual confirmation.
Step 4. How to verify 1C code
Plausible BSL code is not necessarily working code. Minimum checks:
- Platform syntax check. Load the changes into a test database and run the configuration check.
- Static analysis. Third-party analyzers exist for BSL, for example BSL Language Server and plugins for SonarQube. Connect them in CI or locally and give the agent the analyzer output to fix. See those projects' documentation for setup.
- Manual query check. Run the query text in the query console on test data.
- Test database. Any changes go there first, never straight into a production database.
- Review. Agent code goes through the same review as yours.
Typical model mistakes in 1C: non-existent platform methods, mixed-up client/server contexts, queries in loops, dot access to attributes in a query without a join. It is convenient to add them to the rules as you meet them.
Step 5. Connect your own key
Your own API key is set in Cursor's model settings. The order, per the Zukko documentation: create a key in the Zukko dashboard, in Cursor settings enable your own OpenAI key, paste fetch_..., turn on the Base URL override with https://api.zukko.pro/v1, add a model name such as cursor-sonnet-5 (the second name of claude-sonnet-5, because Cursor does not accept names it already knows; the list of second names is in the Zukko documentation) and press verify. Which items and plans are available depends on your Cursor version and plan; check subscription prices on the service's site. Step-by-step instructions are in the Cursor documentation, and if the editor does not see models, the article Cursor does not see models after changing the base URL will help.
What a session costs
Formula: input × input price + output × output price, at Zukko prices as of October 18, 2026. Assumptions: a session of 30 agent requests, each with about 40,000 input tokens (rules, open files, history) and 1,500 output tokens. Cursor works over the OpenAI format, so the gateway does not see the Claude cache discount and all input is billed at the input price: this is an upper estimate.
| Model | Price in / out, $ per 1M | Calculation | Total |
|---|---|---|---|
claude-sonnet-5-5 | 0.4 / 2 | 1,200,000 × 0.4 + 45,000 × 2 | $0.57 |
gpt-6.1-sol | 0.27 / 1.32 | 1,200,000 × 0.27 + 45,000 × 1.32 | $0.38 |
glm-5.3-flash | 0.04 / 0.04 | (1,200,000 + 45,000) × 0.04 | $0.05 |
All values are divided by 1,000,000. glm-5.3-flash has a 128K context, which may not suffice for large modules and long history; the other rows have 1M. For GPT models cache reads are visible in the OpenAI format too, so the real total may be lower. Which model copes better with BSL cannot be told by numbers: take three typical tasks and run each. Check current prices in GET https://api.zukko.pro/v1/models.
FAQ
Does Cursor know the 1C language?
Models know it unevenly. That is why you need metadata in the project, rules and platform verification.
Cursor AI and 1C: can I work with a configuration directly from the database?
The agent works with files. Dump the configuration to files or keep the project in EDT, then load changes back with the platform's standard tools.
Is it safe to give configuration code to a model?
The code goes to the model provider. Exclude secrets and customer data from the index (.cursorignore), agree on the policy with the code owner and read the providers' terms.
Can I use Cursor without a subscription?
Capabilities depend on your Cursor plan. Check current terms on the service's site.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- A neural network for Lua and Roblox: writing Luau scripts with AIWithout guidance a model may confuse Lua with Luau and suggest outdated Roblox APIs. How to phrase the task, check the code and connect an agent to your project.
- How to connect Qwen to VS Code: Companion, Cline and ContinueTwo ways to get Qwen in your editor: the official Companion for Qwen Code, or the Cline, Kilo Code and Continue extensions with an OpenAI-compatible key.
- Claude Code in JetBrains: IntelliJ IDEA and PyCharm on Your Own KeyThe plugin does not bundle Claude Code. It launches the console agent in the IDE terminal. Install, gateway key, diffs and common failures explained.
- Cursor AI setup: models, your own key, rules and indexingA step-by-step Cursor setup: your own key with the gateway address, models, project rules, context exclusions and a connection check. What to do on day one.