{"id":15715826,"url":"https://github.com/gnapse/cheatr","last_synced_at":"2025-03-30T20:18:36.790Z","repository":{"id":9648294,"uuid":"11583480","full_name":"gnapse/cheatr","owner":"gnapse","description":"A simple command line utility to access cheat sheets from an online repository.","archived":false,"fork":false,"pushed_at":"2013-08-29T17:55:30.000Z","size":184,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-05T23:01:10.828Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnapse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-07-22T14:32:30.000Z","updated_at":"2013-10-06T16:37:03.000Z","dependencies_parsed_at":"2022-09-04T10:42:23.341Z","dependency_job_id":null,"html_url":"https://github.com/gnapse/cheatr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Fcheatr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Fcheatr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Fcheatr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnapse%2Fcheatr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnapse","download_url":"https://codeload.github.com/gnapse/cheatr/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246372743,"owners_count":20766635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:43:10.697Z","updated_at":"2025-03-30T20:18:36.760Z","avatar_url":"https://github.com/gnapse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cheatr\n\nCheatr is a simple command line utility to access cheat sheets from an online\nrepository.\n\nGenerally speaking, cheatr is a tool that allows to host an online collection\nof cheat sheets, and lets users query and maintain this repository remotely via\na command line client utility.\n\n### What is a cheat sheet?\n\nIn the context of cheatr, a cheat sheet is a small document with quick tips and\nhints on a concrete and specific topic.  Typically it contains notes intended\nto aid one's memory, like listing common and useful shortcuts used on a\nprogram, quick and easy tips on how to use a library, or the command line\noptions of a shell command, for instance.\n\nCheatr however enforces very little on the contents of the cheat sheets in a\nrepository.  The above specification is just a guideline on the intended use of\nthis tool, but in practice you can use it to store and maintain any collection\nof text documents in it.\n\nFurther down this document you'll find more information about the format of\n[cheat sheet contents](#cheat-sheet-contents).\n\n## Installation\n\n    $ gem install cheatr\n\n## Usage\n\nCheatr retrieves cheat sheets from a remote server, so we need to tell cheatr\nwhere to look.\n\n    $ cheatr config server cheatr.gnapse.com\n\nThis generates a configuration file in `~/.cheatr/config.yml`.  Now we can\nstart querying the remote server for cheat sheets, or start creating new ones.\n\n    $ cheatr show \"ruby*\"  # Cheat sheets with names starting with 'ruby'\n    ruby.strings\n    ruby.blocks\n    rubygems\n\n    $ cheatr search ruby   # With this command you can ommit the wildcard\n    ruby.strings\n    ruby.blocks\n    rubygems\n\n    $ cheatr all           # Lists all cheat sheets available\n    ack\n    bash\n    cplusplus\n    ...\n    ruby\n    vim\n    zsh\n\nTell cheatr to show a given cheat sheet.\n\n    $ cheatr show ruby.blocks\n    Ruby blocks are an awesome language feature!\n\nThe contents of a cheat sheet are cached once it has been fetched.  You can\nforce cheatr to fetch remote contents.\n\n    $ cheatr show ruby.blocks -r\n\nYou can edit existing cheat sheets, or create new ones.\n\n    $ cheatr edit ruby.blocks\n\nThis will launch you preferred `$EDITOR` with the current contents of the\nspecified cheat sheet.  After you save the file and quit the editor, `cheatr`\nwill update the cheat sheet contents.\n\nCheatr commands provide help, so you can discover all its features and\npossibilities. Type `cheatr --help` or `cheatr \u003ccommand\u003e --help` for details.\n\n## Web server\n\nThis gem includes the server side component as well, so anyone can host their\nown cheat sheets service.  This server offers the basic API-like calls to\nquery, retrieve and modify cheat sheet contents.  You can start a cheatr server\nwith the following command:\n\n    $ cheatr server /path/to/cheatr/repository\n\nThe repository path refers to the location where the cheats repository can be\nfound.  A cheatr repository is nothing more than a git repository holding the\ncheat sheets as files in it.  If omitted, the current working directory is\nassummed.\n\nA cheatr server is a [sinatra][] app, so it can also be started using [rack][].\nEvery cheatr repository, when created, is initialized with a standard\n`config.ru` file.  So while placed in the repository's root folder, the server\ncan be started with the following command:\n\n    $ rackup\n\nAlso try `rackup --help` for more options.\n\n[sinatra]: http://www.sinatrarb.com\n[rack]: https://github.com/rack/rack\n\n### Web interface\n\nAdditionally, cheatr servers can be accessed directly on a browser, where\ncontent is delivered as traditional hyperlinked web pages instead of mere plain\ntext, with the possibility to search for cheat sheets, or [link between\nthem](#cheat-sheet-hyperlinks), converting cheatr in a simple but powerful\ncheat sheets wiki.\n\nTo try this, type the following command:\n\n    $ cheatr browse ruby.blocks\n\nIt will open the contents of the specified cheat sheet in your preferred\nbrowser.  Or you can always type the URLs in your browser yourself, provided\nyou know the cheatr server you want to access.\n\n## Cheat sheet contents\n\nAlthough cheatr does not enforce any format to the contents of cheat sheets,\nit assumes they consist of markdown text.  Thus is highly beneficial to adhere\nto this convention, and embrace it.\n\n### Cheat sheet hyperlinks\n\nIn addition to standard markdown syntax, cheatr supports a minor custom\nextension, that becomes useful when browsing a cheatr server in a web browser.\nThis is related to linking in between cheat sheets, as hinted in the previous\nsection.\n\nThis is best shown with an example.\n\n```\nDynamic languages, like {{ruby}} and {{python}}, are more versatile than\n{{c++|cplusplus}} in many situations.\n```\n\nNoticed the slices of text surrounded by doble braces?  These are cheatr\nhyperlinks.  When showing pages through the web interface in a browser, these\nwill be converted to links to the appropriate cheat sheet.\n\nNote also the link to the `cplusplus` cheat sheet.  The text before the\nvertical bar will be used as the link text, whereas the text after it is the\nname of the cheat sheet to link to.\n\nIn the command line, these \"links\" will be shown unmodified, still serving the\npurpose of discovery, because the user can identify these \"links\" and discover\nnew related topics to continue \"browsing\" and learning.\n\n## Contributing\n\nFeel free to dive into the code to understand more about how cheatr works, or\njust for fun.  Please note that this is a very young project with very rough\nedges still.  Issue reports, feature and design suggestions, as well as pull\nrequests, are all welcome!\n\nIn case you decide to step in:\n\n1. Fork the repo (`git clone https://github.com/gnapse/cheatr.git`)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\nAnd don't forget to take a look at the [open issues][] in case you need some\ninspiration on what to work on.\n\n[open issues]: https://github.com/gnapse/cheatr/issues\n\n## Thanks\n\nThanks to [defunkt][] for [cheat][], which provided the idea for this project.\n\n[defunkt]: https://github.com/defunkt\n[cheat]: https://github.com/defunkt/cheat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnapse%2Fcheatr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnapse%2Fcheatr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnapse%2Fcheatr/lists"}