Artifact 0765ce031ba0529b49b372dea67e9d9b51b5ec7442646be8266f9a7b49cb45cb:
- File
docs/site/content/docs/get-started/quickstart.md
— part of check-in
[93ad669695]
at
2026-10-23 20:53:50
on branch main
— docs: reorganise into get-started, concepts, guides, reference
Move the flat docs pages into sections, keep each old URL as an alias, split sparse cones from horizons, and add concept pages for artifacts, repository state, sync, sub-manifests and signing plus a settings reference. Audit the moved pages against the code and fix drift. (user: [email protected], size: 2302) [annotate] [blame] [check-ins using]
title: Quickstart weight: 20
aliases: ["/docs/quickstart/"]
A five-minute tour of libfossil: clone a repo and read its history from Go.
Install
go install github.com/danmestas/go-libfossil/cmd/libfossil@latest
libfossil --help
The binary is pure-Go and CGo-free — drop it on any host.
Clone a repository
Clone using the Go API:
package main
import (
"context"
"log"
"github.com/danmestas/go-libfossil"
)
func main() {
t := libfossil.NewHTTPTransport("https://example.com/repo.fossil")
repo, _, err := libfossil.Clone(context.Background(), "./repo.fossil", t, libfossil.CloneOpts{})
if err != nil {
log.Fatal(err)
}
defer repo.Close()
}
Open from Go
After cloning (above), open the same .fossil file from Go and read its history:
package main
import (
"fmt"
"log"
"github.com/danmestas/go-libfossil"
)
func main() {
repo, err := libfossil.Open("repo.fossil")
if err != nil {
log.Fatal(err)
}
defer repo.Close()
entries, err := repo.Timeline(libfossil.TimelineOpts{Limit: 10})
if err != nil {
log.Fatal(err)
}
for _, e := range entries {
fmt.Println(e.UUID, e.Comment)
}
}
Sync over HTTP
package main
import (
"context"
"log"
"github.com/danmestas/go-libfossil"
)
func main() {
repo, err := libfossil.Open("repo.fossil")
if err != nil {
log.Fatal(err)
}
defer repo.Close()
t := libfossil.NewHTTPTransport("https://example.com/repo.fossil")
if _, err := repo.Sync(context.Background(), t, libfossil.SyncOpts{Pull: true}); err != nil {
log.Fatal(err)
}
}
Or use the simpler Pull wrapper for pull-only workflows:
_, err := repo.Pull(context.Background(), "https://example.com/repo.fossil", libfossil.PullOpts{})
Next steps
- Architecture — how the pieces fit
- Production patterns — error handling, context, telemetry beyond
log.Fatal - Extension Points — observers for telemetry, custom SQLite drivers
- Migration from Fossil — command mapping from upstream
- SDK reference — every package, every exported symbol