Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add completions #59

Merged
merged 1 commit into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion MANIFEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
- [bundle](https://github.com/rubygems/rubygems): Ruby Dependency Management [src](src/bundle.sh) [cmpl](completions/bundle.sh)
- [bunzip2](https://gitlab.com/bzip2/bzip2): a block-sorting file compressor [src](src/bunzip2.sh) [cmpl](completions/bunzip2.sh)
- [bw](https://github.com/bitwarden/clients): Bitwarden Command-line Interface [cmpl](completions/bw.sh)
- [bws](https://github.com/bitwarden/sdk): Bitwarden Secrets CLI [src](src/bws.sh) [cmpl](completions/bws.sh)
- [bzcat](https://gitlab.com/bzip2/bzip2): decompresses files to stdout [src](src/bzcat.sh) [cmpl](completions/bzcat.sh)
- [bzip2](https://gitlab.com/bzip2/bzip2): a block-sorting file compressor [src](src/bzip2.sh) [cmpl](completions/bzip2.sh)
- [cabal](https://github.com/haskell/cabal): a system for building and packaging Haskell libraries and programs [src](src/cabal.sh) [cmpl](completions/cabal.sh)
Expand Down Expand Up @@ -322,6 +323,7 @@
- [help2man](https://www.gnu.org/software/help2man): generate a simple manual page [src](src/help2man.sh) [cmpl](completions/help2man.sh)
- [hexchat](https://github.com/hexchat/hexchat): IRC client for X based on X-Chat 2 [cmpl](completions/hexchat.sh)
- [hexdump](https://github.com/util-linux/util-linux): display file contents in hexadecimal, decimal, octal, or ascii [src](src/hexdump.sh) [cmpl](completions/hexdump.sh)
- [hexo](https://github.com/hexojs/hexo): Fast, simple & powerful blog framework [src](src/hexo.sh) [cmpl](completions/hexo.sh)
- [hexyl](https://github.com/sharkdp/hexyl): A command-line hex viewer [cmpl](completions/hexyl.sh)
- [highlight](https://gitlab.com/saalen/highlight): a universal sourcecode to formatted text converter [src](src/highlight.sh) [cmpl](completions/highlight.sh)
- [himalaya](https://github.com/soywod/himalaya): CLI to manage emails [src](src/himalaya.sh) [cmpl](completions/himalaya.sh)
Expand Down Expand Up @@ -354,6 +356,7 @@
- [jj](https://github.com/martinvonz/jj): A Git-compatible DVCS that is both simple and powerful [src](src/jj.sh) [cmpl](completions/jj.sh)
- [jless](https://github.com/PaulJuliusMartinez/jless): JSON viewer designed for reading, exploring, and searching through JSON data. [src](src/jless.sh) [cmpl](completions/jless.sh)
- [jmeter](https://github.com/apache/jmeter): Apache JMeter - Load testing tool [src](src/jmeter.sh) [cmpl](completions/jmeter.sh)
- [jnv](https://github.com/ynqa/jnv): Interactive JSON filter using jq [src](src/jnv.sh) [cmpl](completions/jnv.sh)
- [join](http://gnu.org/software/coreutils): join lines of two files on a common field [cmpl](completions/join.sh)
- [joker](https://github.com/candid82/joker): Small Clojure interpreter, linter and formatter. [src](src/joker.sh) [cmpl](completions/joker.sh)
- [jq](https://github.com/jqlang/jq): Command-line JSON processor [cmpl](completions/jq.sh)
Expand Down Expand Up @@ -409,11 +412,13 @@
- [luarocks](https://github.com/luarocks/luarocks): the package manager for the Lua programming language. [src](src/luarocks.sh) [cmpl](completions/luarocks.sh)
- [lux](https://github.com/iawia002/lux): Fast and simple video downloader [src](src/lux.sh) [cmpl](completions/lux.sh)
- [lychee](https://github.com/lycheeverse/lychee): A fast, async, stream-based link checker written in Rust. [cmpl](completions/lychee.sh)
- [lynis](https://github.com/CISOfy/lynis): Security and system auditing tool to harden systems [src](src/lynis.sh) [cmpl](completions/lynis.sh)
- [lynx](https://invisible-island.net/lynx): a general purpose distributed information browser for the World Wide Web [src](src/lynx.sh) [cmpl](completions/lynx.sh)
- [lzcat](https://github.com/tukaani-project/xz): Compress or decompress .xz and .lzma files [cmpl](completions/lzcat.sh)
- [lzma](https://github.com/tukaani-project/xz): Compress or decompress .xz and .lzma files [cmpl](completions/lzma.sh)
- [m4](https://www.gnu.org/software/m4): macro processor [src](src/m4.sh) [cmpl](completions/m4.sh)
- [mackup](https://github.com/lra/mackup): Keep your application settings in sync (OS X/Linux) [src](src/mackup.sh) [cmpl](completions/mackup.sh)
- [magick](https://github.com/ImageMagick/ImageMagick): convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more [src](src/magick.sh) [cmpl](completions/magick.sh)
- [make](https://www.gnu.org/software/make): GNU make utility to maintain groups of programs [src](src/make.sh) [cmpl](completions/make.sh)
- [man](https://gitlab.com/man-db/man-db): an interface to the system reference manuals [src](src/man.sh) [cmpl](completions/man.sh)
- [mask](https://github.com/jacobdeichert/mask): A CLI task runner defined by a simple markdown file [src](src/mask.sh) [cmpl](completions/mask.sh)
Expand Down Expand Up @@ -855,6 +860,7 @@
- [yt-dlp](https://github.com/yt-dlp/yt-dlp): A youtube-dl fork with additional features and fixes [src](src/yt-dlp.sh) [cmpl](completions/yt-dlp.sh)
- [zathura](https://github.com/pwmt/zathura): a document viewer [src](src/zathura.sh) [cmpl](completions/zathura.sh)
- [zcat](https://www.nongnu.org/zutils/zutils.html): decompress and concatenate files to standard output [cmpl](completions/zcat.sh)
- [zed](https://github.com/zed-industries/zed): Multiplayer code editor [cmpl](completions/zed.sh)
- [zellij](https://github.com/zellij-org/zellij): A terminal workspace with batteries included [src](src/zellij.sh) [cmpl](completions/zellij.sh)
- [zenith](https://github.com/bvaisvil/zenith): sort of like top or htop but with zoom-able charts, CPU, GPU, network, and disk usage [cmpl](completions/zenith.sh)
- [zig](https://github.com/ziglang/zig): Programming language designed for robustness, optimality, and clarity [src](src/zig.sh) [cmpl](completions/zig.sh)
Expand Down Expand Up @@ -912,7 +918,6 @@
- [xcodeproj](https://github.com/CocoaPods/Xcodeproj): Create and modify Xcode projects from Ruby. [cmpl](completions/macos/xcodeproj.sh)
- [xcodes](https://github.com/XcodesOrg/xcodes): The best command-line tool to install and switch between multiple versions of Xcode. [src](src/macos/xcodes.sh) [cmpl](completions/macos/xcodes.sh)
- [xcrun](https://keith.github.io/xcode-man-pages/xcrun.1.html): Run or locate development tools and properties. [src](src/macos/xcrun.sh) [cmpl](completions/macos/xcrun.sh)
sigo

## Linux
- [acpi](http://sourceforge.net/projects/acpiclient): shows battery status and other ACPI information [cmpl](completions/linux/acpi.sh)
Expand Down Expand Up @@ -1036,6 +1041,7 @@ sigo
- [netctl](https://git.archlinux.org/netctl.git): Control the netctl network profile manager [src](src/linux/netctl.sh) [cmpl](completions/linux/netctl.sh)
- [networkctl](https://github.com/systemd/systemd): Query the status of network links [src](src/linux/networkctl.sh) [cmpl](completions/linux/networkctl.sh)
- [nmcli](https://gitlab.freedesktop.org/NetworkManager/NetworkManager): command-line tool for controlling NetworkManage [src](src/linux/nmcli.sh) [cmpl](completions/linux/nmcli.sh)
- [notify-send](https://salsa.debian.org/gnome-team/libnotify): a program to send desktop notifications [cmpl](completions/linux/notify-send.sh)
- [nsenter](https://github.com/util-linux/util-linux): run program in different namespaces [src](src/linux/nsenter.sh) [cmpl](completions/linux/nsenter.sh)
- [opkg](https://code.google.com/archive/p/opkg): a lightweight package management system [src](src/linux/opkg.sh) [cmpl](completions/linux/opkg.sh)
- [pacman](https://gitlab.archlinux.org/pacman/pacman): package manager utility for Arch linux [src](src/linux/pacman.sh) [cmpl](completions/linux/pacman.sh)
Expand Down
238 changes: 238 additions & 0 deletions completions/bws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
#!/usr/bin/env bash
# Automatic generated, DON'T MODIFY IT.

# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @flag -V --version Print version

# {{ bws config
# @cmd Configure the CLI
# @flag -d --delete
# @option -o --output[json|yaml|env|table|tsv|none] Output format
# @option -c --color[no|yes|auto] Use colors in the output
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use
# @option -p --profile Profile to use from the config file
# @option -u --server-url <SERVER_URL> Override the server URL from the config file
# @flag -h --help Print help (see a summary with '-h')
# @arg name[server-base|server-api|server-identity|state-file-dir]
# @arg value
config() {
:;
}
# }} bws config

# {{ bws completions
# @cmd Generate shell completion files
# @option -o --output[json|yaml|env|table|tsv|none] Output format
# @option -c --color[no|yes|auto] Use colors in the output
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use
# @option -p --profile Profile to use from the config file
# @option -u --server-url <SERVER_URL> Override the server URL from the config file
# @flag -h --help Print help (see a summary with '-h')
# @arg shell[bash|elvish|fish|powershell|zsh]
completions() {
:;
}
# }} bws completions

# {{ bws project
# @cmd Commands available on Projects
# @option -o --output[json|yaml|env|table|tsv|none] Output format
# @option -c --color[no|yes|auto] Use colors in the output
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use
# @option -p --profile Profile to use from the config file
# @option -u --server-url <SERVER_URL> Override the server URL from the config file
# @flag -h --help Print help (see a summary with '-h')
project() {
:;
}

# {{{ bws project create
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg name!
project::create() {
:;
}
# }}} bws project create

# {{{ bws project delete
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg project_ids*
project::delete() {
:;
}
# }}} bws project delete

# {{{ bws project edit
# @cmd
# @option --name
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg project_id![`_choice_project_id`]
project::edit() {
:;
}
# }}} bws project edit

# {{{ bws project get
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg project_id![`_choice_project_id`]
project::get() {
:;
}
# }}} bws project get

# {{{ bws project list
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
project::list() {
:;
}
# }}} bws project list
# }} bws project

# {{ bws secret
# @cmd Commands available on Secrets
# @option -o --output[json|yaml|env|table|tsv|none] Output format
# @option -c --color[no|yes|auto] Use colors in the output
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use
# @option -p --profile Profile to use from the config file
# @option -u --server-url <SERVER_URL> Override the server URL from the config file
# @flag -h --help Print help (see a summary with '-h')
secret() {
:;
}

# {{{ bws secret create
# @cmd
# @option --note An optional note to add to the secret
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg key!
# @arg value!
# @arg project_id![`_choice_project_id`] The ID of the project this secret will be added to
secret::create() {
:;
}
# }}} bws secret create

# {{{ bws secret delete
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg secret_ids*
secret::delete() {
:;
}
# }}} bws secret delete

# {{{ bws secret edit
# @cmd
# @option --key
# @option --value
# @option --note
# @option --project-id <PROJECT_ID>
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg secret_id![`_choice_secret_id`]
secret::edit() {
:;
}
# }}} bws secret edit

# {{{ bws secret get
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg secret_id![`_choice_secret_id`]
secret::get() {
:;
}
# }}} bws secret get

# {{{ bws secret list
# @cmd
# @option -o --output[json|yaml|env|table|tsv|none] Output format [default: json]
# @option -c --color[no|yes|auto] Use colors in the output [default: auto]
# @option -t --access-token <ACCESS_TOKEN> Specify access token for the machine account [env: BWS_ACCESS_TOKEN]
# @option -f --config-file <CONFIG_FILE> [default: ~/.bws/config] Config file to use [env: BWS_CONFIG_FILE=]
# @option -p --profile Profile to use from the config file [env: BWS_PROFILE=]
# @option -u --server-url <SERVER_URL> Override the server URL from the config file [env: BWS_SERVER_URL=]
# @flag -h --help Print help
# @arg project_id[`_choice_project_id`]
secret::list() {
:;
}
# }}} bws secret list
# }} bws secret

_choice_project_id() {
bws project list --output json | yq '.[] | .id + " " + .name'
}

_choice_secret_id() {
bws secret list --output json | yq '.[] | .id + " " + .key'
}

command eval "$(argc --argc-eval "$0" "$@")"
Loading
Loading