Skip to content

docs: add comprehensive API documentation for programmatic usage#321

Open
MichaelKreil wants to merge 1 commit intoeXist-db:mainfrom
MichaelKreil:docs/add-api-documentation
Open

docs: add comprehensive API documentation for programmatic usage#321
MichaelKreil wants to merge 1 commit intoeXist-db:mainfrom
MichaelKreil:docs/add-api-documentation

Conversation

@MichaelKreil
Copy link

Summary

  • Added comprehensive API documentation in API.md for developers who want to use xst programmatically in their Node.js applications
  • Updated README.md to include a "Programmatic Usage" section linking to the new API documentation
  • Provides complete examples for all commands (upload, get, list, exec, rm, edit, info, package management)
  • Includes utility function documentation, TypeScript support guide, and best practices

What's Included

New File: API.md

A comprehensive 800+ line API documentation covering:

  • Quick Start - Get up and running quickly
  • Connection Configuration - 4 different ways to configure database connections (programmatic, environment variables, config files, utilities)
  • Command API Reference - Full documentation for all 8 commands with parameters and examples
  • Utility Functions - Documentation for connection, error handling, messaging, sizing, versioning, and glob utilities
  • TypeScript Support - How to use JSDoc types with TypeScript
  • Examples - 5 complete real-world examples:
    • Complete upload workflow with admin verification
    • Backup and restore operations
    • Bulk operations (cleanup old files)
    • Package management automation
    • Best practices
  • Best Practices - Production-ready guidelines

Updated: README.md

  • Added "Programmatic Usage" section between the command table and CLI examples
  • Includes a quick example showing how easy it is to use xst as a library
  • Links to the comprehensive API documentation

Motivation

This addresses issue #5 from the improvement recommendations - adding API documentation for programmatic usage. While xst works great as a CLI tool, it can also be used as a library for automation, CI/CD pipelines, backup scripts, and other Node.js applications. This documentation makes that use case accessible to developers.

Test Plan

  • Verify API.md renders correctly on GitHub
  • Check that all code examples use correct syntax
  • Confirm README.md link to API.md works
  • Review that examples align with actual command signatures
  • Validate TypeScript type references are accurate

🤖 Generated with Claude Code

@MichaelKreil MichaelKreil requested a review from a team as a code owner December 26, 2025 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant