Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature pitch: Support defining of custom CLI commands through deploy.yml #639

Open
dhnaranjo opened this issue Jan 10, 2024 · 2 comments
Open

Comments

@dhnaranjo
Copy link

Hey, hi! I think it'd be handy to be able to define aliases in my config file to clean up repetitive commands I might want used across my team. For example allowing me to run kamal app console to get to my Rails console with the following config.

alias:
  app:
    console: app exec -i "bin/rails c --sandbox"
    angry_console: app exec -i "bin/rails c"

We might not want to pollute the cli with custom commands using names that might conflict with future features, so maybe it's all under kamal alias or kamal run or whatever.

If y'all are interested I'd be happy to knock together a PR for it.

@acidtib
Copy link
Contributor

acidtib commented Jan 11, 2024

As a workaround, consider incorporating a Makefile into your project. This file can house the custom commands that you and your team frequently utilize.

example

logs.web:
	kamal app logs -f -r web -d production

logs.job:
	kamal app logs -f -r job -d production
	
prod.recalculate:
	kamal app exec -d production -i --reuse 'bundle exec rake ranks:recalculate'

prod.console:
	kamal app exec -d production -i --reuse './bin/rails c'

@morgoth
Copy link
Contributor

morgoth commented Jun 6, 2024

In Rails project, we're just defining custom command in bin/some-name-of-the-command.
Maybe that would be enough for your needs @dhnaranjo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants