kommando
Version, currently 0.1.22 versions
- 0.1.3latestNov 16, 2025
- 0.1.2not indexedNov 16, 2025
github.com/Ragmaanir/kommando
Define CLI commands in crystal
Nothing has been indexed for 0.1.2 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
kommando:
github: Ragmaanir/kommando
version: ~> 0.1.2Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.2. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
Kommando 
Version 0.1.3
Kommando is a library that helps you build small and large command line interfaces in crystal.
Installation
Add this to your application's shard.yml:
dependencies:
kommando:
github: ragmaanir/kommando
Features
- positional arguments (like in
crystal init app MyApp) - short and long options (like
cli new MyProject --dry -v --permissions=644 --repo=github -l=MIT) - validation and type conversion of arguments
- auto-generated documentation
- namespaces/subcommands like
cli create user Toby
Rationale
Why classes for commands and not methods
Classes can define helper methods that are scoped to the command. And the helper methods have access to all options of the command.
Usage
Commands
record(User, name : String, age : Int32, height : Int32?, nickname : String?)
USERS = [] of User
class Create
include Kommando::Command
option(:height, Int32, "", validate: ->(v : Int32) { (100..250).includes?(v) })
option(:nickname, String, "", format: /\A[a-zA-Z]+\z/)
option(:dead, Bool, "Whether the person is dead", default: false)
arg(:name, String)
arg(:age, Int32)
def call
USERS << User.new(name, age, @height, @nickname)
end
end
test "create user with options" do
user = User.new("Christian", 55, 175, "Chris")
Create.call([
"-height=#{user.height}",
"-nickname=#{user.nickname}",
user.name, user.age.to_s,
])
assert USERS == [user]
end
Namespaces
require "kommando"
class Create
include Kommando::Command
def call
end
end
class Migrate
include Kommando::Command
def call
end
end
test do
root = Kommando::Namespace.root do
commands Create
namespace("db") do
commands Create, Migrate
end
end
assert root.commands.keys == ["create"]
assert root.namespaces.keys == ["db"]
root.run(["db", "create"])
end
Contributing
- Fork it (https://github.com/ragmaanir/kommando/fork)
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- ragmaanir ragmaanir - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.2- Tagged
- Nov 16, 2025
- Commit
0eaa4af3115e- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Ragmaanir/kommando
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2