Skip to content

Generate documentation from GitLab merge requests

Start documentation sessions without leaving GitLab. Mention @ekline-ai in a merge request comment followed by your request, and Docs Agent generates a documentation draft using the merge request as context.

Before you begin, you need:

  • An EkLine organization account with Docs Agent access.
  • GitLab connected to EkLine, with a token, your code and documentation projects selected, and the webhook configured. See Connect GitLab.
  • The webhook on your GitLab project sending Comments and Merge request events to EkLine. Docs Agent reads merge request comments through these events.

When you mention @ekline-ai in a merge request comment, Docs Agent:

  1. Adds a :eyes: reaction to your comment to confirm it received the request.
  2. Replies with a link to the EkLine editor where it drafts the documentation.
  3. Generates documentation based on your prompt and the merge request context.
  4. Opens a documentation merge request on your configured documentation project and updates its reply with the link.

Docs Agent posts its replies as standard notes rather than resolvable threads, so its status updates never block a “all threads resolved” merge check.

Trigger Docs Agent from a merge request comment

Section titled “Trigger Docs Agent from a merge request comment”
  1. Open a merge request on a GitLab project you connected to EkLine.

  2. Add a comment that mentions @ekline-ai followed by your documentation request.

    @ekline-ai Create a migration guide for the database schema changes in this merge request.
  3. Wait for the :eyes: reaction. Docs Agent adds it to your comment to confirm the request.

  4. Open the editor from the reply. Docs Agent replies with a link to the EkLine editor session where it drafts the documentation. Review and edit the draft there.

  5. Review the documentation merge request. When Docs Agent finishes, it opens a merge request on your configured documentation project and updates its reply with the link.

The quality of your prompt determines the quality of the output. Docs Agent strips the @ekline-ai mention and passes the rest of your comment as the prompt.

Instead of…Try…
“document this""Create an API reference for the new /users endpoint added in this merge request"
"update docs""Update the authentication guide to cover the OAuth flow changes in this merge request"
"help with docs""Write a migration guide for the breaking changes to the config schema”

Include specific details:

  • Name the type of documentation you need: API reference, migration guide, tutorial, how-to.
  • Reference specific files or changes in the merge request.
  • Mention existing documentation to update if applicable.
  • Give any audience context, such as whether it’s for developer docs or an end-user guide.

After Docs Agent creates a documentation merge request, mention @ekline-ai again to continue the conversation. You can comment on either the source merge request or the generated documentation merge request — Docs Agent resumes the existing session and keeps the context of the documentation it already produced.

Docs Agent reads each follow-up comment and decides whether you are asking a question or requesting a change:

  • Questions and clarifications — When you ask something like “Where did you get this URL?” or “Why did you change this section?”, Docs Agent replies with an answer. It does not edit files or push commits.
  • Change requests — When you ask for a documentation change, Docs Agent edits the docs and updates the linked documentation merge request with new commits. If no documentation merge request exists yet, it opens one.

Docs Agent recognizes GitLab merge request and issue links in your prompt and pulls their details from your connected projects. Reference another merge request or an issue to give Docs Agent more context:

@ekline-ai Document this endpoint and cross-check the request format against issue #215.

For the full list of what Docs Agent can reference, see Docs Agent integrations.

IssueSolution
Docs Agent does not respondConfirm GitLab is connected and the project is selected in your integration settings. Check that the webhook sends Comments and Merge request events, and that the webhook status is healthy in GitLab under Settings > Webhooks.
Reaction appears but no replyDocs Agent may still be processing. Wait up to a minute. If no reply appears, mention @ekline-ai again or contact support@ekline.io.
”Error” replyRead the error message for details. Confirm the GitLab token status shows Token is set and has not expired, then try again.
No documentation merge request createdDocs Agent opens a merge request when it produces file drafts. If your prompt is ambiguous, it may not produce files. Give a more specific prompt.
Docs Agent responds to the wrong personDocs Agent responds to any comment that mentions @ekline-ai. Each mention triggers or resumes a session.
  • Connect GitLab — Add a token, select projects, and configure the webhook.
  • GitHub PR bot — Trigger Docs Agent from GitHub pull requests.
  • Create documentation — Generate documentation from your codebase, videos, and external sources.
  • Integrations — Connect Slack, Notion, Jira, and other tools for richer context.

Reply to your welcome email or contact support@ekline.io. We read every message.