{"id":8266,"library":"launchable","title":"Launchable CLI","description":"Launchable CLI is a Python3 package that serves as the command-line interface to the Launchable test failure intelligence platform. It enables users to integrate their build tools and test runners with Launchable for features like predictive test selection, test suite parallelization, intelligent test failure diagnostics, and test trend analysis. The library is actively maintained, adhering to semantic versioning, with frequent updates to its '1.x' major release line.","status":"active","version":"1.122.0","language":"en","source_language":"en","source_url":"https://github.com/launchableinc/launchable-cli","tags":["cli","testing","ci/cd","devops","test analytics","test optimization"],"install":[{"cmd":"pip install launchable","lang":"bash","label":"Install latest version"},{"cmd":"pip install --user --upgrade launchable~=1.0","lang":"bash","label":"Install specific major version"}],"dependencies":[{"reason":"Runtime environment for the CLI.","package":"Python","version":">=3.6"},{"reason":"Required runtime for underlying components of the CLI.","package":"Java","version":">=8"}],"imports":[{"note":"The 'launchable' library is primarily a command-line interface. Direct programmatic interaction for core functionality is typically achieved by invoking the 'launchable' CLI tool via Python's 'subprocess' module, rather than importing specific classes or functions directly from the 'launchable' package itself.","symbol":"launchable","correct":"import subprocess\nsubprocess.run(['launchable', '--version'])"}],"quickstart":{"code":"import os\nimport subprocess\n\n# Replace with your actual Launchable API key or retrieve from environment\n# For CI/CD, this is typically set as an environment variable (e.g., LAUNCHABLE_TOKEN)\napi_key = os.environ.get('LAUNCHABLE_TOKEN', 'YOUR_LAUNCHABLE_API_KEY')\n\nif not api_key or api_key == 'YOUR_LAUNCHABLE_API_KEY':\n    print(\"Warning: LAUNCHABLE_TOKEN environment variable not set. Using placeholder.\")\n    print(\"Please set LAUNCHABLE_TOKEN for actual usage.\")\n    # For demonstration, we'll proceed, but real usage requires a valid token\n\nos.environ['LAUNCHABLE_TOKEN'] = api_key\n\ntry:\n    print(\"Verifying Launchable CLI configuration...\")\n    result = subprocess.run(['launchable', 'verify'], capture_output=True, text=True, check=True)\n    print(\"Launchable CLI verification successful:\")\n    print(result.stdout)\nexcept subprocess.CalledProcessError as e:\n    print(f\"Error verifying Launchable CLI: {e.stderr}\")\n    print(\"Please ensure LAUNCHABLE_TOKEN is set correctly and Java 8+ is installed.\")\nexcept FileNotFoundError:\n    print(\"Error: 'launchable' command not found.\")\n    print(\"Please ensure the Launchable CLI is installed and in your system's PATH.\")\n","lang":"python","description":"This quickstart demonstrates how to verify your Launchable CLI installation and authentication using Python's `subprocess` module, which is the recommended way for programmatic interaction with the CLI. It assumes the `LAUNCHABLE_TOKEN` environment variable is set for authentication."},"warnings":[{"fix":"Use `pip install launchable~=1.0` to constrain installations to the current major version. Review changelogs for migration guides before upgrading major versions.","message":"Major version updates (e.g., from `1.x` to `2.x`) are explicitly stated to introduce drastic changes that break backward compatibility. Pin your dependency to `launchable~=1.0` for stability within the 1.x release line.","severity":"breaking","affected_versions":"1.x to 2.x (future major versions)"},{"fix":"Install Java 8 (or a newer compatible version) and ensure its `bin` directory is included in your system's PATH environment variable.","message":"The Launchable CLI requires a Java Runtime Environment (JRE) version 8 or newer to be installed and accessible in the system's PATH, even though the CLI itself is a Python package. This is a common oversight for Python-only environments.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Set the `LAUNCHABLE_TOKEN` environment variable with your API key. For CI/CD, use secret management features of your CI system. For open-source projects, refer to the documentation on 'tokenless authentication'.","message":"Authentication to the Launchable platform primarily relies on the `LAUNCHABLE_TOKEN` environment variable. If this is not set or is incorrect, CLI commands will fail with authentication errors. For open-source projects, tokenless authentication via GitHub OIDC requires specific GitHub Actions YAML configuration.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure the library is installed with `pip install launchable` and that your `~/.local/bin` (or equivalent) is in your PATH, or specify the full path to the `launchable` executable.","cause":"The 'launchable' executable is not installed or not available in the system's PATH environment variable.","error":"Error: 'launchable' command not found. or OSError: [Errno 2] No such file or directory: 'launchable'"},{"fix":"Set the `LAUNCHABLE_TOKEN` environment variable with your Launchable API key. For example, `export LAUNCHABLE_TOKEN=your_api_key` in a shell, or configure it in your CI/CD system's secrets.","cause":"The `LAUNCHABLE_TOKEN` environment variable, required for authentication with the Launchable API, has not been set or is empty.","error":"Error: API key is not set. Please set LAUNCHABLE_TOKEN environment variable."},{"fix":"Interact with Launchable using the `launchable` command-line tool via `subprocess` calls in Python scripts, rather than attempting direct Python imports of non-public modules.","cause":"Attempting to `import` a non-existent internal module or assuming a direct Python SDK interface that is not publicly exposed for general use. The `launchable` package is primarily a CLI wrapper, not a traditional Python SDK with exposed high-level programmatic APIs.","error":"ModuleNotFoundError: No module named 'launchable.client'"}]}