buildshare.in

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:

FlagShortDescription
--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-vEnable detailed debug logging for request/response traces and network timing
--help-hPrint 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 -v

Environment Variables

Environment variables override configuration file values and command-line defaults, making them ideal for CI/CD secrets and containerized pipelines.

VariableDescription
BUILDSHARE_TOKENPersonal access token. Set this in CI environments to authenticate without interactive login.
BUILDSHARE_API_URLOverride 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 CodeStatusMeaning
0SuccessThe command completed successfully with no errors.
1General ErrorAuthentication failure, network timeout, invalid file format, or server error.
2MisuseInvalid 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

On this page