hyde46 / hoard Goto Github PK
View Code? Open in Web Editor NEWcli command organizer written in rust
Home Page: https://hyde46.github.io/hoard/
License: MIT License
cli command organizer written in rust
Home Page: https://hyde46.github.io/hoard/
License: MIT License
For example, I have a command that reuses a parameter many times like this:
echo hello #; echo I hope you find this message well, #; echo goodbye, #
Although there are three #
placeholders, they are all for the same param.
If I put such a command into hoard
today, when picking it, I will have to supply the same name "John" 3 times to get
echo hello John; echo I hope you find this message well, John; echo goodbye, John
What if I can tell hoard that those are the same parameter, such as:
echo hello #name; echo I hope you find this message well, #name; echo goodbye, #name
And when picking the command, instead of being asked for the first, second, and third params, I simply get asked for the name
param?
When filling out a parameterized command, colorize the parameter token different to the rest of the command
Add subcommand to show general info
See here for example.
This is true for all with_<x>_input()
methods.
The idea is to allow supplying Option<String>
for a default prompt.
However, currently if the default prompt is None
, the default prompt from dialoguer
is an empty string.
To fix this:
only add .default()
to the Input
object if the default_value
is Some
Awesome program! π
Would it be possible to allow editing the trove interactively in the TUI? I think it would be more convenient to browse the hoarded commands and edit them directly in the same interface, instead of browsing Β» remembering the name of a command Β»hoard edit #
Β» browsing again.
Also allow ending parameter token, so that name parameter can be defined without needing to have white space at the end.
for example sudo find / -iname "*#string*"
here hoard replaces everything after "#" unless you put a space after "#string".
Possible solution, we can define another parameter token like "@" or use same token twice for ending.
sudo find / -iname "*#string@*"
sudo find / -iname "*#string##*"
Enable editing commands in the GUI
I accessed the README.md link but a 404 was returned π€
Lines 171 to 173 in 7c3ff76
Create a neat little project page
template engines to consider:
Thanks for the nice tool. π
Often I end up having to type in different paths into what is essentially the same command. So basically have the path be a parameter but then either type the whole path or c&p it from a different terminal window. Here an autocompletion of path parameters would be super useful
reqwest
adds way too many dependencies to the project. Find something smaller!
Hey!
I want to package hoard for nixpkgs and it would be nice if you could commit the Cargo.lock file.
Are there any releases planned because the last one was 6 months ago?
Thanks!
Currently hoard config resides at ~/.config/.hoard
Rename .hoard
to hoard
.
Write small procedure checking if a user still has his trove.yml
and/or config.yml
in .hoard
and copy over these files to the new home directory ~/.config/hoard/
Selecting commands from hoard
if ran as zsh plugin sometimes yields weird outputs to the command line. But does not affect functionality when running the pasted command
Add Parameters support for hoarded commands.
When selecting/ running a command with parameters, start dialogue, asking for all parameters
I just stumbled upon this project (I'm a maintainer of atuin and it popped up in a search I made).
I notice you have a similar shell setup and managed to get crossterm to work, something we were struggling with.
Upon further inspection, it doesn't seem like you do anything different so I actually think it doesn't work for you, but only on ZSH + MacOS.
I came to this conclusion: atuinsh/atuin#331 (comment)
sharing it here since you may also run into it at some point
When importing a trove, commands can collide with already present commands.
See #38
OSX 12.3
Installed via brew
Shell: bash
When selecting a command via the \c-h
menu and using hoard.bash
, it returns to bash without any text filled out.
Changing the system shell to zsh chsh -s /bin/zsh
and using hoard.zsh
, it does work as expected.
Offer user to update trove.yaml entries with new parameter token if it gets changed
Necessary for further implementations after #115
Make GUI colors editable through config.yml
Currently multiple commands with the same name and namespace can be saved.
Either stop it from happening and throw an error, or ask for an alternative name or namespace
Many projects use Makefile, gradle, and npm and more to configure commands for their project, but we often need to read the code inside because those tools are difficult to write a detailed description.
If hoard
have the ability to read trove.yml
in the current directory, we will be able to search for those commands and give them descriptions.
This makes it possible to add trove.yml to each repository to manage commands.
# project root
Makefile # declare command
trove.yml # search, and execute in Makefile command.
Whether to load automatically or optionally needs to be discussed.
We could use uriparse crate or somehow parse the string into a URI and dispatch action based on the parsed object!
Add installers for
Currently a command is a string. But it should be a union of string and an object. So, we should make this a struct with optional arguments.
Proposal:
struct HoardCommandd {
command: String,
args: Vec<Arg>
}
struct Arg {
name: String,
value: Optional<String>
}
So if you run a command with args with no default value, there should spawn an interactive shell.
It'd be great to have a command like hoard shell-config $SHELL
that could be used like hoard shell-config fish | source
in order to ship shell configs embedded in the binary. This has the advantage of allowing shell configs to be automatically updated without the user having to do anything.
I'd like to create a PR for this :D
The default parameter token is '#'
Add command set_parameter_token
to replace that token in the hoard config.yml
Looks like cargo clippy
currently spits out about 450 lines of warnings. I think we should work towards reducing that number.
Add export
subcommand.
Asks the user for one or multiple namespaces, and/or single commands to export as a valid trove.yml
file
Thanks for this project!
I wanted to check it out, but following the README instructions leads me to
β― brew install hoard
==> Downloading https://github.com/Hyde46/hoard/releases/download/v1.0.0/hoard_v1.0.0_x86_64-apple-darwin.zip
==> Downloading from https://objects.githubusercontent.com/github-production-release-asset-2e65be/382835373/8d721b0f-19b
######################################################################## 100.0%
Error: hoard: SHA256 mismatch
Expected: f2ea22201c2490f5cebb27b53d50bff1745de784f699e8807013f9cc29828a63
Actual: 2e53a1511a0b691e636f6236d7b468368806310808ef63d937707c648dee2d52
File: /home/asdf/.cache/Homebrew/downloads/4e65b03a87b5c0da5c600058b00e641f48b2527e711365d917e85b2a22c5350f--hoard_v1.0.0_x86_64-apple-darwin.zip
To retry an incomplete download, remove the file above.
Would you be able to update the project?
If too many namespaces exist, they just get pushed out of the viewable widget space.
Introduce pagination to namespace tabs or make it scrollable
Add a overlay or separate page in the GUI, showing keyboard shortcuts
The clap
crate somewhat recently got the ability to declare command-line arguments as a struct as opposed to the current yaml solution. If we used this feature, we could could clean up the current code, as instead of something like sub_m.value_of("arg")
, getting an argument would be as simple as accessing a struct field: sub_m.arg
. This also increases performance, as there will no longer be a need to parse the yaml file declaring the arguments on every startup.
Clap got this feature in 3.0.0
, but hoard is currently still on 2.33.3
, so an upgrade would be necessary.
Create overlay in GUI to change colors interactively
On start check for availble updates.
Compare running version of hoard
with latest tag on github repository
Inform user of available update
Add option to save commands to clipboard.
Useful if hoard list
is not run with autocomplete as shell plugin
maybe default behaviour to create a symlink for each hoarded command?
Enable escaping characters in the saved command.
This would let users store commands with commands that carry the same characters as the parameter tokens (like #
and !
for denoting the start and end of a named parameter in a default configuration).
Running hoard list
and selecting a command cuts the command off in the GUI if it is too long.
Look for the right TUI wrapper to wrap the text to the next line(s).
Relevant piece of code here
Wrap the text block with
.wrap(Wrap { trim: true })
Create a bunch of trove files in /examples
for users to import, which also indicates how trove files are supposed to be used.
Needs #60 to be finished to be integrated nicely ( parameterized commands )
Exemplary trove files with themes:
If one forgets to assign the command to the proper namespace it would be nice to do this later on from within the program
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.