Just pushed a new version,ales it much easier to plugin your own custom stuff. Still need a good example of this on GitHub...
Take. A look at the Hof leap, there are some examples of jumping to a dir, found something, and then hopping back to where you were. Super useful for building tools you are working on but don't need the extra shell session
So I've read through the README and I still have no idea how it works or what it even is. Is this a concept I should've heard of before or is it related to some other project/concept?
I get it because I do something similar: I discover I have some command (`annoyingly long but repeatable command `) that I run in a particular repo (`repo\over\there`) frequently. For me, I then alias switching to that repo with a 1-3 letter sequence: `rot` and the command to `alc` (annoyingly long but repeatable command). Often I want these to be semipermanent so the aliases are added to my bashrc.
This project looks like it is streamlining and organizing-per-project this kind of workflow / preference for short aliases, with helpful conventions like "?" that act sort of like a tab-completion hint.
In any folder, you put all your favorite One-liners for that folder into a file called “.ok”.
Then you can run them command with “ok 1” for the first command, or “ok 2” for the second command, etc. Use “ok” by itself to pretty-print all the available commands in that folder.
I started the project but my friend @doekeman took it waaay further than I ever dreamed.
It’s really helpful if you have a bunch of different projects that you work on, and need a way to remember all their different commands and incantations.
There’s a Powershell version too (ok-ps).
For there bit where I jump around from one project to another I use a system called markjump. It’s great too.
Have you shown a “getting started with makefiles” guide to a team member who is brought in to help with documentation or accessibility or pretty much anything other than development? It is cryptic in the true sense of the word.
And yet, ok files are not a competitor to makefiles. Use both together.
It’s lighter-weight. Not as cryptic. Can also hook it up to your makefile targets, make them easier to access.
The only additional “weight” in the Makefile would be the name of the target, where you leave it out and have it default to 1, 2, … n, which I would argue is more cryptic, as “make build” or “make deploy” is always doing that action, whereas “ok 2” could be deploy in one folder, and push in another.
As for easy access, most shells should offer you tab completion for the Makefile’s targets, and your development environment may also pick up the existence of the Makefile and offer a way to run the targets.
Additionally Makefiles allow to setup dependencies, for example in your ok file example you have ./build.sh and ./deploy.sh as two actions: Clearly build should be a dependency of deploy, so “make deploy” implies building, rather than having to always do “ok 1 && ok 2”.
Lastly there is the ability to do dry-runs with Makefiles, once you start to setup dependencies…
You haven’t used or experienced .ok files and are seeing them as a competitor to makefiles and being very defensive. They’re not a competitor to makefiles.
With ok you can also name the commands. It’s optional.
I would suggest using both, in a project that involves building, if you are already comfortable with makefiles. You may also have npm scripts, again I’d suggest both. You’ll probably find it quite comfortable and fun.
Makefiles have more features but bring with them more complexity and nuance, for example the dependency features, which are useful for making but a hindrance for a lot of other project tasks. When I show a “getting started with makefiles” guide to my documentation friend they look at me like I’m insane. It is truly cryptic to the uninitiated. But you already understand makefiles, so try using both.
I use it and it does not make my project more spaghetti.
Be sure to let me know when you put something out in the world. You’ll find that i come around and act in an encouraging manner and do not take pot shots at it without trying it out. Please do not be unkind.
While this is a fair thing to say, your original response to my comment wasn't exactly inviting of a positive discussion. It sounded pretty dismissive to me.
Hi Kaze404. I think I see what you mean and I’m sorry for that. The “lol” wasn’t called for. That comes from my own personal frustration. Thanks for coming back and saying that now. I understand.
I modify “cd” so that every time I change directory it calls “ok” and thus I get a pretty print of the most useful 1-line commands for that folder. I have .ok in all my projects.
Some of those have makefiles, some have cake, some have grunt, some have npm scripts. Many are pure documentation folders (books etc).
ok isn’t primarily a build system or a task runner, it’s a folder profile.
Asking “what can x do that y cannot do?” invokes the Turing tarpit. A better question is “why is it more pleasant to use x with or instead of y?” ...particularly since they can be used together.
The thing ok can do what make can't, is work on the current shell. With ok, you can:
* navigate to another folder/directory
* set an environment variable
I use both make and ok. For me, if I want to "make" stuff, I use make (compile, sign, zip, deploy etc.). The ok-files, I use for ad-hoc stuff, like viewing log files). It's also a good command's I can't seem to remember. A bit less structured.
So I guess it's not only a technical difference, but also a slightly conceptual difference.
I must say I do have a lot of (rather) small git-repo's I work on. And not every day. So when I switch to some kind of project, it helps me work faster. But your situation might differ...
Quickly editing, reloading, and refreshing from anywhere. Also the persistence between shells and a dot file loading.
Another nice thing is you environment bar secrets are only exposed during command execution when they are needed. (See how the .jumpfiles.secrets.sh is used)
It's also largely an experimentation ground for some upcoming Hof features.
- z (https://github.com/agkozak/zsh-z) to partial-match on a frequency-weighted directory switch (eg, `z Proj <RET>` will move me to `$HOME/Code/Projects/`.
CDPATH The search path for the cd command. This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command. A sample value is ".:~:/usr".
Jumpfiles got ephemeral VMs and k8s last night, so if you want to enable consistent dev envs and debugging, there are some options. Email me if you'd like to know more about what we are planning and some of the more leading edge capabilities.
For anyone interested, we added some bounties so you can make money contributing to Jumpfiles and our other open source projects. I personally made my independent start freelancing and would now like to support others.
35 comments
[ 2.8 ms ] story [ 81.2 ms ] threadTake. A look at the Hof leap, there are some examples of jumping to a dir, found something, and then hopping back to where you were. Super useful for building tools you are working on but don't need the extra shell session
This project looks like it is streamlining and organizing-per-project this kind of workflow / preference for short aliases, with helpful conventions like "?" that act sort of like a tab-completion hint.
In any folder, you put all your favorite One-liners for that folder into a file called “.ok”.
Then you can run them command with “ok 1” for the first command, or “ok 2” for the second command, etc. Use “ok” by itself to pretty-print all the available commands in that folder.
I started the project but my friend @doekeman took it waaay further than I ever dreamed.
It’s really helpful if you have a bunch of different projects that you work on, and need a way to remember all their different commands and incantations.
There’s a Powershell version too (ok-ps).
For there bit where I jump around from one project to another I use a system called markjump. It’s great too.
It’s lighter-weight. Not as cryptic. Can also hook it up to your makefile targets, make them easier to access.
The other thing people say is “isn’t that same as npm scripts?” — it can complement those as well.
I modify “cd” so that on entering any folder it shows me the available .ok commands, if any.
But yeah, other than that Makefiles aren't cryptic :)
And yet, ok files are not a competitor to makefiles. Use both together.
The only additional “weight” in the Makefile would be the name of the target, where you leave it out and have it default to 1, 2, … n, which I would argue is more cryptic, as “make build” or “make deploy” is always doing that action, whereas “ok 2” could be deploy in one folder, and push in another.
As for easy access, most shells should offer you tab completion for the Makefile’s targets, and your development environment may also pick up the existence of the Makefile and offer a way to run the targets.
Additionally Makefiles allow to setup dependencies, for example in your ok file example you have ./build.sh and ./deploy.sh as two actions: Clearly build should be a dependency of deploy, so “make deploy” implies building, rather than having to always do “ok 1 && ok 2”.
Lastly there is the ability to do dry-runs with Makefiles, once you start to setup dependencies…
With ok you can also name the commands. It’s optional.
I would suggest using both, in a project that involves building, if you are already comfortable with makefiles. You may also have npm scripts, again I’d suggest both. You’ll probably find it quite comfortable and fun.
Makefiles have more features but bring with them more complexity and nuance, for example the dependency features, which are useful for making but a hindrance for a lot of other project tasks. When I show a “getting started with makefiles” guide to my documentation friend they look at me like I’m insane. It is truly cryptic to the uninitiated. But you already understand makefiles, so try using both.
I am still not going to add another tool that makes my project even more spaghetti than it already is.
Be sure to let me know when you put something out in the world. You’ll find that i come around and act in an encouraging manner and do not take pot shots at it without trying it out. Please do not be unkind.
What is it that ok files can do that Makefiles don’t?
I don’t buy your complexity argument, a Makefile can be as simple as:
Now you can run “make 1” and you have the same as “ok 1”.Although most people would name this “build” rather than “1”, so you “make build”.
And the equivalent ok file would be:
So the only syntactical difference is that make require a newline after the colon.Some of those have makefiles, some have cake, some have grunt, some have npm scripts. Many are pure documentation folders (books etc).
ok isn’t primarily a build system or a task runner, it’s a folder profile.
Asking “what can x do that y cannot do?” invokes the Turing tarpit. A better question is “why is it more pleasant to use x with or instead of y?” ...particularly since they can be used together.
* navigate to another folder/directory * set an environment variable
I use both make and ok. For me, if I want to "make" stuff, I use make (compile, sign, zip, deploy etc.). The ok-files, I use for ad-hoc stuff, like viewing log files). It's also a good command's I can't seem to remember. A bit less structured.
So I guess it's not only a technical difference, but also a slightly conceptual difference.
I must say I do have a lot of (rather) small git-repo's I work on. And not every day. So when I switch to some kind of project, it helps me work faster. But your situation might differ...
Another nice thing is you environment bar secrets are only exposed during command execution when they are needed. (See how the .jumpfiles.secrets.sh is used) It's also largely an experimentation ground for some upcoming Hof features.
- direnv (https://direnv.net) for project-specific environment variable management and more
- fzf (https://github.com/junegunn/fzf) for rifling through history and finding files quickly.
- z (https://github.com/agkozak/zsh-z) to partial-match on a frequency-weighted directory switch (eg, `z Proj <RET>` will move me to `$HOME/Code/Projects/`.
CDPATH The search path for the cd command. This is a colon-separated list of directories in which the shell looks for destination directories specified by the cd command. A sample value is ".:~:/usr".
This works with tab completion.
https://github.com/rupa/z
Jumpfiles got ephemeral VMs and k8s last night, so if you want to enable consistent dev envs and debugging, there are some options. Email me if you'd like to know more about what we are planning and some of the more leading edge capabilities.