How bastienbyra/doccli works
Project type and purpose
• DocCLI is a Python-based command-line interface (CLI) tool for reading documents hosted locally (OS filesystem) or remotely (e.g., Git repositories).
• It supports three operating modes:
• client-server (both a CLI client and an HTTP server in one process)
• client (CLI issues HTTP requests to a remote DocCLI server)
• server (HTTP server that retrieves files locally or from Git)
File structure
• Top level:
• scripts/ – install scripts for Unix and Windows
• Makefile, CI workflows, linting, versioning, .gitignore, LICENSE
• doccli/ – the entire Python application
• Inside doccli/doccli/:
• entrypoints/ – CLI and server entrypoints
• commands/ – command implementations (e.g., search)
• services/ – core application logic (file_service, git_service)
• services/file_readers/ – adapters for each document type (pdf, word, excel, default text)
• configs/ – configuration abstractions per source (OS, Git, base)
• models/ – data models for directory contents, file contents, search results
• validators/ – input validation logic
• helpers/ and enums/ – utilities and enumerations
• Configuration: environment variables (DOCCLI_MODE, DOCCLI_SOURCE, etc.) control behavior
• Build/deps: pyproject.toml, mypy, lockfiles
Key insights from README
• Primary feature is the search command (view file or directory contents in a terminal UI)
• Pluggable “storage backends” (OS vs Git now, future S3/SharePoint/OneDrive)
• Three operating modes: CLI-only, server-only, and hybrid
• No database—files are read directly or via git clone
Detail
• Environment‐variable configuration branching