GithubHelp home page GithubHelp logo

elhmn / ckp Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 0.0 381 KB

Store and reuse your history and one liner scripts from anywhere, better than gists

License: MIT License

Go 91.31% Makefile 0.87% Shell 6.83% Ruby 0.99%
bash bash-alias bash-script bash-scripting cli

ckp's People

Contributors

bw-bmbarga avatar elhmn avatar goreleaserbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ckp's Issues

Add a `test and lint` action

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 `ckp store solution` command

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.

Add `ckp reset` command

This command removes .ckp/repo folder and all the reference of this folder in your rc files

implement a different code addition template

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"

Add a `release` workflow

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 GitHub slug support for init command

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

Add `ckp rm` command

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

Add `ckp sync alias` command

The ckp sync alias command will add your alias in a ~/.ckp/ckp_aliases file and reference them in your main rc file

Add `ckp sync history` command

Add a ckp sync history command, that will add your code script record in your history so you can use them right a way

Add `ckp push` command

The ckp push command commit and push the ~/.ckp/repo folder content to its remote bare repository

  • The ckp push command first makes sure that its master branch is rebased on top of the remote master branch
  • In case of conflicts it should cleverly figure out a way to solve them
  • Then add the current changes to the index, create a commit and push the changes to the remote repository

Note 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

Add `ckp find` command

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 only

Add `ckp run` command

The ckp run command will search for a script in the solution and run it with a bash shell

Add `ckp pull` command

The 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 `ckp edit` command

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 `ckp list -o html` command

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

Improve onboarding

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.

Current behaviour

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:

Expected behaviour

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.

`ckp add history` should prompt a confirmation for commands exposing secrets

It 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

Add `ckp list` command

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 only

`ckp add history` must store file in a separate file named ckp_history.yaml

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.