elhmn / ckp Goto Github PK
View Code? Open in Web Editor NEWStore and reuse your history and one liner scripts from anywhere, better than gists
License: MIT License
Store and reuse your history and one liner scripts from anywhere, better than gists
License: MIT License
We should add a release workflow github action that test, lint, build and release the ckp
cli.
It might be worth exploring equinox or goreleaser the later being opensource
Add ckp store solution
command, this command stores script entry as solution in the ~/.ckp/repo/store.yaml
file.
It works for the most part like the ckp store code
command except that it only takes the --path
and --comment
flags and create a solution
object instead of a code
object.
I realised that the history can end up being very heavy and slow down the search considerably
and also hide the more relevant script in a huge pile of command that are some times not very intersting
to reuse.
To solve the performance and make it easier to find the scripts that we stored, it will be better to separate the history
in a separate file ~/.ckp/repo/ckp_history.yaml
.
Additionally we should add the --history
flag to the ckp find
and the ckp list
command that will use the
ckp_history.yaml
file to list and find code entry. The command ckp rm
, ckp run
and later the ckp edit
command
should also add the --history
flag
We would like the command to add scripts from path using ckp add code --path
or ckp add solution --path
command
users should be able to add code or solution records from a code editor.
How it works:
ckp add code
will open a code editorThe ckp pull
command should fetch remote changes and apply local changes on top of the solution
repository HEAD
Note: again it is very important for things to work magically so that the user never have to fix conflicts or his git history
Add the the --output html
flag to the ckp
command so it render an html pages users can search view their
saved code snippets and solutions.
This is a first step to add a github.io page to allow the user to search for his script from any web browser
Change the code addition template to something easier to add and parse command
or solutions
## comment: enter your comment
## alias: enter your alias
#!/bin/sh
echo "write code here"
Minor feature request, but I think it would be useful to default to GitHub and support the follow init syntax along with the full git url in case the repo is hosted on another git hoster or GitHub Enterprise.
ckp init stefanbuck/ckp-storage
in addition of
ckp init [email protected]:stefanbuck/ckp-storage.git
The ckp push
command commit and push the ~/.ckp/repo
folder content to its remote bare repository
ckp push
command first makes sure that its master branch is rebased on top of the remote master branchNote that it is very important for conflicts to be solved magically, the user should never have to fix manually his solution
repository merge conflicts or git history
We need to add a github action workflow that test the code and the code style using a linter.
The workflow should be run a every push commit
Add a ckp rm
command that receives an ID
as parameter and removes the corresponding script entry
Note: the command should prompt a confirmation (y/n) before performing the deletion task
The ckp run
command will search for a script in the solution and run it with a bash
shell
The ckp find
command will be helpful to search for usual scripts or solutions.
When the command is run, a list of possible entries should be displayed on a list for the user to pick from. The user can enter a search text, the search result should be updated accordingly. The user can then select the command he wants and the script will be displayed on the output.
Additionally the command can benefit from having flags such has:
-c | --code
that will search for code only-s | --solution
that will search for solutions onlyIt will be problematic if users were to send secrets to their git repository using the history command.
To prevent this from happening we will flag every command that contains an indicator that it possibly contains a secret.
Code record that contains keys words like auth
, secret
, key
, token
, cred
will be flagged and a confirmation prompt
will be displayed to user
The ckp list
would like to list ckp commands, order by timestamps
The command will receive flags such as :
--code | -c
to list code only--limit | -l
to limit the count of entries--solution | -s
to list solutions onlyThis command removes .ckp/repo
folder and all the reference of this folder in your rc
files
Hi,
I really love the idea of ckp
. I do rely on aliases and my terminal history a lot to re-run commands which is kind of working but not always.
After installing the ckp
I was confronted with a weird error. Turns out I did not follow the setup instructions, in particular, I did not run ckp init
.
I'm pretty sure I'm not the only one that skims the instructions. How about adding a setup validation step that runs on every command and prints a hint if the initialization step is missing.
ckp add code 'echo hello'
Error: failed to pull remote changes: failed to fetch origin/main: chdir /Users/stefan/.ckp/repo: no such file or directory:
ckp add code 'echo hello'
Warning: The ckp storage repository is missing. Please run `ckp init` to complete the setup.
Looking forward to see how this project evolves, great work so far.
The ckp edit <script_sha>
command is taking a script sha
as argument which is stored in a file as an ID
The user can provide the informations required to edit his scripts or solution by sending them through flags such as
--alias | a
--comment | -m
--code | -c
--solution | -s
ckp
will remove the old_script entry and replace it with a new one containing the current newly edited data
Add a ckp sync history
command, that will add your code
script record in your history so you can use them right a way
Allow user to set the editor they would like to use to run the ckp add code
, ckp add solution
and ckp edit
commands.
Add the dependencies:
git >2.24.3 and Bash
Add brew installation steps in the README.
brew tap elhmn/ckp https://github.com/elhmn/ckp
brew install ckp
As we did for the ckp add code
and ckp add solution
command, on #32 we would like the local and remote store to be synchronised before and after the ckp add history
command performed the addition of code entry from the history.
The ckp sync alias
command will add your alias in a ~/.ckp/ckp_aliases
file and reference them in your main rc
file
The current algorithme is not very advanced, we would like to add a better fuzzy search type of algorithme
or add support for regular expressions in the search
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.