Git Product home page Git Product logo

bitsrun's Introduction

bitsrun

Ruff pdm-managed Pre-commit PyPI Publish PyPI PyPI - Python Version PyPI - Downloads

A headless login / logout script for 10.0.0.55 at BIT.

Install

You need at least Python 3.8. We recommend installing with pipx.

python3 -m pip install --user pipx
python3 -m pipx ensurepath

After which, install bitsrun with pipx.

pipx install bitsrun

Usage

CLI

Check login status of your device.

bitsrun status

Usage: bitsrun status [OPTIONS]

  Check current network login status.

Options:
  --json / --no-json  Output in JSON format.
  --help  Show this message and exit.

Note: this is the output of bitsrun status --help.

Login or logout with your username and password.

bitsrun login

Usage: bitsrun login/logout [OPTIONS]

  Log into or out of the BIT network.

Options:
  -u, --username TEXT  Your username.
  -p, --password TEXT  Your password.
  -v, --verbose        Verbosely echo API response.
  --help               Show this message and exit.

Note: this is the output of bitsrun login/logout --help.

Configuration file

Create new file named bit-user.json:

{
    "username": "xxxx",
    "password": "xxxx"
}

This file should be put under the following directory:

  • Windows: %APPDATA%\bitsrun
  • macOS and Linux: ~/.config/bitsrun (Following the XDG spec)

Now you can simply call:

bitsrun login
bitsrun logout

Besides, a system-wide configuration file is supported, and the location also depends on your platform.

To list all possible paths for your system (including those only for backward compatibility), call:

bitsrun config-paths

Raycast script (macOS)

raycast screenshot

Import the two Raycast scripts from ./scripts and setup your config file in ~/.config/bit-user.json. The script uses /usr/bin/python3 by default, so you either need to install bitsrun with this Python interpreter or setup your own Python interpreter path in the script.

Developing

Install and run:

# Create virtual env and install deps
pdm install

# Enter virtual env
eval $(pdm venv activate)

# Install pre-commit hooks
pre-commit install

Build:

pdm build

Publish:

pdm publish

Credits

License

WTFPL License

bitsrun's People

Contributors

spencerwooo avatar renovate[bot] avatar aloxaf avatar felinae98 avatar ydx-2147483647 avatar everything411 avatar lsylusiyao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.