diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b327ce9 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,71 @@ +# 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 `dropshell-tool`, a C++ command-line application that manages tool installation, updates, and publishing for the dropshell ecosystem. + +## Architecture + +### Core Components + +- **dropshell-tool**: Main C++ application (`dropshell-tool/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 (dropshell-tool) +cd dropshell-tool && ./build.sh + +# Test specific tool +cd dropshell-tool && ./test.sh + +# Publish specific tool (requires SOS_WRITE_TOKEN) +cd dropshell-tool && ./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 + +dropshell-tool manages a tool ecosystem by: +- Installing tools to `~/.local/bin/dropshell-tool//` +- Managing bash completions and aliases via `~/.bashrc_dropshell_tool` +- Storing tool metadata in `~/.config/dropshell-tool/` +- Publishing/downloading tools via getbin.xyz object storage + +Each tool includes a `dropshell-tool-config.json` with aliases and setup scripts. + +## Publishing Requirements + +Publishing requires the `SOS_WRITE_TOKEN` environment variable for authentication to the object storage system. \ No newline at end of file diff --git a/dropshell-tool/publish.sh b/dropshell-tool/publish.sh index 0f24898..f10dc80 100755 --- a/dropshell-tool/publish.sh +++ b/dropshell-tool/publish.sh @@ -43,4 +43,4 @@ chmod +x "${SOS}" "${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/output/${PROJECT}" "${PROJECT}:latest-${ARCH}" # upload generic install script (ok if multiple times as we iterate through arch's) -"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "${PROJECT}-install:latest" \ No newline at end of file +"${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/install.sh" "${PROJECT}-install:latest" diff --git a/dropshell-tool/src/GetbinClient.cpp b/dropshell-tool/src/GetbinClient.cpp index 58155e4..a1f9ac8 100644 --- a/dropshell-tool/src/GetbinClient.cpp +++ b/dropshell-tool/src/GetbinClient.cpp @@ -84,7 +84,11 @@ bool GetbinClient::upload(const std::string& archivePath, std::string& outUrl, s client->sendRequest(req, [&](drogon::ReqResult result, const drogon::HttpResponsePtr& response) { if (result != drogon::ReqResult::Ok || !response) { - std::cerr << "[GetbinClient::upload] HTTP request failed (no response)." << std::endl; + std::cerr << "[GetbinClient::upload] HTTP /upload request failed (did not get OK response)." << std::endl; + if (response) { + std::cerr << response->getStatusCode() << std::endl; + std::cerr << response->getBody() << std::endl; + } return; }