Skip to main content

Project Structure

An overview of the Citadel CLI repository layout, key files, and internal package responsibilities.

Top-Level Directories

DirectoryDescription
cmd/Cobra command implementations (one file per command: init.go, work.go, status.go, etc.)
internal/Private Go packages (see Internal Packages below)
services/Embedded Docker Compose files for inference engines (vllm.yml, ollama.yml, etc.)
e2e/End-to-end integration tests
tests/Integration test scripts
scripts/Build, release, and testing scripts
packaging/Platform-specific packaging (macOS app bundle)
homebrew-tap/Homebrew formula
.winget/Windows Package Manager manifest
docs/Technical documentation
docs-site/Docusaurus documentation site (this site)

Key Files

FilePurpose
main.goProgram entry point; calls cmd.Execute()
cmd/root.goRoot Cobra command, global flags, and initialization
cmd/version.goVersion variable, injected via ldflags at build time
services/embed.gogo:embed directives that bundle compose files into the binary
cmd/manifest.goCitadelManifest struct and manifest discovery logic
internal/worker/handler.goJobHandler and StreamWriter interfaces for the worker
internal/jobs/handler.goJobHandler interface for Nexus-mode job execution

Internal Packages

PackageResponsibility
networkWraps embedded tsnet for AceTeam Network connectivity
workerRedis Streams job runner with consumer groups and retry logic
jobsConcrete job handler implementations (shell, inference, config)
nexusHTTP client for Nexus API, device authorization, SSH key sync
platformCross-platform abstractions for OS, packages, Docker, GPU, users
heartbeatPublishes node status to AceTeam API and Redis at regular intervals
statusCollects system metrics (CPU, memory, disk, GPU, services)
redisLow-level Redis Streams client for job queue operations
redisapiHigher-level Redis API utilities
terminalWebSocket terminal server with PTY management and token auth
discoveryService discovery client for finding peer nodes
fabricserverFabric server enabling inter-node HTTP communication
capabilitiesDetects and reports node capabilities (GPU, services, resources)
servicesService management utilities for Docker containers
tuiTerminal UI components for interactive displays
uiInteractive prompts using the survey library
updateAuto-update check, download, install, and rollback logic
usageUsage tracking and reporting
recommendService recommendation engine based on hardware capabilities
composeDocker Compose command helpers
demoDemo mode utilities for showcasing functionality