GitBook for documentation
Tutorial on how to sync your repository with GitBook
Ria Choi

Documentation Is Hard Work

I used to write every document in Notion by hand.
Then I noticed something. If coding is 70% of my work, documenting is the other 30%.
That is a big share of team collaboration. Docs matter a lot. But they are also painful to write and maintain.
So I started looking for a way to automate it.
Why GitBook?
While Confluence, Jira and Notion are great tools and they work well for planners and designers, for developers, GitBook can be a better fit. Here is why.
- Your docs live in Git, right next to your code.
- You write in Markdown, which developers already know.
- Changes go through reviews, just like code.
- An AI agent can read and write the files directly.
GitBook is open to everyone. Anyone can sign up and try it.
I activated the 13 day free trial, and you can do the same.

What Is GitBook Good For?
GitBook turns your Markdown files into a clean documentation site.
It works well for:
- API documentation
- Internal team wikis
- Onboarding guides
- Product manuals
- Project handover notes

Part 1: Sign Up for GitBook
Getting started takes only a few minutes.
- Go to the GitBook website.
- Click Sign up.
- Sign in with your email, Google, or GitHub account.
- Create your organization.
Tip: Signing in with GitHub makes the later Git Sync step easier.
Part 2: Create Your First Space
A Space is one documentation project in GitBook.
- Click New space.
- Choose a name for your space.
- Pick a template, or start with a blank space.

Part 3: Connect Git Sync
This is the key step. Git Sync connects your GitBook space to a Git repository.
After this, your docs and your code live in the same place.
- Open your space.
- Click the Git Sync option in the space settings.
- Choose GitHub or GitLab.
- Authorize GitBook to access your account.
- Select the repository and the branch.
- Choose the sync direction.
Here are two ways to start.
- GitHub to GitBook: Your repository is the source. Good if you already have Markdown files.
- GitBook to GitHub: GitBook is the source. Good if you are starting from scratch.
Once connected, every change is synced between both sides.

Part 4: Ask an AI Agent to Build Your GitBook
Now comes the fun part.
Instead of writing docs by hand, let an AI agent do the work.
Open your repository with an AI coding agent. Then give it a clear request.
Here is a sample prompt:
Read this project and create documentation in Markdown. Include an overview, setup guide, API reference, and FAQ. Organize the files so they work with GitBook.
The agent reads your code. It then creates the Markdown files and the page structure.
GitBook uses a few simple files to organize your pages.
- SUMMARY.md controls the table of contents.
- .gitbook.yaml sets the root folder for your docs.
Commit and push the changes. Git Sync will bring them into GitBook.
You can also feed your agent this link that leads to a page where they explain how to configure the content.
https://gitbook.com/docs/docs-as-code/git-sync/content-configuration?utm_source=chatgpt.com


Tip: Review what the agent writes. AI is fast, but you know your project best.
Part 5: Publish Your Site
Your docs are now in GitBook. Time to share them.
- Open your space.
- Click Publish.
- Choose who can see it. You can make it public or limit access.
- Copy your site link.
- Optional: add a custom domain.
That is it. You now have a live documentation site.


The New Workflow
Here is the full flow in one view.
- Write code.
- Ask the AI agent to update the docs.
- Review the changes.
- Push to Git.
- GitBook syncs and publishes.
Docs now follow your code. You no longer need to write everything by hand.
Final Thoughts
Documentation will always matter. But it does not have to eat your time.
GitBook gives developers a home for docs that fits their workflow. An AI agent handles the heavy writing. You focus on the code and the review.
If you want to try it, start the free trial and connect your first repository. You may be surprised how much time you save.


