API Reference

This page provides links to the Go package documentation for apt-bundle.

Package Documentation

The complete API documentation is automatically generated and hosted on pkg.go.dev:

View apt-bundle packages on pkg.go.dev

Package Structure

Main Package

Internal Packages

Key Types and Functions

Aptfile Parsing

The internal/aptfile package provides:

Command Execution

The internal/commands package implements:

APT Integration

The internal/apt package provides:

CLI Framework

apt-bundle uses Cobra for CLI parsing:

Example Usage (Programmatic)

While apt-bundle is primarily a CLI tool, the internal packages can be used programmatically:

import (
    "github.com/apt-bundle/apt-bundle/internal/aptfile"
    "github.com/apt-bundle/apt-bundle/internal/apt"
)

// Parse an Aptfile
parser := aptfile.NewParser()
directives, err := parser.ParseFile("Aptfile")

// Check if a package is installed
installed, err := apt.IsPackageInstalled("vim")

// Add a PPA
err := apt.AddPPA("ppa:ondrej/php")

Note: The internal packages are not part of the public API and may change without notice. For programmatic use, consider opening an issue to discuss a stable API.

Documentation Standards

Generating Documentation Locally

To generate documentation locally:

# Install godoc
go install golang.org/x/tools/cmd/godoc@latest

# Run local documentation server
godoc -http=:6060

# View at http://localhost:6060/pkg/github.com/apt-bundle/apt-bundle/