> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/docs-as-code/guides.md).

# Guides

GitBook works with your existing tools and workflows. These guides help you use code and AI to build, maintain, and optimize documentation.

#### Explore

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-code-branch">:code-branch:</i></h4></td><td><h4>Import or migrate content with Git Sync</h4></td><td>Bring existing documentation into GitBook with Git Sync</td><td><a href="/spaces/LBGJKQic7BQYBXmVSjy0/pages/nE7HQxA8bhx2cDMqtwBa">/spaces/LBGJKQic7BQYBXmVSjy0/pages/nE7HQxA8bhx2cDMqtwBa</a></td></tr><tr><td><h4><i class="fa-pen-to-square">:pen-to-square:</i></h4></td><td><h4>Write documentation with AI</h4></td><td>Use GitBook Agent to create and maintain documentation</td><td><a href="/spaces/LBGJKQic7BQYBXmVSjy0/pages/lZib1r0W2EKSeHHGsXse">/spaces/LBGJKQic7BQYBXmVSjy0/pages/lZib1r0W2EKSeHHGsXse</a></td></tr><tr><td><h4><i class="fa-magnifying-glass-chart">:magnifying-glass-chart:</i></h4></td><td><h4>Optimize docs for AI search</h4></td><td>Prepare documentation for AI search and LLM ingestion</td><td><a href="/spaces/LBGJKQic7BQYBXmVSjy0/pages/0VDm6MCHnkOiY0UMgwUw">/spaces/LBGJKQic7BQYBXmVSjy0/pages/0VDm6MCHnkOiY0UMgwUw</a></td></tr><tr><td><h4><i class="fa-wand-magic-sparkles">:wand-magic-sparkles:</i></h4></td><td><h4>Streamline docs workflows with GitBook Agent</h4></td><td>Use GitBook Agent for updates, optimization, and bulk documentation tasks</td><td><a href="/spaces/LBGJKQic7BQYBXmVSjy0/pages/qFDlIyMYStBBWzAihxLv">/spaces/LBGJKQic7BQYBXmVSjy0/pages/qFDlIyMYStBBWzAihxLv</a></td></tr><tr><td><h4><i class="fa-terminal">:terminal:</i></h4></td><td><h4>Create and publish a site from the command line</h4></td><td>Use the GitBook CLI to create and publish a site</td><td><a href="/spaces/LBGJKQic7BQYBXmVSjy0/pages/zmpnDiKX098r2S6GXiyP">/spaces/LBGJKQic7BQYBXmVSjy0/pages/zmpnDiKX098r2S6GXiyP</a></td></tr></tbody></table>

#### Quick guides

<details>

<summary>Set up Git Sync for your repository</summary>

Git Sync keeps your GitHub or GitLab repository aligned with GitBook.

This guide covers selecting a provider, authorizing GitBook, and connecting your repository.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to setting up Git Sync for a GitHub or GitLab repository. Cover selecting a provider, authorizing GitBook, connecting the repository, and checking the first sync. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Connect a coding assistant with GitBook MCP</summary>

GitBook MCP gives compatible coding assistants access to your GitBook content.

This guide covers connecting the server, confirming access, and starting a documentation task.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to connecting a coding assistant to GitBook with GitBook MCP. Cover adding the MCP server, authenticating, confirming access, and starting a documentation task. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Run documentation workflows with the GitBook CLI</summary>

The GitBook CLI lets you work with content from your command line.

This guide covers signing in, querying content, and running documentation workflows.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to using the GitBook CLI for documentation workflows. Cover installing the CLI, signing in, querying content, and running a useful workflow. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>

<details>

<summary>Give coding assistants GitBook skills</summary>

Agent skills give coding assistants context about GitBook features and content blocks.

This guide covers adding the skills file and using it during documentation tasks.

<button type="button" class="button secondary" data-action="ask" data-query="Write a step-by-step guide to giving a coding assistant GitBook skills. Cover finding the skills file, adding it to the assistant&#x27;s context, and using it for a documentation task. Include links to the relevant docs pages." data-icon="gitbook-assistant">Open guide</button>

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/docs-as-code/guides.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
