Configuration & Flags
Reference for global flags, environment variables, and standard exit codes.
The BuildShare CLI behavior can be controlled using global flags, environment variables, and respects standard exit codes for reliable automation.
Global Flags
These flags are available on every command:
| Flag | Short | Description |
|---|---|---|
--json | — | Output results as structured JSON for scripting, piping, and automated workflows |
--ci | — | Non-interactive CI mode — suppresses prompts, spinners, ANSI colors, and confirm dialogs |
--verbose | -v | Enable detailed debug logging for request/response traces and network timing |
--help | -h | Print help information and flag descriptions for any command |
--version | — | Print the installed CLI version information |
Example
# Combine flags for automated headless execution
buildshare upload ./app.apk --ci --json -vEnvironment Variables
Environment variables override configuration file values and command-line defaults, making them ideal for CI/CD secrets and containerized pipelines.
| Variable | Description |
|---|---|
BUILDSHARE_TOKEN | Personal access token. Set this in CI environments to authenticate without interactive login. |
BUILDSHARE_API_URL | Override the base API endpoint (useful for self-hosted instances, proxies, or staging). |
Secret Management Best Practice
In GitHub Actions, store your token as a repository or organization secret (Settings → Secrets and variables → Actions) and pass it to the environment as ${{ secrets.BUILDSHARE_TOKEN }}. Never commit tokens directly to source control.
Exit Codes
The BuildShare CLI follows standard POSIX exit codes so CI/CD pipelines and shell scripts can automatically detect status and handle failures predictably:
| Exit Code | Status | Meaning |
|---|---|---|
0 | Success | The command completed successfully with no errors. |
1 | General Error | Authentication failure, network timeout, invalid file format, or server error. |
2 | Misuse | Invalid command usage, unrecognized flag, or missing required arguments. |
Shell Scripting Example
#!/usr/bin/env bash
buildshare upload ./app-release.apk --ci --json
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
echo "Build uploaded successfully!"
elif [ $EXIT_CODE -eq 2 ]; then
echo "Command syntax error. Check parameters."
exit 1
else
echo "Upload failed with error code $EXIT_CODE."
exit 1
fi