getpkg/CLAUDE.md
Your Name 5275f02ee3
All checks were successful
Build-Test-Publish / build (push) Successful in 51s
'Generic Commit'
2025-06-16 22:39:05 +12:00

71 lines
2.1 KiB
Markdown

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This repository contains Dropshell Tools - a collection of utilities that support dropshell development. The main tool is `getpkg`, a C++ command-line application that manages tool installation, updates, and publishing for the dropshell ecosystem.
## Architecture
### Core Components
- **getpkg**: Main C++ application (`getpkg/src/`)
- `main.cpp`: CLI interface and command routing
- `ArchiveManager`: Handles .tgz archive creation/extraction
- `BashrcEditor`: Manages ~/.bashrc_dropshell_tool script modifications
- `DropshellScriptManager`: Manages tool installation and configuration
- `GetbinClient`: HTTP client for downloading/uploading tools
- **sos**: Simple object storage utility
- **whatsdirty**: Git repository status checker
### Build System
- Uses CMake with C++23 standard
- Docker-based builds with static linking
- Uses external build base image `gitea.jde.nz/public/dropshell-build-base:latest`
- Versioning based on timestamp format YYYY.MMDD.HHMM
## Common Commands
### Build Tools
```bash
# Build all tools (includes install from getbin.xyz)
./buildtestpublish_all.sh
# Build specific tool (getpkg)
cd getpkg && ./build.sh
# Test specific tool
cd getpkg && ./test.sh
# Publish specific tool (requires SOS_WRITE_TOKEN)
cd getpkg && ./publish.sh
```
### Development Workflow
```bash
# Check status of all git repositories
./whatsdirty/whatsdirty.sh
# Build debug version (default in build.sh)
export CMAKE_BUILD_TYPE="Debug"
# Build release version (used in publish.sh)
export CMAKE_BUILD_TYPE="Release"
```
## Tool Functionality
getpkg manages a tool ecosystem by:
- Installing tools to `~/.local/bin/getpkg/<tool_name>/`
- Managing bash completions and aliases via `~/.bashrc_dropshell_tool`
- Storing tool metadata in `~/.config/getpkg/`
- Publishing/downloading tools via getbin.xyz object storage
Each tool includes a `getpkg-config.json` with aliases and setup scripts.
## Publishing Requirements
Publishing requires the `SOS_WRITE_TOKEN` environment variable for authentication to the object storage system.