How codemagic-ci-cd/cli-tools works
Project type and purpose
• This is a Python-based, full-stack CLI application (a CLI-tools suite) that provides a collection of developer utilities for mobile-app packaging, code signing, and deployment.
• It bundles multiple executables (android-app-bundle, android-keystore, app-store-connect, git-changelog, google-play, keychain, universal-apk, xcode-project, plus a master command codemagic-cli-tools).
• Its primary use case is orchestrating mobile build pipelines by calling external APIs (App Store Connect, Google Play Developer, Firebase) and system tools (bundletool, keytool, jarsigner, xcodebuild).
File structure
• Top-level directories:
• src/codemagic – the core library
– /cli: argument parsing, CLI app, actions, action groups
– /tools: Python wrappers for each executable
– /apple & /google: service clients, resource definitions, API sessions
– /models: domain models for packages, certificates, xctests, etc.
– /shell_tools: thin wrappers around bundled JARs and system commands
– /utilities & /mixins: cross-cutting helpers (logging, decorators, file readers)
• docs – Markdown-based user guide for each CLI command
• tests – pytest-based coverage of every module and CLI entry point
• configuration: pyproject.toml, codemagic.yaml, pre-commit, workflow CI
README for additional insights
• Confirms Python 3.8+, Poetry for dependency management, CLI entrypoints added to PATH.
• Describes dual interface: CLI tools and mirror Python API under codemagic.tools.
• Lists external dependencies (App Store Connect API, Google Play Developer API, Firebase Distribution).
• Quality tools: Black, Ruff, Mypy, pytest.
Elements
• User → CLI Entrypoint
• CLI Entrypoint → CLI Core → Tools Implementation → Service or Shell Tools → External
• External → Service → Tools → CLI → User
• Blue = internal code modules
• Green = external systems/APIs
• Orange = node_modules/shell JARs & system commands
• Grey = utilities/mixins
Final recommendations
• Every category of code as its own logical component
• Notes for authentication flows (JWT for App Store, service-account JSON for Google/Firebase)