
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
A Library to speed up CLI apps development
Add this line to your application's Gemfile:
gem 'tlopo-cli'
And then execute:
bundle
Or install it yourself as:
gem install tlopo-cli
Simple usage:
require 'tlopo/cli'
class Command
def self.run(opts)
puts opts
end
end
cfg = {
'name' => 'command',
'banner' => "My ClI\n Run my-cli with ARGS\nOPTIONS:\n",
'class' => 'Command',
'switches' => [{
'name' => 'filename',
'short' => '-f',
'long' => '--filename <Filename>',
'desc' => 'Sets filename'
}]
}
Tlopo::Cli.new(config: cfg).run
In action:
$ ruby /tmp/my-cli.rb --help
My ClI
Run my-cli with ARGS
OPTIONS:
-f, --filename <Filename> Sets filename
$ ruby /tmp/my-cli.rb -f /etc/hosts
{"filename"=>"/etc/hosts"}
You can have as many subcommands as you want, options will be parsed.
require 'tlopo/cli'
class Command
def self.run(opts)
puts opts
end
end
class SubCommand1
def self.run(opts)
puts opts
end
end
class SubCommand2
def self.run(opts)
puts opts
end
end
cfg = {
:globals => true, # This will include the options for each 'parent' command
:usage => true, # This will add _usage in opts commands/subcommands can print it if needed
'name' => 'command',
'banner' => "command\nOPTIONS:\n",
'class' => 'Command',
'switches' => [{ 'name' => 'arg1', 'short' => '-a', 'long' => '--arg1 <arg1>', 'desc' => 'Sets arg1'}],
'subcommands' => [
{
'name' => 'subcommand1',
'banner' => "Subcommand1\nOPTIONS:\n",
'class' => 'SubCommand1',
'switches' => [{ 'name' => 'arg1', 'short' => '-a', 'long' => '--arg1 <arg1>', 'desc' => 'Sets subcommand1 arg1'} ],
'subcommands' => [
{
'name' => 'subcommand2',
'banner' => "Subcommand2\nOPTIONS:\n",
'class' => 'SubCommand2',
'switches' => [{ 'name' => 'arg1', 'short' => '-a', 'long' => '--arg1 <arg1>', 'desc' => 'Sets subcommand2 arg1'}]
}
]
}
]
}
Tlopo::Cli.new(config: cfg).run
In action:
$ ruby /tmp/my-cli.rb -a 1 subcommand1 -a 2 subcommand2 -a 3
{"arg1"=>"3", "_globals"=>{"command"=>{"class"=>"Command", "arg1"=>"1"}, "command::subcommand1"=>{"class"=>"SubCommand1", "arg1"=>"2"}}}
The configuration can also be a yaml or json file:
Tlopo::Cli.new(config_file: './cli-config.yml')
git checkout -b my-new-feature
)rake test rubocop
, add new tests if needed.git commit -am 'Add some feature'
)git push origin my-new-feature
)This library is tested with Minitest. Please run all tests before submitting a Pull Request, and add new tests for new functionality.
Running tests:
rake test
FAQs
Unknown package
We found that tlopo-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.