A cross-platform C++17 command-line tool for managing API keys securely across different services.
- Cross-Platform: Runs on Linux, macOS, and Windows
- Secure Storage: Encrypted API key storage with local vault
- Service Integration: Built-in support for popular APIs (OpenAI, GitHub, AWS, etc.)
- Test Coverage: Comprehensive test suite with coverage reporting
- Easy Installation: Simple build and install process
- Shell Completions: Bash, Zsh, and Fish shell completions
Note: Use the GitHub Pages repository below. The Launchpad PPA is currently experiencing access issues.
curl -fsSL https://apertacodex.github.io/ak/setup-repository.sh | bash
sudo apt install ak# Add GPG key (secure method)
sudo mkdir -p /usr/share/keyrings
curl -fsSL https://apertacodex.github.io/ak/ak-repository-key.gpg | sudo tee /usr/share/keyrings/ak-archive-keyring.gpg > /dev/null
# Add GitHub Pages repository
echo "deb [signed-by=/usr/share/keyrings/ak-archive-keyring.gpg] https://apertacodex.github.io/ak/ak-apt-repo/ stable main" | sudo tee /etc/apt/sources.list.d/ak.list
# Update and install
sudo apt update && sudo apt install ak# Download latest .deb package (check for newest version)
wget https://apertacodex.github.io/ak/ak-apt-repo/pool/main/ak_4.10.6_amd64.deb
sudo dpkg -i ak_4.10.6_amd64.deb
# Fix dependencies if needed
sudo apt-get install -f# NOTE: Launchpad PPA currently returns 403 errors
# Use GitHub Pages repository above instead
# sudo add-apt-repository ppa:apertacodex/ak # β Don't use this# Check version
ak --version
# Test functionality
ak --help
# Shell completions work after restart
ak --<TAB><TAB>- CMake 3.16+
- C++17 compatible compiler (GCC 7+, Clang 8+, MSVC 2019+)
- Git (for dependencies and version management)
sudo apt update
sudo apt install build-essential cmake git# Using Homebrew
brew install cmake git
# Xcode command line tools
xcode-select --install- Install Visual Studio 2019+ with C++ tools
- Install CMake
- Install Git for Windows
./build.sh.\build.ps1# Configure
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build
cmake --build . --parallel
# Test
./ak_tests
# Install (Linux/macOS)
sudo cmake --build . --target install./build.sh --help # Show help
./build.sh # Release build
./build.sh --debug # Debug build
./build.sh --coverage test coverage # Coverage build with report
./build.sh all # Full build and test cycle
./build.sh clean # Clean build directory.\build.ps1 -Help # Show help
.\build.ps1 # Release build
.\build.ps1 -Debug # Debug build
.\build.ps1 -Targets test # Run tests only
.\build.ps1 -Targets all # Full build and test cycle
.\build.ps1 -Targets clean # Clean build directory# Basic targets
cmake --build . --target ak # Build main binary
cmake --build . --target ak_tests # Build tests
cmake --build . --target run_tests # Build and run tests
# Coverage (Linux/macOS only)
cmake --build . --target coverage # Generate coverage report
# Publishing (requires git repository)
cmake --build . --target bump-patch # Bump patch version
cmake --build . --target bump-minor # Bump minor version
cmake --build . --target bump-major # Bump major version
cmake --build . --target publish # Publish patch releaseThe project includes a comprehensive test suite with 65+ tests covering all major functionality.
# Using build scripts
./build.sh test # Linux/macOS
.\build.ps1 -Targets test # Windows
# Using CMake directly
cd build
cmake --build . --target run_tests # Build and run
./ak_tests # Run tests directly (Linux/macOS)
ak_tests.exe # Run tests directly (Windows)./build.sh --coverage test coverage
# Report generated in build/coverage_html/index.html# Basic usage
ak --version
ak --help
# Key management
ak add mykey "sk-..."
ak ls
ak get mykey
ak rm mykey
# Service testing
ak test openai
ak test github
ak test --all
# Shell completions
ak completion bash > /etc/bash_completion.d/ak # Bash
ak completion zsh > /usr/share/zsh/site-functions/_ak # Zsh
ak completion fish > ~/.config/fish/completions/ak.fish # Fishak/
βββ include/ # Header files
β βββ cli/ # CLI interface
β βββ core/ # Core configuration
β βββ crypto/ # Cryptographic functions
β βββ services/ # Service definitions
β βββ ...
βββ src/ # Source files
β βββ cli/
β βββ core/
β βββ crypto/
β βββ ...
βββ tests/ # Test files
βββ cmake/ # CMake helper scripts
βββ CMakeLists.txt # Main CMake configuration
βββ build.sh # Unix build script
βββ build.ps1 # Windows build script
βββ Makefile # Legacy Make support
-
Setup Development Environment:
git clone <repository> cd ak ./build.sh --debug test # Build in debug mode with tests
-
Make Changes: Edit source files in
src/and headers ininclude/ -
Run Tests:
./build.sh test -
Check Coverage (Linux/macOS):
./build.sh --coverage test coverage -
Create Release:
cmake --build build --target publish # Patch release cmake --build build --target publish-minor # Minor release cmake --build build --target publish-major # Major release
Tests use Google Test framework. Add test files in the appropriate tests/ subdirectory:
#include <gtest/gtest.h>
#include "your/module.hpp"
TEST(ModuleTest, BasicFunctionality) {
// Your test code
EXPECT_EQ(expected, actual);
}| Platform | Architecture | Compiler | Status |
|---|---|---|---|
| Linux | x86_64 | GCC 7+ | β Fully Supported |
| Linux | x86_64 | Clang 8+ | β Fully Supported |
| macOS | x86_64 | Clang | β Fully Supported |
| macOS | ARM64 | Clang | β Fully Supported |
| Windows | x86_64 | MSVC 2019+ | β Fully Supported |
| Windows | x86_64 | MinGW |
- Version: 4.11.0
- Test Coverage: ~60% line coverage, ~67% function coverage
- Tests: 65 tests across 21 test suites
- Build System: CMake 3.16+ with cross-platform support
- APT Repository: Available for Ubuntu/Debian systems
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
./build.sh test - Submit a pull request
This project is open source and licensed under the MIT License with Attribution Requirement.
Attribution Required: When integrating AK into other systems or creating derivative works, please mention ApertaCodex as the original creator.
See the LICENSE file for full details.
# Ubuntu/Debian - install newer CMake
sudo apt remove cmake
pip3 install cmake
# macOS - update via Homebrew
brew upgrade cmake# Ubuntu/Debian - install GCC 7+
sudo apt install gcc-7 g++-7
# Update alternatives
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60- Ensure Visual Studio 2019+ is installed with C++ tools
- Run build from "Developer Command Prompt for VS"
- Use PowerShell (not Command Prompt) for build scripts
- Linux/macOS: Check console output
- Windows: Check
build/CMakeFiles/CMakeError.logfor detailed errors
- Issues: GitHub Issues
- Documentation: This README and inline code comments
- Build Problems: Check troubleshooting section above`