backend.ai-cli
Unified command-line interface for Backend.AI
How to adopt in CLI-enabled Backend.AI packages
An example setup.cfg in Backend.AI Manager:
[options.entry_points]
backendai_cli_v10 =
mgr = ai.backend.manager.cli.__main__:main
mgr.start-server = ai.backend.gateway.server:main
Define your package entry points that returns a Click command group using a
prefix, and add additional entry points that returns a Click command using a
prefix followed by a dot and sub-command name for shortcut access, under the
backendai_cli_v10 entry point group.
Then add backend.ai-cli to the install_requires list.
You can do the same in setup.py as well.
Shell Tab Completion
The CLI provides built-in shell tab completion support for bash, zsh, and fish shells.
Quick Setup
# Show completion setup instructions
backend.ai completion --show
# Install completion automatically
backend.ai completion --shell bash # Install to ~/.bashrc
backend.ai completion --shell zsh # Install to ~/.zshrc
backend.ai completion --shell fish # Install to fish completions
Manual Setup
If you prefer manual setup, you can add completion to your shell configuration:
Bash (~/.bashrc):
eval "$(_BACKEND_AI_COMPLETE=bash_source backend.ai)"
Zsh (~/.zshrc):
eval "$(_BACKEND_AI_COMPLETE=zsh_source backend.ai)"
Fish (~/.config/fish/config.fish):
backend.ai completion --shell fish | source
Features
Tab completion supports:
- Commands: All available commands and subcommands
- Options: Short and long flags with descriptions
- Arguments: Context-aware argument completion where applicable
- Help: Descriptions for commands and options
Examples
backend.ai <TAB> # Show all available commands
backend.ai session <TAB> # Show session subcommands
backend.ai session create <TAB> # Show creation options
backend.ai --<TAB> # Show global options
Metadata
Release files for backend.ai-cli 26.4.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| backend_ai_cli-26.4.12.tar.gz | 12.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| backend_ai_cli-26.4.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.0 kB
Release files / backend_ai_cli-26.4.12.tar.gz
| Download URL | backend_ai_cli-26.4.12.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fe9e5539d68ccb69a928f1b768a63e35d7b753d3ff9dfa3173f8641fed0eb03
|
|
BLAKE2b-256 checksum How to use checksums |
270c9e32e338eaa5b47d1328e2be633b43a28bef8098258c756682a66b3f664e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / backend_ai_cli-26.4.12-py3-none-any.whl
| Download URL | backend_ai_cli-26.4.12-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
001cceb20c25db001e1c246e8ca9b81e3e81313d69840c4599399efd11b42dbf
|
|
BLAKE2b-256 checksum How to use checksums |
f235b0e440b052ea43a5f4b40be65f757417a0c79d661ad2c76512ba333d5e4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|