Capturing and putting objects, getting changes, connecting a database, version history, repository administration.
The 1C configuration repository, not a Git repository.
Usage
/db-repo lock [database] -Objects "Справочник.Номенклатура"
/db-repo commit [database] -Objects "Справочник.Номенклатура" -Comment "Добавлен Артикул"
/db-repo unlock [database] -Objects "Справочник.Номенклатура"
/db-repo update [database]
Workflow
Into a database connected to the repository, sources are loaded only partially и only for captured objects. Follow strictly step by step:
0. /db-repo update <база> — начать с актуального состояния
1. /db-repo lock <база> -Objects "Справочник.Номенклатура"
2. если шаг 0 или 1 напечатал «локальная конфигурация изменена, получено объектов из хранилища: N» —
выгрузи названные объекты: /db-dump-xml <база> <каталог> -Mode Partial -ObjectsFile "<файл из вывода>"
3. правки в исходниках: /meta-edit, /form-edit, /skd-edit, /meta-compile и т. д.
4. /db-load-xml <каталог> <база> -Mode Partial -Files "Catalogs/Номенклатура.xml,…" -UpdateDB
5. /db-repo commit <база> -Objects "Справочник.Номенклатура" -Comment "…"
Step 0 should always be done when work is not continuing immediately after the previous cycle: edits must be based on the current state — including those objects that you do not change but use.
Step 2 cannot be skipped: capture and update pull fresh versions from the repository, and loading sources taken earlier will roll back others' changes — silently, without an error.
What is captured at all. Individual repository objects — the object itself, as well as its forms, templates and commands. Attributes, tabular sections, dimensions and resources are not separate objects are not: they are edited as part of the owner.
| What you edit | What to capture |
|---|---|
| Attribute, tabular section, dimension, resource, object module | the object itself: Справочник.Контрагенты |
| Existing form, template, command | it itself: Справочник.Контрагенты.Форма.ФормаЭлемента |
| Adding a new form, template, command | the owner object; when putting, name the new object too |
| Adding a new configuration object | only the root: Конфигурация. The object itself does not exist yet — it cannot be captured; when putting, name it too |
Capture the minimum of what you edit: the wider the capture, the more conflicts with colleagues.
Capturing an object does not capture its forms and templates — for that there is -WithChildren.
Connection parameters
Read .v8-project.json from the project root and resolve the base:
- If the user specified connection parameters — use them directly
- If the base was specified by name — search by id / alias / name
- If not specified — match the current Git branch with
databases[].branches - If the branch did not match — use
default
Platform — v8path of the found base record, otherwise the root v8path. Not set in either place — -V8Path do not pass.
Storage credentials do not need to be passed: the base record is found by the passed connection
parameters (-InfoBasePath or -InfoBaseServer + -InfoBaseRef), credentials are taken from its
repository. They can be set explicitly with the parameters -Repository*.
Command
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command <подкоманда> <параметры>
Work cycle
| Subcommand | What it does |
|---|---|
lock |
Capture objects |
unlock |
Cancel capture |
commit |
Put changes into storage |
update |
Get changes from storage |
Parameters
| Parameter | Required | Description |
|---|---|---|
-InfoBasePath <путь> |
* | File base |
-InfoBaseServer <сервер> |
* | 1C server |
-InfoBaseRef <имя> |
* | Base name on the server |
-UserName <имя> |
no | Base user |
-Password <пароль> |
no | Base user password |
-Objects <список> |
cond. | Objects separated by commas. For lock, unlock, commit required if not set -All |
-ObjectsFile <путь> |
no | File with a list of objects, one name per line |
-All |
no | Operation on the entire configuration — instead of -Objects, and not together with it |
-WithChildren |
no | Together with subordinate objects to full depth |
-Comment <текст> |
no | Comment for the put (commit). Multiline — as is, with line breaks |
-KeepLocked |
no | Leave objects captured after the put |
-Revised |
no | Get captured objects if needed |
-Force |
no | Miscellaneous per subcommand — see below |
-Extension <имя> |
no | Work with the extension storage |
-RepositoryPath <путь> |
no | Storage explicitly, instead of the registry |
-RepositoryUser <имя> |
no | Storage user explicitly |
-RepositoryPassword <пароль> |
no | Storage user password explicitly |
-AdditionalV8Arguments <список> |
no | Additional arguments 1cv8.exe separated by commas |
*— either-InfoBasePath, or the pair-InfoBaseServer+-InfoBaseRef
-Force
| Subcommand | What it does |
|---|---|
unlock |
Loses local edits: objects are overwritten by the version from the storage |
commit |
Tries to clear references to deleted objects instead of erroring |
update |
Confirms the addition and removal of configuration objects |
Object names
Object — Справочник.Номенклатура. Form, layout, command — by full path:
Документ.ЗаказПокупателя.Форма.ФормаДокумента, Справочник.Номенклатура.Макет.Печать.
Configuration root — Конфигурация.
If an object is "not found", it is not always a typo: it may have appeared in the storage later than
the base was updated (/db-repo update), or it is not a storage object at all — an attribute or
a tabular section.
Result
A zero code does not mean that something changed. Under zero come "already captured", "nothing to update", "nothing to place" and partial capture — when some objects are occupied by others, and the rest are captured and can be edited.
Read the output text, not just the code. The same place also provides the list of objects received from the storage, which requires re-uploading before editing.
Require user confirmation
Before these operations ask for confirmation:
| Operation | Why |
|---|---|
lock -All |
Captures the entire configuration: on a large base it takes a long time and blocks work for the whole team |
unlock -Force |
Local edits of captured objects are lost |
disconnect |
The base's connection to the storage is lost, including on the storage side |
connect -ForceReplaceCfg |
The base configuration is replaced by the configuration from the storage |
update will not be executed if the base does not have declared in the registry repository, but the credentials are not specified
explicitly: on a database not connected to the repository, this command replaces the entire configuration with its contents and
reports success.
Extensions
An extension has its own repository with its own path. Specify -Extension "<Имя>" — the credentials will be taken from
extensions[].repository database entries. The subcommands work the same for the main configuration and
for an extension.
Other tasks
| File | What it is about |
|---|---|
| connect.md | Connecting and disconnecting the database from the repository |
| history.md | Version history, report, dumping a version to CF |
| admin.md | Creating a repository, users and rights |
| service.md | Version labels, optimization, cache cleanup |
Examples
# Захватить справочник вместе с подчинёнными объектами
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command lock -InfoBasePath "C:\Bases\MyDB" -Objects "Справочник.Номенклатура" -WithChildren
# Захватить корень — он нужен, чтобы добавить или удалить объект конфигурации
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command lock -InfoBasePath "C:\Bases\MyDB" -Objects "Конфигурация"
# Поместить новый объект: он уже существует, поэтому называется вместе с корнем
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command commit -InfoBasePath "C:\Bases\MyDB" -Objects "Конфигурация,Справочник.Склады" -Comment "Добавлен справочник Склады"
# Поместить с комментарием, оставив захват
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command commit -InfoBasePath "C:\Bases\MyDB" -Objects "Справочник.Номенклатура" -Comment "Добавлен реквизит Артикул" -KeepLocked
# Получить изменения из хранилища
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command update -InfoBasePath "C:\Bases\MyDB"
# Серверная база, расширение
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/db-repo.ps1" -Command lock -InfoBaseServer "srv01" -InfoBaseRef "MyApp_Dev" -UserName "Admin" -Extension "МоёРасширение" -Objects "Справочник.Номенклатура"
After execution
lockorupdatereported the received objects — run/db-dump-xml -Mode Partialwith the file specified in the output, and only then edit the sources- after
lockedits go through/db-load-xml -Mode Partialи/db-update - changes are ready — suggest
/db-repo commitwith a comment