ColdBox : CLI Commands

Hi there everyone…

This is a little long - sorry.

Let me start with a few things, please:

  • I am completely new to ColdBox and all of it’s modules.
  • While your documentation is prolific: and everything you ever need is IN there somewhere… finding what you think you need is difficult at the time, you’re looking for it.

Let me give you an example of why I am struggling and then, what I am hoping for some help with, PLEASE!

Topic XXX
You can configure Topic XXX with the following JSON ...

That’s great - I DO need to know the structure and the options - but what file do they go in? And at what level of nesting?

I certainly do see in some of the documentation things like
“This goes in the Coldbox.cfc or the modules own XXX.cfc”
But the above line is missing from a lot of the documentation where you provide examples.

As the author of the documentation - you have a lot of inherent knowledge - so to you it is spectacularly obvious that because you’re talking about YYY - it goes in the ZZZ.cfc - that you find in the DDD/ddd/CCC directory.

As a newcomer to the framework/libraries AND your documentation - there is nothing obvious about any of it, at all.

I am happy to create PRs, that insert the parts “I” think are missing. I just can’t do it, right now - as I don’t know the specifics. That is I can create a bookmark/review - that says *“THIS paragraph needs to mention the file and the location in that file for the snippet below.”
“I” just don’t know what file or where in the file the snippet belongs at this moment.

Back to my inability to successfully use the documentation…
For CommandBox - I found the documentation really difficult to follow until I treated it like a “CookBook”- as opposed to reading it from page1 → the end.
Once I shifted how I thought of the documentation - I managed to find what I was looking for, when I was looking for it.

I am also aware that you supply quite a few skeleton applications…
And I am aware that the XXX skeleton app is one “example” of using module XXX.

What you don’t have - or at least I can’t find one…
Is a skeleton application that incorporates different modules together.

I want to create a ColdBox application that uses

  • ORM for basic CRUD (I don’t much care if it is Hibernate or Quick) - BTW is one preferred over the other?
  • Some sort of login capability (I am not really fussed at THIS stage)
  • CBSecurity for authorising events via Application role (something very basic, like)
  1. READ-ROLE can only “list/view” records
  2. The EDIT-ROLE can additionally “update”
  3. The CREATE-ROLE can additionally “create”
  4. The DELETE-ROLE can additionally “delete” records.
  • CBSecurity (as a whole) for all the CSRF/XSS/Etc protections that are available.

A skeleton that sets up all you need to have a CRUD application exposed to the “public”, safely.

There is a skeleton app (whether it is yours (Ortus) of someone else’s - doesn’t matter), individually for:

  • Hibernate ORM
  • Quick ORM
  • Authentication
  • Authorisation
  • Firewall Security (XSS/etc)

Just not one that does it all.
(Again - at least not one that I could find and I have looked for a few days now.)

Lastly: (and thanks for staying with me this long)
Is there a Cheat sheet available for all the CLI commands that I can use when working with a ColdBox application?

Step 1: Create a new app (use coldbox create app help, to see all options)

  • coldbox create app

Step 2: Create a new Handler (use coldbox create handler help, to see all options)

  • coldbox create handler

To create a handler that includes all the CRUD actions: You can use

  • coldbox create handler resource="true"

So ultimately you end up with a cheat sheet of CommandBox CLI commands (broadly in order) that you can use to create an entire application…

Further - are there coldbox-cli commands that will let you incorporate “authorisation” rules into the portions you’re creating?

As always thanks very much!

In CommandBox, type help:

You can get help for an entire namespace like help coldbox:

Or for a specific command:

HI @MichaelBorn,

Thanks for the reply…
The help in the CommandBox CLI is genuinely pretty awesome and I use it all the time.

My issue is that being new to ColdBox - I am not really sure what to look for and where.
Eg:
I can create a ColdBox view with coldbox create view.
However if I were to use coldbox create handler views=true - I can create the handler and the view - all in the one command, with everything tied together/in-sync for me.

My point is - I will have to run the help for absolutely every single command AND experiment with it - so as to get a understanding of what it does and more importantly what it doesn’t do - that I have to do manually - or as an additional step.

And then repeat all of that for every single ColdBox module.

I am not afraid of doing the work… but it will take a lot of time: so if it is already done - why replicate work that already exists?

Also - just through lack of knowledge/exposure (as with my create view/handler example) - With multiple ways to do things - one way might very well be more beneficial than an another.

Especially when I am asking if there such a CLI command that I might use that incorporates things like ORM/Authentication/Authorisation…

As a “new” developer in the ColdBox “space”: There is a spectacular amount to have to grok.

Not trying to be combative, but it sounds as if you’re complaining that you have to learn. Learning is a must in this profession, as is reading the documentation, as is experimentation and learning-by-doing.

You asked “Is there a Cheat sheet available for all the CLI commands that I can use…”. I answered that question.

There is no skeleton app or template that covers your exact use case, because your use case is specific to you. If we created such a sample app, I doubt more than 5 people would use it over the next decade. I certainly would not. There is very little to gain and an extreme amount of maintenance that goes into keeping these sample apps up to date with every module.

  1. Create your skeleton app via coldbox create app.
  2. Then install cbsecurity, play with it until you have it working with hardcoded roles
  3. Then begin adding an ORM layer.
  4. Then refactor your cbsecurity config to use your ORM-loaded user roles.
  5. etc, etc.

Search google.com. Search the ColdBox Ortus gitbook. Watch the CFML or BoxTeam slack and learn from the questions. Read the Q&A’s on this forum.

There’s a ton to learn from, and you will have to learn. There’s no way we can preempt your questions - we can’t answer a question you haven’t asked. You aren’t going to find a guide encompassing only your favorite ColdBox modules, and you shouldn’t use it if you found one. Read the documentation for each module separately, because those are going to be more up-to-date than an all-encompassing guide.

Hope that helps. I was in your place 5-6 years ago, and I found that experience comes with experience. :slight_smile:

1 Like

I love a good discussion / disagreement.
Agreeing to disagree and being able to robustly defend a point of view / perspective - seems to missing from just about everywhere - and especially from the “online” world.

And just so everyone is clear - I am not complaining either. Especially not - at learning or having to do the work…
Just after the lay of the land / exposure to available resources that I might not be aware of…

I realise people can blatantly lie - and often do in an online forum - but I did include:

Any who… off to do some learning…

Maybe I missed this somewhere above, but don’t forget to watch everything you can on https://cfcasts.com. I went through what you’re going through a couple of years ago. It is worth it in the end for sure. I found CFCASTS to be essential.

1 Like