> 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.md).

# Docs as code

- [GitHub & GitLab Sync](https://gitbook.com/docs/docs-as-code/git-sync.md): Synchronize your GitBook docs with GitHub or GitLab with GitBook’s bi-directional integration
- [Enabling GitHub Sync](https://gitbook.com/docs/docs-as-code/git-sync/enabling-github-sync.md): Sync your GitHub repo with GitBook
- [Enabling GitLab Sync](https://gitbook.com/docs/docs-as-code/git-sync/enabling-gitlab-sync.md): Sync your GitLab repo with GitBook
- [Content configuration](https://gitbook.com/docs/docs-as-code/git-sync/content-configuration.md): Configure Git Sync through code
- [GitHub pull request preview](https://gitbook.com/docs/docs-as-code/git-sync/github-pull-request-preview.md): See a preview of your content when making a pull request in GitHub
- [Commit messages & Autolink](https://gitbook.com/docs/docs-as-code/git-sync/commits.md)
- [Monorepos](https://gitbook.com/docs/docs-as-code/git-sync/monorepos.md): Use Git Sync with monorepos and map spaces to separate directories
- [Troubleshooting](https://gitbook.com/docs/docs-as-code/git-sync/troubleshooting.md): Resolve common Git Sync, repository, redirects, and sign-in issues
- [GitBook MCP](https://gitbook.com/docs/docs-as-code/gitbook-mcp.md): Connect AI coding assistants to GitBook so they can create sites, open change requests, and edit content through GitBook’s API
- [GitBook CLI](https://gitbook.com/docs/docs-as-code/gitbook-cli.md): Work with your GitBook content from the command line — sign in, query the API, and drive docs workflows from scripts or AI coding agents.
- [Agent skills](https://gitbook.com/docs/docs-as-code/ai-coding-assistants-and-skillmd.md): Use GitBook’s official SKILL.md file to give AI coding assistants like Claude Code, Cursor or Codex knowledge of GitBook’s features and blocks
- [Guides](https://gitbook.com/docs/docs-as-code/guides.md): Explore guides for docs-as-code workflows, GitBook Agent, and AI-ready documentation


---

# 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.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.
