glassy-console
Version, currently master branch1 version
- master branchlatestOct 10, 2020
github.com/glassy-framework/glassy-console
Console of the Glassy Framework
1 stars
2 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
glassy-console:
github: glassy-framework/glassy-console
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.35.1- License
- MIT
- Author
- Anderson Danilo
Dependencies
Runtime Dependencies
- glassy-kernel*github: glassy-framework/glassy-kernel, branch: master
README
glassy-console
Console commands for the glassy framework
Installation
-
Add the dependency to your
shard.yml:dependencies: glassy-console: github: glassy-framework/glassy-console -
Run
shards install
Usage
We recommend using with the DI container, available in glassy-kernel.
Add the Console Bundle to your DI container:
require "glassy-kernel"
require "glassy-console"
require "./commands/my_command"
class AppKernel < Glassy::Kernel::Kernel
register_bundles [
Glassy::Console::Bundle,
MyAppBundle
]
end
Create your command:
require "glassy-console"
class MyCommand < Glassy::Console::Command
property name : String = "my:command"
property description : String = "my description"
@[Argument(name: "name", desc: "Name of the person")]
@[Option(name: "fill", desc: "Fill or not?")]
def execute(name : String, fill : Bool)
output.writeln("name = #{name}")
output.writeln("fill = #{fill}")
end
end
Add to your service file (services.yml)
services:
my_command:
class: MyCommand
kwargs:
input: '@console_input'
output: '@console_output'
tag:
- command
Now you can run setup your console application:
kernel = AppKernel.new
kernel.container.console_app.run(ARGV)
Development
Always run crystal spec before submiting code
Contributing
- Fork it (https://github.com/glassy-framework/glassy-console/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
- Anderson Danilo - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Oct 10, 2020
- Crystal
0.35.1- Indexed
- yes
Dependents
Repository
github.com/glassy-framework/glassy-console
Metadata
- Created
- Aug 19, 2026
- Updated
- Aug 19, 2026
- Synced
- Aug 19, 2026
- Versions
- 1