Skip to main content

CLI tool for BitsReef PaaS platform

Project description

BitsReef CLI

bitsreef — deploy and manage BitsReef services from the command line.

Install

# One-liner (installs via pipx, or an isolated venv as fallback):
curl -fsSL https://raw.githubusercontent.com/cygnaragroup/bitsreef/main/cli/install.sh | sh

# ...or with pip / pipx directly:
pipx install bitsreef-cli      # recommended — isolated, on PATH
pip install bitsreef-cli

# ...or from a checkout:
pip install -e cli/

Shell completion

eval "$(bitsreef completion bash)"   # add to ~/.bashrc
eval "$(bitsreef completion zsh)"    # add to ~/.zshrc
bitsreef completion fish > ~/.config/fish/completions/bitsreef.fish

Getting started

# Log in to BitsReef (the CLI talks to the hosted BitsReef API)
bitsreef auth login

# Deploy an image to a project in one shot, streaming to completion
bitsreef up --project 4 --name web --image nginx:latest --port 80 --follow

bitsreef up creates the service if it doesn't exist (or updates its image if it does), triggers a deployment, and with --follow streams the build/deploy logs and exits non-zero if the deploy fails — so it drops straight into CI.

Linking (stop typing IDs)

Bind a directory to a project/service once, then omit IDs everywhere:

bitsreef link --project demo --service web   # writes ./.bitsreef.json
bitsreef logs                                # → the linked service's logs
bitsreef up -i nginx:1.27 --follow           # redeploy the linked service
bitsreef deploy status                       # linked project's deployments
bitsreef link --show                         # what's linked here
bitsreef unlink                              # remove the link

The link file (.bitsreef.json) is discovered by walking up from the current directory, like .git. Names or slugs work in place of numeric IDs everywhere (bitsreef logs demo web), and a default org is remembered after the first pick so multi-org accounts stop re-prompting.

Commands

Command Purpose
up Create-or-update a service from an image and deploy it (--follow, --json)
exec Open an interactive shell (/bin/sh) in a running container
link / unlink Bind this directory to a project/service (--show)
auth login, logout, whoami
projects list, info, create
services list, info, restart, stop, scale
deploy up (--follow), rebuild, status, rollback
env list, set, delete, reveal
domains list, add, remove, verify (custom domains)
volumes list, create, delete
metrics Current CPU / memory / network snapshot for a service
cron list, create, trigger, runs, delete (scheduled jobs)
webhooks list, add, update, remove (project event notifications)
templates list, info, deploy (service templates)
functions list, create, invoke, history, update, delete
logs View service logs (--tail, --follow for a live tail)
completion Print a shell-completion script (bash, zsh, fish)

Run bitsreef <command> --help for full options.

CI / scripting / agents

Everything works non-interactively and can emit JSON:

# Auth without a prompt — a token env var (nothing written to disk):
export BITSREEF_TOKEN=<access-token>

# ...or a piped password / a stored token:
echo "$PASS" | bitsreef auth login -u ci --password-stdin
bitsreef auth login --token "$BITSREEF_TOKEN"

# Machine-readable output (place --json before the command):
bitsreef --json services list demo | jq '.[].name'
bitsreef --json whoami
bitsreef up -p demo -n web -i img:tag --follow --json   # exits non-zero on deploy failure

BITSREEF_TOKEN (env) takes precedence over the config file. --json is supported on the read commands (whoami, projects/services list|info, deploy status, env list, functions list|history, logs) and up.

Configuration

Config and JWT tokens live in ~/.bitsreef/config.json (created 0600). The access token is refreshed automatically on expiry. BITSREEF_TOKEN (env) overrides the file when set. The API endpoint is built into the CLI — BitsReef is a hosted service, so there is no server URL to configure.

Development

cd cli
pip install -e . pytest
pytest

Releasing

Publishing is automated by .github/workflows/cli-publish.yml via PyPI trusted publishing (no API token). Bump version in pyproject.toml and bitsreef_cli/__init__.py, then tag:

git tag cli-v0.1.0 && git push origin cli-v0.1.0

The workflow verifies the tag matches the package version, builds the sdist + wheel, twine checks them, and uploads to PyPI. It can also be run manually from the Actions tab (workflow_dispatch).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bitsreef_cli-0.1.0.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bitsreef_cli-0.1.0-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file bitsreef_cli-0.1.0.tar.gz.

File metadata

  • Download URL: bitsreef_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bitsreef_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bea7b60121dbaa3f34fc0cf83b84cdca599e26bd48fc6c805d43d11c2416a91c
MD5 bf2703ea4b015faf4574de08d67199df
BLAKE2b-256 49da520c5fb063563b81a3ca03dd8bc5d34d8197f8079ba8c54379cc9afeefe3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitsreef_cli-0.1.0.tar.gz:

Publisher: cli-publish.yml on cygnaragroup/bitsreef

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bitsreef_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bitsreef_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bitsreef_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc554a77e05557a54adf3b6e54685b06700c7a866a6a388402fa8962659f27a5
MD5 e398d1eb12763c2f47c13e0600f3c67d
BLAKE2b-256 16c69ae26ecf1a185b442cfbe4e2ff63bb319f9c876bc0e7c920bf2de48038ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for bitsreef_cli-0.1.0-py3-none-any.whl:

Publisher: cli-publish.yml on cygnaragroup/bitsreef

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page