diff --git a/Gemfile b/Gemfile
index b7a1c8d..89fc92f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -12,8 +12,8 @@ gem 'jruby-openssl', '~> 0.7', platforms: :jruby
# Ronin dependencies
# gem 'ronin-support', '~> 1.0', github: 'ronin-rb/ronin-support',
# branch: 'main'
-# gem 'ronin-core', '~> 0.1', github: 'ronin-rb/ronin-core',
-# branch: 'main'
+gem 'ronin-core', '~> 0.2', github: 'ronin-rb/ronin-core',
+ branch: '0.2.0'
gem 'ronin-db', '~> 0.2', github: 'ronin-rb/ronin-db',
branch: '0.2.0'
gem 'ronin-db-activerecord', '~> 0.2', github: 'ronin-rb/ronin-db-activerecord',
diff --git a/README.md b/README.md
index b4cdcaa..f5d229c 100644
--- a/README.md
+++ b/README.md
@@ -56,6 +56,7 @@ Arguments:
[ARGS ...] Additional arguments for the command
Commands:
+ completion
help
lfi
open-redirect
@@ -273,7 +274,7 @@ end
* [Ruby] >= 3.0.0
* [ronin-support] ~> 1.0
-* [ronin-core] ~> 0.1
+* [ronin-core] ~> 0.2
* [ronin-db] ~> 0.2
## Install
diff --git a/gemspec.yml b/gemspec.yml
index 4f1466a..c740f47 100644
--- a/gemspec.yml
+++ b/gemspec.yml
@@ -26,6 +26,7 @@ required_ruby_version: ">= 3.0.0"
generated_files:
- data/completions/ronin-vulns
+ - man/ronin-vulns-completion.1
- man/ronin-vulns-lfi.1
- man/ronin-vulns-rfi.1
- man/ronin-vulns-sqli.1
@@ -37,7 +38,7 @@ generated_files:
dependencies:
ronin-support: ~> 1.0, >= 1.0.1
- ronin-core: ~> 0.1
+ ronin-core: ~> 0.2
ronin-db: ~> 0.2
development_dependencies:
diff --git a/lib/ronin/vulns/cli/commands/completion.rb b/lib/ronin/vulns/cli/commands/completion.rb
new file mode 100644
index 0000000..906d1a9
--- /dev/null
+++ b/lib/ronin/vulns/cli/commands/completion.rb
@@ -0,0 +1,63 @@
+# frozen_string_literal: true
+#
+# ronin-vulns - A Ruby library for blind vulnerability testing.
+#
+# Copyright (c) 2022-2023 Hal Brodigan (postmodern.mod3 at gmail.com)
+#
+# ronin-vulns is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# ronin-vulns is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with ronin-vulns. If not, see .
+#
+
+require 'ronin/vulns/root'
+require 'ronin/core/cli/completion_command'
+
+module Ronin
+ module Vulns
+ class CLI
+ module Commands
+ #
+ # Manages the shell completion rules for `ronin-vulns`.
+ #
+ # ## Usage
+ #
+ # ronin-vulns completion [options]
+ #
+ # ## Options
+ #
+ # --print Prints the shell completion file
+ # --install Installs the shell completion file
+ # --uninstall Uninstalls the shell completion file
+ # -h, --help Print help information
+ #
+ # ## Examples
+ #
+ # ronin-vulns completion --print
+ # ronin-vulns completion --install
+ # ronin-vulns completion --uninstall
+ #
+ # @since 0.2.0
+ #
+ class Completion < Core::CLI::CompletionCommand
+
+ completion_file File.join(ROOT,'data','completions','ronin-vulns')
+
+ man_dir File.join(ROOT,'man')
+ man_page 'ronin-vulns-completion.1'
+
+ description 'Manages the shell completion rules for ronin-vulns'
+
+ end
+ end
+ end
+ end
+end
diff --git a/man/ronin-vulns-completion.1.md b/man/ronin-vulns-completion.1.md
new file mode 100644
index 0000000..a3ed395
--- /dev/null
+++ b/man/ronin-vulns-completion.1.md
@@ -0,0 +1,78 @@
+# ronin-vulns-completion 1 "2024-01-01" Ronin Repos "User Manuals"
+
+## NAME
+
+ronin-vulns-completion - Manages shell completion rules for `ronin-vulns`
+
+## SYNOPSIS
+
+`ronin-vulns completion` [*options*]
+
+## DESCRIPTION
+
+The `ronin-vulns completion` command can print, install, or uninstall shell
+completion rules for the `ronin-vulns` command.
+
+Supports installing completion rules for Bash or Zsh shells.
+Completion rules for the Fish shell is currently not supported.
+
+### ZSH SUPPORT
+
+Zsh users will have to add the following lines to their `~/.zshrc` file in
+order to enable Zsh's Bash completion compatibility layer:
+
+ autoload -Uz +X compinit && compinit
+ autoload -Uz +X bashcompinit && bashcompinit
+
+## OPTIONS
+
+`--print`
+: Prints the shell completion file.
+
+`--install`
+: Installs the shell completion file.
+
+`--uninstall`
+: Uninstalls the shell completion file.
+
+`-h`, `--help`
+: Prints help information.
+
+## ENVIRONMENT
+
+*PREFIX*
+: Specifies the root prefix for the file system.
+
+*HOME*
+: Specifies the home directory of the user. Ronin will search for the
+ `~/.cache/ronin-vulns` cache directory within the home directory.
+
+*XDG_DATA_HOME*
+: Specifies the data directory to use. Defaults to `$HOME/.local/share`.
+
+## FILES
+
+`~/.local/share/bash-completion/completions/`
+: The user-local installation directory for Bash completion files.
+
+`/usr/local/share/bash-completion/completions/`
+: The system-wide installation directory for Bash completions files.
+
+`/usr/local/share/zsh/site-functions/`
+: The installation directory for Zsh completion files.
+
+## EXAMPLES
+
+`ronin-vulns completion --print`
+: Prints the shell completion rules instead of installing them.
+
+`ronin-vulns completion --install`
+: Installs the shell completion rules for `ronin-vulns`.
+
+`ronin-vulns completion --uninstall`
+: Uninstalls the shell completion rules for `ronin-vulns`.
+
+## AUTHOR
+
+Postmodern
+
diff --git a/spec/cli/commands/completion_spec.rb b/spec/cli/commands/completion_spec.rb
new file mode 100644
index 0000000..0550a39
--- /dev/null
+++ b/spec/cli/commands/completion_spec.rb
@@ -0,0 +1,22 @@
+require 'spec_helper'
+require 'ronin/vulns/cli/commands/completion'
+require_relative 'man_page_example'
+
+describe Ronin::Vulns::CLI::Commands::Completion do
+ it "must inherit from Ronin::Core::CLI::CompletionCommand" do
+ expect(described_class).to be < Ronin::Core::CLI::CompletionCommand
+ end
+
+ it "must set completion_file" do
+ expect(described_class.completion_file).to eq(
+ File.join(Ronin::Vulns::ROOT,'data','completions','ronin-vulns')
+ )
+ end
+
+ it "must set man_dir" do
+ expect(described_class.man_dir).to_not be(nil)
+ expect(File.directory?(described_class.man_dir)).to be(true)
+ end
+
+ include_examples "man_page"
+end