glasscms

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2025 License: GPL-2.0 Imports: 2 Imported by: 0

README

GlassCMS

A headless CMS powered by markdown that seamlessly turns your markdown files into a REST API.

Features

  • Markdown-based Content: Transform your existing markdown files into a headless CMS
  • REST API: Access your content via a clean REST API
  • Authentication: Built-in token-based authentication system
  • File System Integration: Sync content directly from your file system
  • Database Support: PostgreSQL and SQLite support
  • OpenAPI Specification: Well-documented API with OpenAPI 3.0
  • CLI Interface: Comprehensive command-line interface for management

Installation

go install github.com/glass-cms/glasscms@latest

Quick Start

  1. Initialize authentication:

    glasscms auth init
    
  2. Start the server:

    glasscms server start
    
  3. Sync your markdown files:

    glasscms sync --path /path/to/your/markdown/files
    

Commands

  • glasscms auth init - Initialize authentication system
  • glasscms server start - Start the API server
  • glasscms sync - Sync markdown files to the database
  • glasscms convert - Convert between different formats
  • glasscms migrate - Run database migrations
  • glasscms docs - Generate documentation

Configuration

GlassCMS can be configured via:

  • Configuration file (config.yaml)
  • Environment variables (prefixed with GLASS_)
  • Command-line flags
Environment Variables
  • GLASS_LOG_LEVEL - Log level (default: INFO)
  • GLASS_LOG_FORMAT - Log format (default: TEXT)
  • GLASS_VERBOSE - Enable verbose output

API

The API follows REST conventions and provides endpoints for:

  • Items: Manage content items (/items)
  • Authentication: Token-based authentication

See the OpenAPI specification in openapi.yaml for complete API documentation.

Development

Prerequisites
  • Go 1.23+
  • Task runner (optional)
Building
# Using Go
go build -o glasscms

# Using Task
task build
Testing
# Run tests
task test

# Run tests with coverage
task coverage
Linting
# Run linter
task lint

# Fix linting issues
task lint-fix

Database

GlassCMS supports:

  • PostgreSQL
  • SQLite

Migrations are managed automatically via the migrate command.

License

See LICENSE.md for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
server/middleware
Package middleware contains application specific middleware.
Package middleware contains application specific middleware.
sourcer
Package sourcer provides abstractions for accessing various data repositories in an iterative manner.
Package sourcer provides abstractions for accessing various data repositories in an iterative manner.
sync
Package sync provides a way to synchronize items from a source to the server.
Package sync provides a way to synchronize items from a source to the server.
pkg
api
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.
log
mediatype
Package mediatype provides types, constant and parsing functions for media types (MIME).
Package mediatype provides types, constant and parsing functions for media types (MIME).
wikilink
Package wikilinks provides functionality for parsing and processing WikiLinks in markdown content.
Package wikilinks provides functionality for parsing and processing WikiLinks in markdown content.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL