carapace-bin

repository·master·Indexed 23 days ago

https://github.com/carapace-sh/carapace-bin

A tool providing intelligent argument completion for a vast array of CLI commands across multiple POSIX and non-POSIX shells, including Bash, Zsh, Fish, Nushell, Powershell, and others. The package includes the carapace-generate CLI for producing completion scripts, carapace-lint for validating flag ordering in Go source files, and carapace-parse for converting GNU help text into Cobra command boilerplate.

Tokens
490.4K
Snippets
1.4K
Records
2.7K
Agent score
81%

What's inside carapace-bin

  1. Overview of carapace-bin

    master

    carapace-bin is a tool that provides advanced argument completion for a wide variety of CLI commands. It is designed to work seamlessly across multiple POSIX and non-POSIX shells, allowing users to have consistent, intelligent tab-completion for their command-line tools regardless of their shell environment.

    Supported shells include:

    • Bash
    • Cmd (experimental)
    • Elvish
    • Fish
    • Ion (experimental)
    • Nushell
    • Oil
    • Powershell
    • Tcsh (experimental)
    • Xonsh
    • Zsh
  2. Overview of `go test` command

    master

    The go test command automates testing for Go packages, including test functions, benchmarks, fuzz tests, examples, coverage analysis, profiling, and test result caching. It recompiles each package along with its *_test.go files and runs the resulting test binary.

    Basic Syntax:

    go test [build/test flags] [packages] [build/test flags & test binary flags]

    Compilation Rules:

    • Files matching *_test.go are compiled with the package.
    • Files starting with _ or . are ignored.
    • Test files declaring a package with a _test suffix are compiled as an external test package.
    • Directories named testdata are ignored (used for test fixtures).
  3. Overview of Carapace usage and capabilities

    master

    Carapace is a shell completion engine used for integrating completions into CLIs, writing YAML specifications, creating custom actions, and building completion-aware lexers for DSLs.

    Key capabilities include:

    • CLI Integration: Adding completions to existing tools (e.g., Cobra).
    • Specification Writing: Using YAML specs or user specs to define completions.
    • Customization: Creating custom actions, using macros, and configuring choices/bridges.
    • Advanced Features: Using the MCP server, generating man pages, and building lexers for DSLs.
    • Automation: Converting specs to Go code or scraping specs from source code.
  4. Manage IP tunnels with ip tunnel

    master

    The ip tunnel command is used to manage various IP tunnel types such as ipip, gre, sit, vti, and more. You can add, change, delete, or list existing tunnels using the following primary commands:

    • add: Create a new tunnel.
    • change: Modify an existing tunnel.
    • del (or delete): Destroy a tunnel.
    • show (or list): List existing tunnels.
    • prl: Manage the potential router list (specifically for isatap mode).
    • 6rd: Configure 6rd (IPv6 Rapid Deployment).
    ip tunnel { add | change | del | show | prl | 6rd } [ NAME ] [ mode MODE ] [ remote ADDR ] [ local ADDR ]
  5. QEMU Skill triggers and scope

    master

    The QEMU skill provides comprehensive references for the QEMU command suite, including full-system emulators, disk image tools, block storage infrastructure, and management protocols.

    This skill is automatically triggered by the following terms:

    • qemu, qemu-system, qemu-img, qemu-nbd, qemu-kvm, QEMU
    • qcow2, qcow, qed, virtio, virgl, vhost-user, VirtIO
    • block driver, machine type, SEV, SEV-SNP, TDX, snapshot, backing file
    • NBD, Network Block Device, QMP, QEMU Monitor Protocol
    • guest agent, qemu-ga, cpu model, host passthrough, SPICE, VNC
  6. Understand the carapace-bin project layout

    master

    The carapace-bin project is organized into several key directories that define its structure and capabilities:

    • cmd/: Contains the main application binaries and specialized tools:
      • carapace: The main application.
      • carapace-fmt: A simple formatter.
      • carapace-generate: A tool executed by go generate.
      • carapace-lint: A simple linter.
      • carapace-parse: A simple help output parser.
      • carapace-shim: A binary used for runnable specs on Windows.
    • completers/: Contains completer definitions. For example, completers/example_completer/cmd/action contains local actions coupled to a specific completer.
    • completers_release/: Contains optimized versions of the completers.
    • pkg/: Contains public packages intended for use by other parts of the project or external consumers:
      • actions/: Shared actions, including actions/tools for tool-specific shared actions. These are also exposed as macros.
      • conditions/: Logic for environment variable completion.
      • env/: Environment variable definitions.
      • styles/: Style configurations.
      • util/: Utility functions.
    • internal/: Contains internal packages that are not exposed to external consumers.
    • docs/: Project documentation.
    • dist/: The output folder for goreleaser builds.
    .
    ├── cmd
    │  ├── carapace # main application
    │  ├── carapace-fmt # simple formatter
    │  ├── carapace-generate # executed by `go generate`
    │  ├── carapace-lint # simple linter
    │  ├── carapace-parse # simple help output parser
    │  └── carapace-shim # binary for runnable specs in windows
    ├── completers # completers
    │  └── example_completer # completer for `example`
    │    └── cmd
    │      └── action # local (coupled) actions
    ├── completers_release # optimized completers
    ├── dist # goreleaser dist folder
    ├── docs # documentation
    ├── internal # internal packages
    └── pkg # public packages
       ├── actions # shared actions that are also exposed as macros
       │  └── tools # shared actions specific to tools
       ├── conditions # conditions for environment variable completion
       ├── env # environment variables
       ├── styles # style configurations
       └── util # util functions
  7. Use qemu-nbd in Server, List, or Kernel Client modes

    master

    The qemu-nbd utility operates in three primary modes:

    1. Server mode: Exports a local disk image over the NBD protocol. The default listening port is 10809.
    2. List mode (-L): Queries an existing NBD server to list its available exports.
    3. Kernel client mode (-c/-d): Connects or disconnects a kernel NBD device to/from an image.

    Synopsis:

    qemu-nbd [OPTIONS] FILE
    qemu-nbd -L [OPTIONS]
  8. Manage Kubernetes PKI with `kubeadm certs`

    master

    The kubeadm certs command (aliased as kubeadm certificates) is used to manage the Kubernetes cluster Public Key Infrastructure (PKI). It allows you to renew certificates, check for expiration, generate new certificate keys, and create Certificate Signing Requests (CSRs) for external CA modes.

    Subcommands

    SubcommandPurpose
    kubeadm certs renewRenew certificates (parent)
    kubeadm certs renew <cert>Renew a specific certificate
    kubeadm certs renew allRenew all known control-plane certificates
    kubeadm certs certificate-keyGenerate a new certificate key
    kubeadm certs check-expirationCheck certificate expiration
    kubeadm certs generate-csrGenerate keys and CSRs (external CA mode)
  9. Use the GitButler TUI for workspace operations

    master

    The TUI provides a keyboard-driven interface for managing your workspace without typing full commands. Key capabilities include:

    • Inspection: View unassigned changes, branch lanes, commits, and file-level changes. Open details panes for branches, commits, files, or hunks.
    • Commits & Branches: Create commits (including empty commits), create branches, reword commits or branch names, and commit above or below a selected commit.
    • Movement & Reordering: Move commits or branches (including bulk moves), reorder stacks, and apply branches.
    • Changes Management: Rub changes into a branch or commit, and discard local work.
    • History: Undo and redo operations.
  10. Manage GitHub repositories with `gh repo`

    master

    The gh repo command allows you to create, clone, fork, view, edit, sync, and manage GitHub repositories.

    Argument Formats

    Repositories can be identified in two ways:

    • OWNER/REPO: e.g., cli/cli. If the OWNER/ part is omitted, it defaults to the authenticating user.
    • Full URL: e.g., https://github.com/OWNER/REPO.

    The --repo Flag

    Most gh subcommands (including pr, issue, release, etc.) accept the -R, --repo [HOST/]OWNER/REPO flag to target a repository other than the one in your current directory.

    $ gh pr list --repo cli/cli
    $ gh issue list --repo enterprise.internal/owner/repo